diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba9021f22..bf22cbe87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ 2. فایل `.po` مورد نظر را با [Poedit](https://poedit.net) یا هر ویرایشگر متنی باز کنید. - در Poedit رشته‌های ترجمه‌نشده یا `fuzzy` را از پنل فیلتر (Filter) پیدا کنید. 3. متن `msgid` را ترجمه کنید و در `msgstr` وارد کنید. -4. **نشانه‌گذاری‌های Sphinx** مثل `` :class:`int` `` ، `` :func:`repr` `` ، `` :ref:`...` `` ، `` ``code`` `` و **جای‌گذارها** مثل `%s` یا `{name}` را دقیقاً بدون تغییر نگه دارید؛ فقط متن اطراف آن‌ها ترجمه می‌شود. ترجمهٔ `target` در `` :term:`text ` `` ممنوع است چون لینک را خراب می‌کند. +4. **نشانه‌گذاری‌های Sphinx** مثل `` :class:`int` `` ، `` :func:`repr` `` ، `` :ref:`...` `` ، `` ``code`` `` و **جای‌گذارها** مثل `%s` یا `{name}` را دقیقاً بدون تغییر نگه دارید؛ فقط متن اطراف آن‌ها ترجمه می‌شود. در `` :term:`target` ``، اگر عبارت داخل بک‌تیک با شناسهٔ واژه‌نامه یکی است، می‌توانید آن را به شکل `` :term:`ترجمه ` `` بنویسید تا هم متن ترجمه‌شده نمایش داده شود و هم لینک درست کار کند؛ در این حالت فقط بخش نمایشی (پیش از `<`) ترجمه می‌شود و `target` داخل `<>` باید دقیقاً همان شناسهٔ انگلیسی اصلی (بدون تغییر) باقی بماند، چون تغییر آن لینک را خراب می‌کند. 5. داخل کدها (بلوک‌های `code-block`) نام متغیرها، توابع و کلمات کلیدی را ترجمه نکنید؛ فقط رشته‌ها و کامنت‌ها را می‌توانید ترجمه کنید. 6. از [واژه‌نامهٔ پروژه (GLOSSARY.md)](GLOSSARY.md) برای ثابت نگه‌داشتن اصطلاحات استفاده کنید. 7. اگر به اصطلاحی برخوردید که در واژه‌نامه نبود، ترجمه‌ای برای آن انتخاب کنید و به واژه‌نامه اضافه کنید. diff --git a/GLOSSARY.md b/GLOSSARY.md index d41aff9ac..b8d8681b4 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -5,81 +5,99 @@ > این واژه‌نامه با الهام از واژه‌نامه پروژهٔ ترجمه مستندات Vue.js به فارسی تهیه شده و از ساختار و توضیحات دقیق اون استفاده شده. با تشکر از مشارکت‌کنندگان این پروژه برای زحماتشون: > https://github.com/vuejs-translations/docs-fa/blob/main/GLOSSARY.md -| English | فارسی | -| ---------------- | ------------------------ | -| accessibility | دسترسی‌پذیری | -| argument | آرگومان | -| async | ناهمگام، غیرهمگام | -| attribute | ویژگی، صفت، شاخصه | -| boolean | بولی | -| built-in | توکار، درونی، درون‌ساخته | -| callback | کال‌بک، فراخوانی بازگشتی | -| character | نویسه | -| class | کلاس | -| command line | خط فرمان | -| community | کامیونیتی | -| component | کامپوننت | -| custom | سفارشی، اختصاصی | -| decorator | دکوراتور، آراینده | -| debugging | اشکال‌زدایی، دیباگ کردن | -| deprecated | منسوخ، از رده خارج شده | -| dependency | وابستگی | -| dictionary | دیکشنری | -| directory | پوشه | -| DOM | DOM | -| element | المان، عنصر | -| endpoint | پایانه | -| escape | خنثی کردن | -| ecosystem | اکوسیستم | -| event | رویداد | -| exception | استثنا | -| expression | عبارت | -| function | تابع | -| generator | تولیدگر | -| global | سراسری | -| import | ایمپورت | -| immutable | تغییرناپذیر | -| index | اندیس، شماره | -| instance | نمونه | -| integer | عدد صحیح | -| interface | رابط | -| interpreter | مفسر | -| item | آیتم | -| iterable | تکرارپذیر | -| keyword | کلیدواژه | -| keyword argument | آرگومان کلیدواژه‌ای | -| list | فهرست | -| list comprehension | درک فهرستی | -| load | بارگذاری | -| loader | بارگذار | -| local | محلی | -| loop | حلقه | -| method | متد | -| method | روش | -| mock | ماک | -| module | ماژول | -| mutable | تغییرپذیر | -| namespace | نام‌فضا | -| object | شیء | -| operator | عملگر | -| package | بسته | -| parameter | پارامتر | -| positional | جایگاهی | -| property | ویژگی، پراپرتی، خصوصیت | -| quotation | علامت نقل‌وقول | -| raise | پرتاب | -| return | بازگشت، برگرداندن | -| runtime | ران‌تایم | -| scope | محدوده | -| shadowing | پوشاندن | -| stack traceback | ردگیری پشته | -| statement | دستور | -| string | رشته | -| syntax | سینتکس، نحو | -| Tracking | پیگیری | -| type | نوع، نوع داده، تایپ | -| unit test | یونیت تست | -| unpacking | واگشایی | -| value | مقدار | -| variable | متغیر | -| wrapper | پوششی، دربرگیرنده | +| 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 | پوششی، دربرگیرنده | diff --git a/glossary.po b/glossary.po index 1d6e4234a..37da348b1 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-18 04:30+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"PO-Revision-Date: 2026-08-24 16:15+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/revisto/python-docs-fa/fa/)\n" "Language: fa\n" @@ -25,238 +25,243 @@ 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 "Glossary" -msgstr "" +msgstr "واژه‌نامه" msgid "``>>>``" -msgstr "" +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 "" +msgstr "اعلان پیش‌فرض پایتون در پوستهٔ :term:`تعاملی `. اغلب برای نمونه‌های کدی دیده می‌شود که می‌توان آن‌ها را به‌صورت تعاملی در مفسر اجرا کرد." msgid "``...``" -msgstr "" +msgstr "``...``" msgid "Can refer to:" -msgstr "" +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 "" +msgstr "اعلان پیش‌فرض پایتون در پوستهٔ :term:`تعاملی ` هنگام وارد کردن کد برای یک بلوک کد تورفته، زمانی که درون یک جفت جداکنندهٔ چپ و راست متناظر (پرانتزها، کروشه‌ها، آکولادها یا علامت‌های نقل‌قول سه‌گانه) قرار دارید، یا پس از مشخص کردن یک دکوراتور." msgid "The three dots form of the :ref:`Ellipsis ` object." -msgstr "" +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 "" +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 "" +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 "" +msgstr "فراخوانی‌پذیری که می‌توان آن را برای بازیابی :term:`حاشیه‌گذاری ` یک شیء فراخوانی کرد. توابع حاشیه‌گذاری معمولاً :term:`تابع ` هستند که به‌صورت خودکار به‌عنوان ویژگی :attr:`~object.__annotate__` توابع، کلاس‌ها و ماژول‌ها تولید می‌شوند. توابع حاشیه‌گذاری زیرمجموعه‌ای از :term:`تابع ارزیابی ` هستند." msgid "annotation" -msgstr "" +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 "" +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 "" +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 "" +msgstr "همچنین به :term:`حاشیه‌نویسی متغیر `، :term:`حاشیه‌گذاری تابع `، :pep:`484`، :pep:`526` و :pep:`649` مراجعه کنید که این قابلیت را توضیح می‌دهند. همچنین برای بهترین روش‌ها در کار با حاشیه‌گذاری‌ها، :ref:`annotations-howto` را ببینید." msgid "argument" -msgstr "" +msgstr "آرگومان" msgid "A value passed to a :term:`function` (or :term:`method`) when calling the function. There are two kinds of argument:" -msgstr "" +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 "" +msgstr ":dfn:`keyword argument`: آرگومانی که در فراخوانی تابع با یک شناسه (برای مثال ``name=``) پیش از آن قرار گرفته است، یا به‌عنوان مقداری در یک دیکشنری که پیش از آن ``**`` آمده است، ارسال می‌شود. برای مثال، ``3`` و ``5`` هر دو در فراخوانی‌های زیر از :func:`complex` آرگومان کلیدواژه‌ای هستند::" msgid "" "complex(real=3, imag=5)\n" "complex(**{'real': 3, 'imag': 5})" 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 "" +msgstr ":dfn:`positional argument`: آرگومانی که آرگومان کلیدواژه‌ای نیست. آرگومان‌های جایگاهی می‌توانند در ابتدای یک فهرست آرگومان ظاهر شوند و/یا به‌عنوان عناصر یک :term:`تکرارپذیر ` که پیش از آن ``*`` آمده است، ارسال شوند. برای مثال، ``3`` و ``5`` هر دو در فراخوانی‌های زیر آرگومان جایگاهی هستند::" msgid "" "complex(3, 5)\n" "complex(*(3, 5))" 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 "" +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 "" +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 "" +msgstr "شی‌ءای که با تعریف متدهای :meth:`~object.__aenter__` و :meth:`~object.__aexit__`، محیط مشاهده‌شده در یک دستور :keyword:`async with` را کنترل می‌کند. این قابلیت توسط :pep:`492` معرفی شد." msgid "asynchronous generator" -msgstr "" +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." -msgstr "" +msgstr "تابعی که یک :term:`تکرارگر تولیدگر ناهمگام ` بازمی‌گرداند. این تابع شبیه یک تابع هم‌روال که با :keyword:`async def` تعریف شده است به نظر می‌رسد، با این تفاوت که شامل عبارت‌های :keyword:`yield` برای تولید مجموعه‌ای از مقادیر قابل استفاده در یک حلقهٔ :keyword:`async for` است." 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 "" +msgstr "معمولاً به یک تابع تولیدگر ناهمگام اشاره دارد، اما در برخی زمینه‌ها ممکن است به یک *تکرارگر تولیدگر ناهمگام* اشاره کند. در مواردی که معنای مورد نظر واضح نیست، استفاده از اصطلاحات کامل از ابهام جلوگیری می‌کند." msgid "An asynchronous generator function may contain :keyword:`await` expressions as well as :keyword:`async for`, and :keyword:`async with` statements." -msgstr "" +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 "" +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 "" +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 "" +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 "" +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 "" +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 "" +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 "" +msgstr "عملیاتی که به نظر می‌رسد به‌عنوان یک گام واحد و تقسیم‌ناپذیر اجرا می‌شود: هیچ نخٔ دیگری نمی‌تواند اجرای ناقص آن را مشاهده کند و اثرات آن یکباره قابل مشاهده می‌شوند. پایتون تضمین نمی‌کند که دستورهای سطح بالا اتمی باشند (برای مثال، ``x += 1`` چندین عملیات بایت‌کد انجام می‌دهد و اتمی نیست). اتمی بودن فقط در مواردی تضمین می‌شود که به‌صراحت مستند شده باشند. همچنین :term:`شرط رقابت ` و :term:`رقابت داده ` را ببینید." msgid "attached thread state" -msgstr "" +msgstr "وضعیت نخٔ متصل" msgid "A :term:`thread state` that is active for the current OS thread." -msgstr "" +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 "" +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 "" +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 "" +msgstr "در بیشتر ساخت‌های پایتون، داشتن یک وضعیت نخٔ متصل به این معناست که فراخواننده :term:`GIL ` را برای مفسر فعلی در اختیار دارد، بنابراین در یک لحظهٔ مشخص فقط یک نخٔ سیستم‌عامل می‌تواند یک وضعیت نخٔ متصل داشته باشد. در :term:`ساخت نخ‌آزاد ` پایتون، نخ‌ها می‌توانند به‌طور هم‌زمان وضعیت نخٔ متصل داشته باشند، که امکان موازی‌سازی واقعی مفسر بایت‌کد را فراهم می‌کند." msgid "attribute" -msgstr "" +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 "" +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 "" +msgstr "اگر شیء اجازه دهد، می‌توان با استفاده از :func:`setattr`، ویژگی‌ای با نامی که یک شناسه مطابق تعریف :ref:`identifiers` نیست به آن اختصاص داد. چنین ویژگی‌ای با استفاده از یک عبارت نقطه‌ای قابل دسترسی نخواهد بود و باید در عوض با :func:`getattr` بازیابی شود." msgid "awaitable" -msgstr "" +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 "" +msgstr "شیءای که می‌تواند در یک عبارت :keyword:`await` استفاده شود. می‌تواند یک :term:`هم‌روال ` یا شی‌ءای با متد :meth:`~object.__await__` باشد. همچنین :pep:`492` را ببینید." msgid "BDFL" -msgstr "" +msgstr "BDFL" msgid "Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." -msgstr "" +msgstr "Benevolent Dictator For Life، نام دیگر `Guido van Rossum `_، خالق پایتون." msgid "binary file" -msgstr "" +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 "" +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 "" +msgstr "همچنین :term:`فایل متنی ` را برای یک شیء فایل که می‌تواند اشیای :class:`str` را بخواند و بنویسد ببینید." msgid "borrowed reference" -msgstr "" +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 "" +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 "" +msgstr "فراخوانی :c:func:`Py_INCREF` روی :term:`ارجاع قرض‌گرفته‌شده ` توصیه می‌شود تا آن را درجا به یک :term:`ارجاع قوی ` تبدیل کند، مگر زمانی که شیء نمی‌تواند پیش از آخرین استفاده از ارجاع قرض‌گرفته‌شده نابود شود. تابع :c:func:`Py_NewRef` می‌تواند برای ایجاد یک :term:`ارجاع قوی ` جدید استفاده شود." msgid "bytes-like object" -msgstr "" +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 "" +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 "" +msgstr "برخی عملیات‌ها نیاز دارند که داده‌های دودویی تغییرپذیر باشند. مستندات اغلب به این موارد با عنوان «اشیای شبه‌بایت خواندن-نوشتن» اشاره می‌کنند. نمونه‌هایی از اشیای بافر تغییرپذیر شامل :class:`bytearray` و یک :class:`memoryview` از یک :class:`bytearray` هستند. عملیات‌های دیگر نیاز دارند که داده‌های دودویی در اشیای تغییرناپذیر ذخیره شوند («اشیای شبه‌بایت فقط‌خواندنی»)؛ نمونه‌هایی از این موارد شامل :class:`bytes` و یک :class:`memoryview` از یک شیء :class:`bytes` هستند." msgid "bytecode" -msgstr "" +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 "" +msgstr "کد منبع پایتون به بایت‌کد کامپایل می‌شود؛ بایت‌کد نمایش داخلی یک برنامهٔ پایتون در مفسر CPython است. بایت‌کد همچنین در فایل‌های ``.pyc`` ذخیره می‌شود تا اجرای همان فایل در بار دوم سریع‌تر باشد (می‌توان از کامپایل دوباره از منبع به بایت‌کد جلوگیری کرد). گفته می‌شود این «زبان میانی» روی یک :term:`ماشین مجازی ` اجرا می‌شود که کد ماشین متناظر با هر بایت‌کد را اجرا می‌کند. توجه داشته باشید که انتظار نمی‌رود بایت‌کدها بین ماشین‌های مجازی مختلف پایتون کار کنند یا بین نسخه‌های مختلف پایتون پایدار باشند." msgid "A list of bytecode instructions can be found in the documentation for :ref:`the dis module `." -msgstr "" +msgstr "فهرستی از دستورهای بایت‌کد را می‌توان در مستندات :ref:`the dis module ` یافت." msgid "callable" -msgstr "" +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 "" +msgstr "یک فراخوانی‌پذیر شی‌ءای است که می‌توان آن را، احتمالاً با مجموعه‌ای از آرگومان‌ها (به :term:`آرگومان ` مراجعه کنید)، با سینتکس زیر فراخوانی کرد::" msgid "callable(argument1, argument2, argumentN)" -msgstr "" +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 "" +msgstr "یک :term:`تابع ` و به‌تبع آن یک :term:`متد `، یک فراخوانی‌پذیر است. یک نمونه از یک کلاس که متد :meth:`~object.__call__` را پیاده‌سازی می‌کند نیز یک فراخوانی‌پذیر است." msgid "callback" -msgstr "" +msgstr "کال‌بک" msgid "A subroutine function which is passed as an argument to be executed at some point in the future." -msgstr "" +msgstr "یک تابع زیرروال که به‌عنوان آرگومان ارسال می‌شود تا در نقطه‌ای در آینده اجرا شود." msgid "class" -msgstr "" +msgstr "کلاس" msgid "A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class." -msgstr "" +msgstr "الگویی برای ایجاد اشیای تعریف‌شده توسط کاربر. تعریف‌های کلاس معمولاً شامل تعریف‌های متد هستند که روی نمونه‌های کلاس عمل می‌کنند." msgid "class variable" -msgstr "" +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 "" +msgstr "متغیری که در یک کلاس تعریف شده است و قرار است فقط در سطح کلاس تغییر داده شود (یعنی نه در یک نمونه از کلاس)." msgid "closure variable" -msgstr "" +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 "" +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 "" +msgstr "برای مثال، در تابع ``inner`` در کد زیر، هر دو مورد ``x`` و ``print`` :term:`متغیر آزاد ` هستند، اما فقط ``x`` یک *متغیر بستار* است::" msgid "" "def outer():\n" @@ -267,117 +272,124 @@ msgid "" " print(x)\n" " return inner" msgstr "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" 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 "" +msgstr "به‌دلیل ویژگی :attr:`codeobject.co_freevars` (که با وجود نامش، فقط نام‌های متغیرهای بستار را شامل می‌شود و همهٔ متغیرهای آزاد ارجاع‌داده‌شده را فهرست نمی‌کند)، اصطلاح کلی‌تر :term:`متغیر آزاد ` گاهی حتی زمانی استفاده می‌شود که معنای مورد نظر به‌طور مشخص اشاره به متغیرهای بستار دارد." msgid "complex number" -msgstr "" +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 "" +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 "" +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 "" +msgstr "هنگامی که چندین نخ در یک زمان داده‌های اشتراکی را تغییر می‌دهند. تغییر هم‌زمان بدون همگام‌سازی مناسب می‌تواند باعث :term:`شرط رقابت ` شود و همچنین ممکن است یک :term:`رقابت داده `، خرابی داده یا هر دو را ایجاد کند." msgid "context" -msgstr "" +msgstr "زمینه" msgid "This term has different meanings depending on where and how it is used. Some common meanings:" -msgstr "" +msgstr "این اصطلاح بسته به محل و نحوهٔ استفاده، معانی متفاوتی دارد. برخی از معانی رایج:" msgid "The temporary state or environment established by a :term:`context manager` via a :keyword:`with` statement." -msgstr "" +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 "" +msgstr "مجموعهٔ اتصال‌های کلید-مقدار مرتبط با یک شیء :class:`contextvars.Context` خاص و قابل دسترسی از طریق اشیای :class:`~contextvars.ContextVar`. همچنین :term:`متغیر زمینه ` را ببینید." msgid "A :class:`contextvars.Context` object. Also see :term:`current context`." -msgstr "" +msgstr "یک شیء :class:`contextvars.Context`. همچنین :term:`زمینه فعلی ` را ببینید." msgid "context management protocol" -msgstr "" +msgstr "پروتکل مدیریت زمینه" msgid "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by the :keyword:`with` statement. See :pep:`343`." -msgstr "" +msgstr "متدهای :meth:`~object.__enter__` و :meth:`~object.__exit__` که توسط دستور :keyword:`with` فراخوانی می‌شوند. :pep:`343` را ببینید." msgid "context manager" -msgstr "" +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 "" +msgstr "شی‌ءای که :term:`پروتکل مدیریت زمینه ` را پیاده‌سازی می‌کند و محیط مشاهده‌شده در یک دستور :keyword:`with` را کنترل می‌کند. :pep:`343` را ببینید." msgid "context variable" -msgstr "" +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 "" +msgstr "متغیری که مقدار آن به این بستگی دارد که کدام زمینه :term:`زمینه فعلی ` است. مقادیر از طریق اشیای :class:`contextvars.ContextVar` قابل دسترسی هستند. متغیرهای زمینه عمدتاً برای جداسازی وضعیت بین وظایف ناهمگام هم‌زمان استفاده می‌شوند." msgid "contiguous" -msgstr "" +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 "" +msgstr "یک بافر دقیقاً پیوسته در نظر گرفته می‌شود اگر یا *C-contiguous* یا *Fortran contiguous* باشد. بافرهای صفر‌بعدی هم C و هم Fortran پیوسته هستند. در آرایه‌های یک‌بعدی، آیتم‌ها باید در حافظه در کنار یکدیگر و به‌ترتیب اندیس‌های افزایشی که از صفر شروع می‌شوند قرار گرفته باشند. در آرایه‌های چندبعدی C-contiguous، هنگام بازدید از آیتم‌ها به‌ترتیب آدرس حافظه، آخرین اندیس سریع‌ترین تغییر را دارد. با این حال، در آرایه‌های Fortran contiguous، اولین اندیس سریع‌ترین تغییر را دارد." msgid "coroutine" -msgstr "" +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 "" +msgstr "هم‌روال‌ها شکل کلی‌تری از زیرروال‌ها هستند. زیرروال‌ها از یک نقطه وارد و از نقطه‌ای دیگر خارج می‌شوند. هم‌روال‌ها می‌توانند از نقاط مختلفی وارد، خارج و از سر گرفته شوند. آن‌ها می‌توانند با دستور :keyword:`async def` پیاده‌سازی شوند. همچنین :pep:`492` را ببینید." msgid "coroutine function" -msgstr "" +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 "" +msgstr "تابعی که یک شیء :term:`هم‌روال ` بازمی‌گرداند. یک تابع هم‌روال می‌تواند با دستور :keyword:`async def` تعریف شود و می‌تواند شامل کلیدواژه‌های :keyword:`await`، :keyword:`async for` و :keyword:`async with` باشد. این موارد توسط :pep:`492` معرفی شدند." msgid "CPython" -msgstr "" +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 "" +msgstr "پیاده‌سازی مرجع زبان برنامه‌نویسی پایتون، همان‌طور که در `python.org `_ توزیع می‌شود. اصطلاح «CPython» در مواقعی استفاده می‌شود که لازم باشد این پیاده‌سازی از موارد دیگری مانند Jython یا IronPython متمایز شود." msgid "current context" -msgstr "" +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 "" +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 "" +msgstr "زیرگروهی شامل یک یا چند شیء که در یک چرخهٔ ارجاع به یکدیگر ارجاع می‌دهند، اما توسط اشیای خارج از گروه ارجاع داده نمی‌شوند. هدف :term:`زباله‌روبی ` شناسایی این گروه‌ها و شکستن چرخه‌های ارجاع است تا حافظه بتواند بازیابی شود." msgid "data race" -msgstr "" +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 "" +msgstr "وضعیتی که در آن چندین نخ به یک محل حافظهٔ یکسان به‌طور هم‌زمان دسترسی دارند، دست‌کم یکی از دسترسی‌ها نوشتن است و نخ‌ها برای کنترل دسترسی خود از هیچ همگام‌سازی‌ای استفاده نمی‌کنند. رقابت‌های داده به رفتار :term:`غیرقطعی ` منجر می‌شوند و می‌توانند باعث خرابی داده شوند. استفادهٔ درست از :term:`قفل ` و دیگر :term:`اولیه ` از رقابت‌های داده جلوگیری می‌کند. توجه داشته باشید که رقابت‌های داده فقط در کد بومی رخ می‌دهند، اما آن :term:`کد بومی ` ممکن است در یک API پایتون در معرض استفاده قرار گرفته باشد. همچنین :term:`شرط رقابت ` و :term:`ایمن برای نخ‌های اجرایی ` را ببینید." msgid "deadlock" -msgstr "" +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 "" +msgstr "وضعیتی که در آن دو یا چند وظیفه (نخ‌ها، پردازه‌ها یا هم‌روال‌ها) به‌طور نامحدود منتظر می‌مانند تا یکدیگر منابع را آزاد کنند یا اقداماتی را کامل کنند، و در نتیجه هیچ‌کدام نمی‌توانند پیشرفت کنند. برای مثال، اگر نخٔ A قفل ۱ را در اختیار داشته باشد و منتظر قفل ۲ باشد، در حالی که نخٔ B قفل ۲ را در اختیار دارد و منتظر قفل ۱ است، هر دو نخ به‌طور نامحدود منتظر خواهند ماند. در پایتون، این وضعیت اغلب از دریافت چندین قفل با ترتیب‌های ناسازگار یا از وابستگی‌های join/await چرخه‌ای ایجاد می‌شود. می‌توان با همیشه دریافت کردن چندین :term:`قفل ` به یک ترتیب ثابت از بن‌بست‌ها جلوگیری کرد. همچنین :term:`قفل ` و :term:`بازورودپذیر ` را ببینید." msgid "decorator" -msgstr "" +msgstr "دکوراتور" msgid "A function returning another function, usually applied as a function transformation using the ``@wrapper`` syntax. Common examples for decorators are :func:`classmethod` and :func:`staticmethod`." -msgstr "" +msgstr "تابعی که تابع دیگری را بازمی‌گرداند و معمولاً با استفاده از سینتکس ``@wrapper`` به‌عنوان یک تبدیل تابع اعمال می‌شود. نمونه‌های رایج دکوراتورها :func:`classmethod` و :func:`staticmethod` هستند." msgid "The decorator syntax is merely syntactic sugar, the following two function definitions are semantically equivalent::" -msgstr "" +msgstr "سینتکس دکوراتور صرفاً یک قند نحوی (syntactic sugar) است؛ دو تعریف تابع زیر از نظر معنایی معادل هستند::" msgid "" "def f(arg):\n" @@ -388,577 +400,591 @@ msgid "" "def f(arg):\n" " ..." msgstr "" +"def f(arg):\n" +" ...\n" +"f = staticmethod(f)\n" +"\n" +"@staticmethod\n" +"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 "" +msgstr "همین مفهوم برای کلاس‌ها نیز وجود دارد، اما استفاده از آن در آنجا کمتر رایج است. برای اطلاعات بیشتر دربارهٔ دکوراتورها، مستندات :ref:`function definitions ` و :ref:`class definitions ` را ببینید." msgid "descriptor" -msgstr "" +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 "" +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 "" +msgstr "برای اطلاعات بیشتر دربارهٔ متدهای توصیف‌گرها، :ref:`descriptors` یا :ref:`Descriptor How To Guide ` را ببینید." msgid "dictionary" -msgstr "" +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 "" +msgstr "یک آرایهٔ انجمنی که در آن کلیدهای دلخواه به مقادیر نگاشت می‌شوند. کلیدها می‌توانند هر شیءای باشند که متدهای :meth:`~object.__hash__` و :meth:`~object.__eq__` را داشته باشد. در Perl به آن hash گفته می‌شود." msgid "dictionary comprehension" -msgstr "" +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 "" +msgstr "روشی فشرده برای پردازش همه یا بخشی از عناصر یک تکرارپذیر و بازگرداندن یک دیکشنری با نتایج. ``results = {n: n ** 2 for n in range(10)}`` یک دیکشنری ایجاد می‌کند که شامل کلید ``n`` نگاشت‌شده به مقدار ``n ** 2`` است. :ref:`comprehensions` را ببینید." msgid "dictionary view" -msgstr "" +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 "" +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 "" +msgstr "یک مقدار رشته‌ای که به‌عنوان اولین عبارت در یک کلاس، تابع یا ماژول ظاهر می‌شود. اگرچه هنگام اجرای مجموعه نادیده گرفته می‌شود، توسط کامپایلر شناسایی شده و در ویژگی :attr:`~definition.__doc__` کلاس، تابع یا ماژول دربرگیرنده قرار داده می‌شود. از آنجا که از طریق درون‌بینی در دسترس است، مکان استاندارد برای مستندسازی شیء محسوب می‌شود." msgid "duck-typing" -msgstr "" +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 "" +msgstr "سبک برنامه‌نویسی‌ای که برای تعیین داشتن رابط مناسب توسط یک شیء، به نوع آن نگاه نمی‌کند؛ در عوض، متد یا ویژگی به‌سادگی فراخوانی یا استفاده می‌شود («اگر شبیه اردک است و مانند اردک صدا می‌دهد، پس باید اردک باشد.»). با تأکید بر رابط‌ها به‌جای نوع‌های خاص، کد با طراحی خوب با امکان جایگزینی چندریخت، انعطاف‌پذیری خود را افزایش می‌دهد. نوع‌دهی اردکی از آزمون‌های مبتنی بر :func:`type` یا :func:`isinstance` اجتناب می‌کند. (با این حال، توجه داشته باشید که نوع‌دهی اردکی می‌تواند با :term:`کلاس پایهٔ انتزاعی ` تکمیل شود.) در عوض، معمولاً از آزمون‌های :func:`hasattr` یا برنامه‌نویسی :term:`EAFP ` استفاده می‌کند." msgid "dunder" -msgstr "" +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 "" +msgstr "یک شکل کوتاه و غیررسمی برای «دو زیرخط» که هنگام صحبت دربارهٔ یک :term:`متد ویژه ` استفاده می‌شود. برای مثال، ``__init__`` اغلب «داندر اینیت» تلفظ می‌شود." msgid "EAFP" -msgstr "" +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 "" +msgstr "آسان‌تر است که درخواست بخشش کنید تا اجازه. این سبک رایج کدنویسی پایتون وجود کلیدها یا ویژگی‌های معتبر را فرض می‌کند و اگر این فرض نادرست باشد، استثناها را دریافت می‌کند. این سبک پاک و سریع با وجود تعداد زیادی دستورهای :keyword:`try` و :keyword:`except` شناخته می‌شود. این روش در تضاد با سبک :term:`LBYL ` است که در بسیاری از زبان‌های دیگر مانند C رایج است." msgid "evaluate function" -msgstr "" +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 "" +msgstr "تابعی که می‌توان آن را برای ارزیابی یک ویژگی با ارزیابی تنبل یک شیء فراخوانی کرد، مانند مقدار نام‌های مستعار نوع که با دستور :keyword:`type` ایجاد شده‌اند." msgid "expression" -msgstr "" +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 "" +msgstr "بخشی از سینتکس که می‌تواند به یک مقدار ارزیابی شود. به بیان دیگر، یک عبارت مجموعه‌ای از عناصر عبارت مانند لفظ‌ها، نام‌ها، دسترسی به ویژگی، عملگرها یا فراخوانی‌های تابع است که همه مقداری بازمی‌گردانند. برخلاف بسیاری از زبان‌های دیگر، همهٔ ساختارهای زبان عبارت نیستند. همچنین :term:`دستور `\\هایی وجود دارند که نمی‌توان از آن‌ها به‌عنوان عبارت استفاده کرد، مانند :keyword:`while`. تخصیص‌ها نیز دستور هستند، نه عبارت." msgid "extension module" -msgstr "" +msgstr "ماژول افزونه" msgid "A module written in C or C++, using Python's C API to interact with the core and with user code." -msgstr "" +msgstr "ماژول نوشته‌شده به زبان C یا C++ که از API زبان C پایتون برای تعامل با هسته و کد کاربر استفاده می‌کند." msgid "f-string" -msgstr "" +msgstr "اف‌استرینگ" msgid "f-strings" -msgstr "" +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 "" +msgstr "رشته‌های لفظی که با ``f`` یا ``F`` پیشوندگذاری شده‌اند، معمولاً «اف‌استرینگ» نامیده می‌شوند که کوتاه‌شدهٔ :ref:`formatted string literals ` است. همچنین :pep:`498` را ببینید." msgid "file object" -msgstr "" +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 "" +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 "" +msgstr "در واقع سه دسته از اشیای فایل وجود دارد: :term:`فایل دودویی ` خام، :term:`فایل دودویی ` بافرشده و :term:`فایل متنی `. رابط‌های آن‌ها در ماژول :mod:`io` تعریف شده‌اند. روش استاندارد ایجاد یک شیء فایل، استفاده از تابع :func:`open` است." msgid "file-like object" -msgstr "" +msgstr "شیء شبه‌فایل" msgid "A synonym for :term:`file object`." -msgstr "" +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 "" +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 "" +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 "" +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 "" +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 "" +msgstr "همچنین :term:`کدگذاری محلی ` را ببینید." msgid "finder" -msgstr "" +msgstr "یابنده" msgid "An object that tries to find the :term:`loader` for a module that is being imported." -msgstr "" +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 "" +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 "" +msgstr "برای جزئیات بسیار بیشتر، :ref:`finders-and-loaders` و :mod:`importlib` را ببینید." msgid "floor division" -msgstr "" +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 "" +msgstr "تقسیم ریاضی که به نزدیک‌ترین عدد صحیح پایین گرد می‌شود. عملگر تقسیم کف ``//`` است. برای مثال، عبارت ``11 // 4`` به ``2`` ارزیابی می‌شود، در حالی که تقسیم حقیقی با عدد اعشاری مقدار ``2.75`` را بازمی‌گرداند. توجه داشته باشید که ``(-11) // 4`` برابر ``-3`` است، زیرا ``-2.75`` به سمت *پایین* گرد می‌شود. :pep:`238` را ببینید." msgid "free threading" -msgstr "" +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 "" +msgstr "مدل نخ‌ای که در آن چندین نخ می‌توانند بایت‌کد پایتون را به‌طور هم‌زمان درون همان مفسر اجرا کنند. این در تضاد با :term:`قفل مفسر سراسری ` است که اجازه می‌دهد فقط یک نخ در هر زمان بایت‌کد پایتون را اجرا کند. :pep:`703` را ببینید." msgid "free-threaded build" -msgstr "" +msgstr "ساخت نخ‌آزاد" msgid "A build of :term:`CPython` that supports :term:`free threading`, configured using the :option:`--disable-gil` option before compilation." -msgstr "" +msgstr "ساختی از :term:`CPython ` که از :term:`نخ‌گذاری آزاد ` پشتیبانی می‌کند و با استفاده از گزینهٔ :option:`--disable-gil` پیش از کامپایل پیکربندی شده است." msgid "See :ref:`freethreading-python-howto`." -msgstr "" +msgstr ":ref:`freethreading-python-howto` را ببینید." msgid "free variable" -msgstr "" +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 "" +msgstr "به‌صورت رسمی، همان‌طور که در :ref:`language execution model ` تعریف شده است، یک متغیر آزاد هر متغیری است که در یک نام‌فضا استفاده می‌شود اما در آن نام‌فضا یک متغیر محلی نیست. برای نمونه، :term:`متغیر بستار ` را ببینید. از نظر عملی، به‌دلیل نام ویژگی :attr:`codeobject.co_freevars`، این اصطلاح گاهی به‌عنوان مترادفی برای :term:`متغیر بستار ` نیز استفاده می‌شود." msgid "function" -msgstr "" +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 "" +msgstr "مجموعه‌ای از دستورها که مقداری را به یک فراخواننده بازمی‌گرداند. همچنین می‌تواند صفر یا چند :term:`آرگومان ` دریافت کند که ممکن است در اجرای بدنه استفاده شوند. همچنین :term:`پارامتر `، :term:`متد ` و بخش :ref:`function` را ببینید." msgid "function annotation" -msgstr "" +msgstr "حاشیه‌گذاری تابع" msgid "An :term:`annotation` of a function parameter or return value." -msgstr "" +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 "" +msgstr "حاشیه‌گذاری‌های تابع معمولاً برای :term:`راهنمای نوع ` استفاده می‌شوند: برای مثال، انتظار می‌رود این تابع دو آرگومان :class:`int` دریافت کند و همچنین یک مقدار بازگشتی :class:`int` داشته باشد::" msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" msgstr "" +"def sum_two_numbers(a: int, b: int) -> int:\n" +" return a + b" msgid "Function annotation syntax is explained in section :ref:`function`." -msgstr "" +msgstr "نحو حاشیه‌گذاری تابع در بخش :ref:`function` توضیح داده شده است." 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 "" +msgstr "به :term:`حاشیه‌نویسی متغیر ` و :pep:`484` مراجعه کنید که این قابلیت را توضیح می‌دهند. همچنین برای بهترین روش‌ها در کار با حاشیه‌گذاری‌ها، :ref:`annotations-howto` را ببینید." msgid "__future__" -msgstr "" +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 "" +msgstr "یک :ref:`future statement `، یعنی ``from __future__ import ``, به کامپایلر دستور می‌دهد ماژول فعلی را با استفاده از سینتکس یا معناشناسی‌ای کامپایل کند که در یک انتشار آیندهٔ پایتون استاندارد خواهد شد. ماژول :mod:`__future__` مقادیر ممکن *feature* را مستند می‌کند. با ایمپورت این ماژول و ارزیابی متغیرهای آن، می‌توانید ببینید چه زمانی یک ویژگی جدید برای اولین بار به زبان اضافه شده است و چه زمانی به حالت پیش‌فرض تبدیل خواهد شد (یا شده است)::" msgid "" ">>> import __future__\n" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" msgstr "" +">>> import __future__\n" +">>> __future__.division\n" +"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" msgid "garbage collection" -msgstr "" +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 "" +msgstr "فرایند آزادسازی حافظه هنگامی که دیگر استفاده نمی‌شود. پایتون زباله‌روبی را از طریق شمارش ارجاع‌ها و یک زباله‌روب چرخه‌ای که قادر به شناسایی و شکستن چرخه‌های ارجاع است انجام می‌دهد. زباله‌روب را می‌توان با استفاده از ماژول :mod:`gc` کنترل کرد." msgid "generator" -msgstr "" +msgstr "تولیدگر" msgid "A function which returns a :term:`generator iterator`. It looks like a normal function except that it contains :keyword:`yield` expressions for producing a series of values usable in a for-loop or that can be retrieved one at a time with the :func:`next` function." -msgstr "" +msgstr "تابعی که یک :term:`تکرارگر تولیدگر ` بازمی‌گرداند. این تابع شبیه یک تابع معمولی است، با این تفاوت که شامل عبارت‌های :keyword:`yield` برای تولید مجموعه‌ای از مقادیر قابل استفاده در یک حلقهٔ for یا قابل بازیابی یکی‌یکی با تابع :func:`next` است." 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 "" +msgstr "معمولاً به یک تابع تولیدگر اشاره دارد، اما در برخی زمینه‌ها ممکن است به یک *تکرارگر تولیدگر* اشاره کند. در مواردی که معنای مورد نظر واضح نیست، استفاده از اصطلاحات کامل از ابهام جلوگیری می‌کند." msgid "generator iterator" -msgstr "" +msgstr "تکرارگر تولیدگر" msgid "An object created by a :term:`generator` function." -msgstr "" +msgstr "شیءای که توسط یک تابع :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 "" +msgstr "هر :keyword:`yield` پردازش را به‌طور موقت متوقف می‌کند و وضعیت اجرا (شامل متغیرهای محلی و دستورهای try در انتظار) را به خاطر می‌سپارد. هنگامی که *تکرارگر تولیدگر* ادامهٔ اجرا می‌دهد، از همان نقطه‌ای که متوقف شده بود ادامه می‌دهد (برخلاف توابع که در هر فراخوانی از ابتدا شروع می‌شوند)." msgid "generator expression" -msgstr "" +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 "" +msgstr "یک :term:`عبارت ` که یک :term:`تکرارگر ` بازمی‌گرداند. این عبارت شبیه یک عبارت معمولی است که پس از آن یک بند :keyword:`!for` برای تعریف متغیر حلقه، محدوده و یک بند اختیاری :keyword:`!if` قرار گرفته است. عبارت ترکیبی، مقادیری را برای یک تابع دربرگیرنده تولید می‌کند::" msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" msgstr "" +">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" +"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 "" +msgstr "تابعی که از چندین تابع تشکیل شده است که یک عملیات یکسان را برای نوع‌های مختلف پیاده‌سازی می‌کنند. این‌که هنگام یک فراخوانی کدام پیاده‌سازی استفاده شود، توسط الگوریتم ارسال تعیین می‌شود." msgid "See also the :term:`single dispatch` glossary entry, the :func:`functools.singledispatch` decorator, and :pep:`443`." -msgstr "" +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 "" +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 "" +msgstr "برای جزئیات بیشتر، :ref:`generic alias types`، :pep:`483`، :pep:`484`، :pep:`585` و ماژول :mod:`typing` را ببینید." msgid "GIL" -msgstr "" +msgstr "GIL" msgid "See :term:`global interpreter lock`." -msgstr "" +msgstr ":term:`قفل مفسر سراسری ` را ببینید." msgid "global interpreter lock" -msgstr "" +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 "" +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 "" +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 "" +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 "" +msgstr "در نسخه‌های پیشین API زبان C پایتون، یک تابع ممکن بود اعلام کند که برای استفاده از آن، لازم است GIL در اختیار گرفته شده باشد. این موضوع به داشتن یک :term:`وضعیت نخٔ متصل ` اشاره دارد." msgid "global state" -msgstr "" +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 "" +msgstr "داده‌ای که در سراسر یک برنامه قابل دسترسی است، مانند متغیرهای سطح ماژول، متغیرهای کلاس یا متغیرهای ایستای C در :term:`ماژول افزونه `. در برنامه‌های چندنخی، وضعیت سراسری اشتراک‌گذاری‌شده بین نخ‌ها معمولاً برای جلوگیری از :term:`شرط رقابت ` و :term:`رقابت داده ` به همگام‌سازی نیاز دارد." msgid "hash-based pyc" -msgstr "" +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 "" +msgstr "یک فایل نهانگاه بایت‌کد که به‌جای زمان آخرین تغییر فایل منبع متناظر، از هش آن برای تعیین اعتبار خود استفاده می‌کند. :ref:`pyc-invalidation` را ببینید." msgid "hashable" -msgstr "" +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 "" +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 "" +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 "" +msgstr "بیشتر اشیای توکار تغییرناپذیر پایتون قابل درهم‌سازی هستند؛ محفظه‌های تغییرپذیر (مانند فهرست‌ها یا دیکشنری‌ها) قابل درهم‌سازی نیستند؛ محفظه‌های تغییرناپذیر (مانند تاپل‌ها یا frozensetها) فقط در صورتی قابل درهم‌سازی هستند که عناصرشان قابل درهم‌سازی باشند. اشیایی که نمونه‌هایی از کلاس‌های تعریف‌شده توسط کاربر هستند، به‌طور پیش‌فرض قابل درهم‌سازی هستند. همهٔ آن‌ها نابرابر مقایسه می‌شوند (به‌جز با خودشان) و مقدار هش آن‌ها از :func:`id` آن‌ها مشتق می‌شود." msgid "IDLE" -msgstr "" +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 "" +msgstr "یک محیط توسعه و یادگیری یکپارچه برای پایتون. :ref:`idle` یک محیط ویرایشگر و مفسر پایه است که همراه با توزیع استاندارد پایتون ارائه می‌شود." msgid "immortal" -msgstr "" +msgstr "نامیرا" msgid "*Immortal objects* are a CPython implementation detail introduced in :pep:`683`." -msgstr "" +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 "" +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 "" +msgstr "اشیای نامیرا را می‌توان از طریق :func:`sys._is_immortal` یا از طریق :c:func:`PyUnstable_IsImmortal` در API زبان C شناسایی کرد." msgid "immutable" -msgstr "" +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 "" +msgstr "شیءای با مقدار ثابت. اشیای تغییرناپذیر شامل اعداد، نخ‌ها و تاپل‌ها هستند. چنین شی‌ءای نمی‌تواند تغییر داده شود. اگر لازم باشد مقدار متفاوتی ذخیره شود، باید شیء جدیدی ایجاد شود. آن‌ها در جاهایی که مقدار هش ثابت لازم است، برای مثال به‌عنوان یک کلید در یک دیکشنری، نقش مهمی دارند. اشیای تغییرناپذیر ذاتاً :term:`ایمن برای نخ‌های اجرایی ` هستند، زیرا وضعیت آن‌ها پس از ایجاد قابل تغییر نیست و نگرانی‌ها دربارهٔ :term:`تغییر هم‌زمان ` که به‌درستی همگام‌سازی نشده است، از بین می‌رود." msgid "import path" -msgstr "" +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 "" +msgstr "فهرستی از مکان‌ها (یا :term:`ورودی مسیر `) که توسط :term:`یابندهٔ مبتنی بر مسیر ` برای ماژول‌های قابل ایمپورت جست‌وجو می‌شود. هنگام ایمپورت، این فهرست از مکان‌ها معمولاً از :data:`sys.path` می‌آید، اما برای زیر‌بسته‌ها ممکن است از ویژگی ``__path__`` بستهٔ والد نیز به‌دست آید." msgid "importing" -msgstr "" +msgstr "ایمپورت کردن" msgid "The process by which Python code in one module is made available to Python code in another module." -msgstr "" +msgstr "فرایندی که طی آن کد پایتون در یک ماژول برای کد پایتون در ماژولی دیگر در دسترس قرار می‌گیرد." msgid "importer" -msgstr "" +msgstr "ایمپورت‌کننده" msgid "An object that both finds and loads a module; both a :term:`finder` and :term:`loader` object." -msgstr "" +msgstr "شی‌ءای که هم یک ماژول را پیدا می‌کند و هم آن را بارگذاری می‌کند؛ هم یک شیء :term:`یابنده ` و هم یک شیء :term:`بارگذار `." msgid "index" -msgstr "" +msgstr "اندیس" msgid "A numeric value that represents the position of an element in a :term:`sequence`." -msgstr "" +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 "" +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 "" +msgstr "در برخی زمینه‌ها، پایتون اجازه می‌دهد از اندیس‌های منفی برای شمارش از انتهای یک دنباله و از اندیس‌گذاری با استفاده از :term:`برش ` استفاده شود." msgid "See also :term:`subscript`." -msgstr "" +msgstr "همچنین :term:`زیرنویس ` را ببینید." msgid "interactive" -msgstr "" +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 "" +msgstr "پایتون یک مفسر تعاملی دارد، یعنی می‌توانید دستورها و عبارت‌ها را در اعلان مفسر وارد کنید، آن‌ها را بلافاصله اجرا کنید و نتایجشان را ببینید. فقط ``python`` را بدون آرگومان اجرا کنید (احتمالاً با انتخاب آن از منوی اصلی رایانهٔ خود). این روش بسیار قدرتمندی برای آزمایش ایده‌های جدید یا بررسی ماژول‌ها و بسته‌ها است (``help(x)`` را به خاطر داشته باشید). برای اطلاعات بیشتر دربارهٔ حالت تعاملی، :ref:`tut-interac` را ببینید." msgid "interpreted" -msgstr "" +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 "" +msgstr "پایتون زبانی تفسیری است، در مقابل زبان‌های کامپایل‌شده، هرچند به‌دلیل وجود کامپایلر بایت‌کد، این تمایز می‌تواند مبهم باشد. این یعنی فایل‌های منبع را می‌توان بدون ایجاد صریح یک فایل اجرایی که سپس اجرا شود، مستقیماً اجرا کرد. زبان‌های تفسیری معمولاً چرخهٔ توسعه/اشکال‌زدایی کوتاه‌تری نسبت به زبان‌های کامپایل‌شده دارند، هرچند برنامه‌های آن‌ها معمولاً کندتر اجرا می‌شوند. همچنین :term:`تعاملی ` را ببینید." msgid "interpreter shutdown" -msgstr "" +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 "" +msgstr "هنگامی که از مفسر پایتون خواسته می‌شود خاموش شود، وارد مرحلهٔ ویژه‌ای می‌شود که در آن به‌تدریج همهٔ منابع تخصیص‌یافته، مانند ماژول‌ها و ساختارهای داخلی مهم مختلف، آزاد می‌شوند. همچنین چندین فراخوانی به :term:`زباله‌روبی ` انجام می‌دهد. این کار می‌تواند اجرای کد در نابودگرهای تعریف‌شده توسط کاربر یا کال‌بک‌های weakref را فعال کند. کدی که در مرحلهٔ خاموشی اجرا می‌شود ممکن است با استثناهای مختلفی روبه‌رو شود، زیرا منابعی که به آن‌ها وابسته است ممکن است دیگر کار نکنند (نمونه‌های رایج شامل ماژول‌های کتابخانه یا سازوکار هشدارها هستند)." msgid "The main reason for interpreter shutdown is that the ``__main__`` module or the script being run has finished executing." -msgstr "" +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 "" +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 "" +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 "" +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 "" +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 "" +msgstr "CPython به‌طور سازگار الزام تعریف متد :meth:`~iterator.__iter__` برای یک تکرارگر را اعمال نمی‌کند. همچنین توجه داشته باشید که CPython :term:`نخ‌گذاری آزاد ` رفتار :term:`ایمن برای نخ‌های اجرایی ` را برای عملیات تکرارگرها تضمین نمی‌کند." msgid "key" -msgstr "" +msgstr "کلید" msgid "A value that identifies an entry in a :term:`mapping`. See also :term:`subscript`." -msgstr "" +msgstr "مقداری که یک ورودی را در یک :term:`نگاشت ` شناسایی می‌کند. همچنین :term:`زیرنویس ` را ببینید." msgid "key function" -msgstr "" +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 "" +msgstr "یک تابع کلید یا تابع هم‌ترازی، یک شیء قابل فراخوانی است که مقداری را بازمی‌گرداند که برای مرتب‌سازی یا ترتیب‌دهی استفاده می‌شود. برای مثال، :func:`locale.strxfrm` برای تولید یک کلید مرتب‌سازی که از قراردادهای مرتب‌سازی خاص یک محلی آگاه است استفاده می‌شود." 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 "" +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 "" +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 "" +msgstr "آرگومان کلیدواژه‌ای" msgid "See :term:`argument`." -msgstr "" +msgstr ":term:`آرگومان ` را ببینید." msgid "lambda" -msgstr "" +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 "" +msgstr "یک تابع درون‌خطی بی‌نام که از یک :term:`عبارت ` واحد تشکیل شده است و هنگام فراخوانی تابع ارزیابی می‌شود. سینتکس ایجاد یک تابع lambda به‌صورت ``lambda [parameters]: expression`` است" msgid "LBYL" -msgstr "" +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 "" +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 "" +msgstr "در یک محیط چندنخی، رویکرد LBYL می‌تواند خطر ایجاد یک :term:`شرط رقابت ` بین «نگاه کردن» و «جهش کردن» را به همراه داشته باشد. برای مثال، کد ``if key in mapping: return mapping[key]`` ممکن است شکست بخورد اگر نخ‌ای دیگر پس از آزمون، اما پیش از جست‌وجو، *key* را از *mapping* حذف کند. این مشکل را می‌توان با :term:`قفل ` یا با استفاده از رویکرد :term:`EAFP ` حل کرد. همچنین :term:`ایمن برای نخ‌های اجرایی ` را ببینید." msgid "lexical analyzer" -msgstr "" +msgstr "تحلیلگر واژگانی" msgid "Formal name for the *tokenizer*; see :term:`token`." -msgstr "" +msgstr "نام رسمی برای *tokenizer*؛ :term:`توکن ` را ببینید." msgid "list" -msgstr "" +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 "" +msgstr "یک :term:`دنباله ` توکار پایتون. با وجود نام آن، این نوع بیشتر شبیه یک آرایه در زبان‌های دیگر است تا یک فهرست پیوندی، زیرا دسترسی به المان‌ها *O*\\ (1) است." msgid "list comprehension" -msgstr "" +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 "" +msgstr "روشی فشرده برای پردازش همه یا بخشی از المان‌های یک دنباله و بازگرداندن یک فهرست با نتایج. ``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` فهرستی از نخ‌ها شامل اعداد مبنای شانزده زوج (0x..) در محدودهٔ ۰ تا ۲۵۵ تولید می‌کند. بند :keyword:`if` اختیاری است. اگر حذف شود، همهٔ المان‌های ``range(256)`` پردازش می‌شوند." msgid "lock" -msgstr "" +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 "" +msgstr "یک :term:`اولیه ` که در هر زمان فقط به یک نخ اجازهٔ دسترسی به یک منبع اشتراکی را می‌دهد. یک نخ باید پیش از دسترسی به منبع محافظت‌شده، یک قفل را به‌دست آورد و پس از آن آن را آزاد کند. اگر یک نخ تلاش کند قفلی را به‌دست آورد که پیش‌تر توسط نخ‌ای دیگر در اختیار گرفته شده است، تا زمانی که قفل در دسترس قرار گیرد مسدود می‌شود. ماژول :mod:`threading` پایتون، :class:`~threading.Lock` (یک قفل پایه) و :class:`~threading.RLock` (یک قفل :term:`بازورودپذیر `) را فراهم می‌کند. قفل‌ها برای جلوگیری از :term:`شرط رقابت ` و تضمین دسترسی :term:`ایمن برای نخ‌های اجرایی ` به داده‌های اشتراکی استفاده می‌شوند. الگوهای طراحی جایگزین برای قفل‌ها وجود دارند، مانند صف‌ها، الگوهای تولیدکننده/مصرف‌کننده و وضعیت محلی نخ. همچنین :term:`بن‌بست ` و :term:`بازورودپذیر ` را ببینید." msgid "lock-free" -msgstr "" +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 "" +msgstr "عملیاتی که هیچ :term:`قفل `\\ ای به‌دست نمی‌آورد و برای تضمین درستی از دستورهای اتمی CPU استفاده می‌کند. عملیات‌های بدون قفل می‌توانند به‌طور هم‌زمان و بدون مسدود کردن یکدیگر اجرا شوند و نمی‌توانند توسط عملیات‌هایی که قفل‌ها را در اختیار دارند مسدود شوند. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` عملیات‌های خواندن بدون قفل ارائه می‌کنند، یعنی نخ‌های دیگر ممکن است در طول تغییرات چندمرحله‌ای، حتی زمانی که آن تغییرات :term:`قفلِ هر شیء ` را نگه داشته‌اند، وضعیت‌های میانی را مشاهده کنند." msgid "loader" -msgstr "" +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 "" +msgstr "شیءای که یک ماژول را بارگذاری می‌کند. برای پیاده‌سازی رابط :class:`~importlib.abc.Loader` باید متدهای :meth:`!exec_module` و :meth:`!create_module` را تعریف کند. یک بارگذار معمولاً توسط یک :term:`یابنده ` بازگردانده می‌شود. همچنین ببینید:" msgid ":ref:`finders-and-loaders`" -msgstr "" +msgstr ":ref:`finders-and-loaders`" msgid ":class:`importlib.abc.Loader`" -msgstr "" +msgstr ":class:`importlib.abc.Loader`" msgid ":pep:`302`" -msgstr "" +msgstr ":pep:`302`" msgid "locale encoding" -msgstr "" +msgstr "کدگذاری محلی" 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 "" +msgstr "در یونیکس، این همان کدگذاری محلی LC_CTYPE است. می‌توان آن را با :func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` تنظیم کرد." msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." -msgstr "" +msgstr "در ویندوز، این همان صفحهٔ کد ANSI است (برای مثال ``\"cp1252\"``)." msgid "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." -msgstr "" +msgstr "در Android و VxWorks، پایتون از ``\"utf-8\"`` به‌عنوان کدگذاری محلی استفاده می‌کند." msgid ":func:`locale.getencoding` can be used to get the locale encoding." -msgstr "" +msgstr "از :func:`locale.getencoding` می‌توان برای دریافت کدگذاری محلی استفاده کرد." msgid "See also the :term:`filesystem encoding and error handler`." -msgstr "" +msgstr "همچنین :term:`کدگذاری سیستم فایل و مدیریت‌کنندهٔ خطا ` را ببینید." msgid "magic method" -msgstr "" +msgstr "متد جادویی" msgid "An informal synonym for :term:`special method`." -msgstr "" +msgstr "یک مترادف غیررسمی برای :term:`متد ویژه `." msgid "mapping" -msgstr "" +msgstr "نگاشت" 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 "" +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 "" +msgstr "یک :term:`یابنده ` که از جست‌وجوی :data:`sys.meta_path` بازگردانده می‌شود. یابنده‌های مسیر فراداده با :term:`یابندهٔ ورودی مسیر ` مرتبط هستند، اما با آن‌ها تفاوت دارند." msgid "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path finders implement." -msgstr "" +msgstr "برای متدهایی که یابنده‌های مسیر فراداده پیاده‌سازی می‌کنند، :class:`importlib.abc.MetaPathFinder` را ببینید." msgid "metaclass" -msgstr "" +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 "" +msgstr "کلاس یک کلاس. تعریف‌های کلاس یک نام کلاس، یک دیکشنری کلاس و یک فهرست از کلاس‌های پایه ایجاد می‌کنند. فراکلاس مسئول دریافت این سه آرگومان و ایجاد کلاس است. بیشتر زبان‌های برنامه‌نویسی شیءگرا یک پیاده‌سازی پیش‌فرض ارائه می‌کنند. چیزی که پایتون را ویژه می‌کند این است که امکان ایجاد فراکلاس‌های سفارشی وجود دارد. بیشتر کاربران هرگز به این ابزار نیاز پیدا نمی‌کنند، اما هنگامی که نیاز به آن پیش بیاید، فراکلاس‌ها می‌توانند راه‌حل‌های قدرتمند و ظریفی ارائه دهند. از آن‌ها برای ثبت دسترسی به ویژگی‌ها، افزودن ایمنی نخ‌ای، پیگیری ایجاد شیء، پیاده‌سازی تک‌نمونه‌ها و بسیاری کارهای دیگر استفاده شده است." msgid "More information can be found in :ref:`metaclasses`." -msgstr "" +msgstr "اطلاعات بیشتر را می‌توان در :ref:`metaclasses` یافت." msgid "method" -msgstr "" +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 "" +msgstr "تابعی که درون بدنهٔ یک کلاس تعریف شده است. اگر به‌عنوان یک ویژگی از یک نمونهٔ آن کلاس فراخوانی شود، متد شیء نمونه را به‌عنوان نخستین :term:`آرگومان ` خود دریافت می‌کند (که معمولاً ``self`` نامیده می‌شود). :term:`تابع ` و :term:`محدودهٔ تو‌در‌تو ` را ببینید." msgid "method resolution order" -msgstr "" +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 "" +msgstr "ترتیب حل متد، ترتیبی است که در آن کلاس‌های پایه هنگام جست‌وجوی یک عضو بررسی می‌شوند. برای جزئیات الگوریتمی که مفسر پایتون از انتشار ۲.۳ به بعد استفاده می‌کند، :ref:`python_2.3_mro` را ببینید." msgid "module" -msgstr "" +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 "" +msgstr "شیءای که به‌عنوان واحد سازمان‌دهی کد پایتون عمل می‌کند. ماژول‌ها یک نام‌فضا دارند که شامل اشیای دلخواه پایتون است. ماژول‌ها از طریق فرایند :term:`ایمپورت کردن ` در پایتون بارگذاری می‌شوند." msgid "See also :term:`package`." -msgstr "" +msgstr "همچنین :term:`بسته ` را ببینید." msgid "module spec" -msgstr "" +msgstr "مشخصات ماژول" msgid "A namespace containing the import-related information used to load a module. An instance of :class:`importlib.machinery.ModuleSpec`." -msgstr "" +msgstr "نام‌فضایی که شامل اطلاعات مرتبط با ایمپورت است و برای بارگذاری یک ماژول استفاده می‌شود. یک نمونه از :class:`importlib.machinery.ModuleSpec`." msgid "See also :ref:`module-specs`." -msgstr "" +msgstr "همچنین :ref:`module-specs` را ببینید." msgid "MRO" -msgstr "" +msgstr "MRO" msgid "See :term:`method resolution order`." -msgstr "" +msgstr ":term:`ترتیب حل متد ` را ببینید." msgid "mutable" -msgstr "" +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 "" +msgstr "یک :term:`شیء ` که وضعیت آن در طول اجرای برنامه اجازهٔ تغییر دارد. در برنامه‌های چندنخی، اشیای تغییرپذیری که بین نخ‌ها اشتراک‌گذاری می‌شوند، برای جلوگیری از :term:`شرط رقابت ` به همگام‌سازی دقیق نیاز دارند. همچنین :term:`تغییرناپذیر `، :term:`ایمن برای نخ‌های اجرایی ` و :term:`تغییر هم‌زمان ` را ببینید." msgid "named tuple" -msgstr "" +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 "" +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 "" +msgstr "چندین نوع توکار، تاپل نام‌دار هستند، از جمله مقادیری که توسط :func:`time.localtime` و :func:`os.stat` بازگردانده می‌شوند. نمونهٔ دیگر :data:`sys.float_info` است::" msgid "" ">>> sys.float_info[1] # indexed access\n" @@ -968,238 +994,248 @@ msgid "" ">>> isinstance(sys.float_info, tuple) # kind of tuple\n" "True" msgstr "" +">>> sys.float_info[1] # دسترسی با اندیس\n" +"1024\n" +">>> sys.float_info.max_exp # دسترسی به فیلد نام‌گذاری‌شده\n" +"1024\n" +">>> 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 "" +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 "" +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 "" +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 "" +msgstr "بسته‌های نام‌فضا به چندین بستهٔ قابل نصب مستقل اجازه می‌دهند که یک بستهٔ والد مشترک داشته باشند. در غیر این صورت، توصیه می‌شود از یک :term:`بستهٔ معمولی ` استفاده کنید." msgid "For more information, see :pep:`420` and :ref:`reference-namespace-package`." -msgstr "" +msgstr "برای اطلاعات بیشتر، :pep:`420` و :ref:`reference-namespace-package` را ببینید." msgid "See also :term:`module`." -msgstr "" +msgstr "همچنین :term:`ماژول ` را ببینید." msgid "native code" -msgstr "" +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 "" +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 "" +msgstr "توانایی ارجاع به یک متغیر در یک تعریف دربرگیرنده. برای مثال، تابعی که داخل تابع دیگری تعریف شده است می‌تواند به متغیرهای تابع بیرونی دسترسی داشته باشد. توجه کنید که محدوده‌های تو‌در‌تو به‌صورت پیش‌فرض فقط برای ارجاع دادن و نه برای انتساب کار می‌کنند. متغیرهای محلی هم در نزدیک‌ترین محدوده خوانده و نوشته می‌شوند. به همین ترتیب، متغیرهای سراسری از نام‌فضای سراسری خوانده و در آن نوشته می‌شوند. کلیدواژهٔ :keyword:`nonlocal` امکان نوشتن در محدوده‌های بیرونی را فراهم می‌کند." msgid "new-style class" -msgstr "" +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 "" +msgstr "نام قدیمی برای گونه‌ای از کلاس‌ها که اکنون برای همهٔ اشیای کلاس استفاده می‌شود. در نسخه‌های قدیمی‌تر پایتون، فقط کلاس‌های سبک جدید می‌توانستند از قابلیت‌های جدیدتر و انعطاف‌پذیر پایتون مانند :attr:`~object.__slots__`، توصیف‌گرها، ویژگی‌ها، :meth:`~object.__getattribute__`، متدهای کلاس و متدهای ایستا استفاده کنند." msgid "non-deterministic" -msgstr "" +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 "" +msgstr "رفتاری که در آن نتیجهٔ یک برنامه می‌تواند بین اجراهای مختلف با ورودی‌های یکسان متفاوت باشد. در برنامه‌های چندنخی، رفتار غیرقطعی اغلب از :term:`شرط رقابت ` ناشی می‌شود که در آن زمان‌بندی نسبی یا درهم‌تنیدگی نخ‌ها بر نتیجه تأثیر می‌گذارد. همگام‌سازی مناسب با استفاده از :term:`قفل ` و دیگر :term:`اولیه ` به تضمین رفتار قطعی کمک می‌کند." msgid "object" -msgstr "" +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 "" +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 "" +msgstr "محدوده‌ای که در آن نام‌های متغیرهای محلی هدف هنگام کامپایل کد به‌طور قابل اطمینانی برای کامپایلر شناخته شده‌اند و امکان بهینه‌سازی دسترسی خواندن و نوشتن به این نام‌ها فراهم می‌شود. نام‌فضاهای محلی برای تابع‌ها، تولیدگرها، هم‌روال‌ها، درک‌ها و عبارت‌های تولیدگر به این روش بهینه می‌شوند. توجه کنید: بیشتر بهینه‌سازی‌های مفسر روی همهٔ محدوده‌ها اعمال می‌شوند؛ تنها بهینه‌سازی‌هایی که به مجموعهٔ شناخته‌شده‌ای از نام‌های متغیرهای محلی و غیرمحلی وابسته هستند، به محدوده‌های بهینه‌شده محدود می‌شوند." msgid "optional module" -msgstr "" +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 "" +msgstr "یک :term:`ماژول افزونه ` که بخشی از :term:`کتابخانهٔ استاندارد ` است، اما ممکن است در برخی ساخت‌های :term:`CPython ` وجود نداشته باشد؛ معمولاً به دلیل نبود کتابخانه‌های شخص ثالث یا در دسترس نبودن ماژول برای یک سکوی مشخص." msgid "See :ref:`optional-module-requirements` for a list of optional modules that require third-party libraries." -msgstr "" +msgstr "برای فهرستی از ماژول‌های اختیاری که به کتابخانه‌های شخص ثالث نیاز دارند، :ref:`optional-module-requirements` را ببینید." msgid "package" -msgstr "" +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 "" +msgstr "یک :term:`ماژول ` پایتون که می‌تواند شامل زیرماژول‌ها یا به‌صورت بازگشتی، زیربسته‌ها باشد. از نظر فنی، یک بسته یک ماژول پایتون با ویژگی ``__path__`` است." msgid "See also :term:`regular package` and :term:`namespace package`." -msgstr "" +msgstr "همچنین :term:`بستهٔ معمولی ` و :term:`بستهٔ نام‌فضا ` را ببینید." msgid "parallelism" -msgstr "" +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 "" +msgstr "اجرای چندین عملیات در یک زمان (برای مثال روی چند هستهٔ CPU). در ساخت‌های پایتون با :term:`قفل مفسر سراسری `، تنها یک نخ در هر لحظه بایت‌کد پایتون را اجرا می‌کند، بنابراین بهره‌گیری از چند هستهٔ CPU معمولاً شامل چند فرایند (برای مثال :mod:`multiprocessing`) یا افزونه‌های بومی است که GIL را آزاد می‌کنند. در پایتون :term:`نخ‌گذاری آزاد `، چندین نخٔ پایتون می‌توانند به‌طور هم‌زمان کد پایتون را روی هسته‌های مختلف اجرا کنند." msgid "parameter" -msgstr "" +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 "" +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 "" +msgstr ":dfn:`positional-or-keyword`: آرگومانی را مشخص می‌کند که می‌تواند به‌صورت :term:`آرگومان ` یا به‌عنوان یک :term:`آرگومان ` ارسال شود. این نوع پیش‌فرض پارامتر است، برای مثال *foo* و *bar* در موارد زیر::" msgid "def func(foo, bar=None): ..." -msgstr "" +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 "" +msgstr ":dfn:`positional-only`: آرگومانی را مشخص می‌کند که فقط می‌تواند بر اساس جایگاه ارائه شود. پارامترهای فقط-جایگاهی را می‌توان با قرار دادن یک نویسهٔ ``/`` در فهرست پارامترهای تعریف تابع پس از آن‌ها تعریف کرد، برای مثال *posonly1* و *posonly2* در موارد زیر::" msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." -msgstr "" +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 "" +msgstr ":dfn:`keyword-only`: آرگومانی را مشخص می‌کند که فقط می‌تواند با کلیدواژه ارسال شود. پارامترهای فقط کلیدواژه‌ای را می‌توان با قرار دادن یک پارامتر var-positional یا ``*`` بدون نام در فهرست پارامترهای تعریف تابع پیش از آن‌ها تعریف کرد، برای مثال *kw_only1* و *kw_only2* در موارد زیر::" msgid "def func(arg, *, kw_only1, kw_only2): ..." -msgstr "" +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 "" +msgstr ":dfn:`var-positional`: مشخص می‌کند که یک دنبالهٔ دلخواه از آرگومان‌های جایگاهی می‌تواند ارائه شود (علاوه بر هر آرگومان جایگاهی که پیش‌تر توسط پارامترهای دیگر پذیرفته شده است). چنین پارامتری را می‌توان با افزودن ``*`` به ابتدای نام پارامتر تعریف کرد، برای مثال *args* در موارد زیر::" msgid "def func(*args, **kwargs): ..." -msgstr "" +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 "" +msgstr ":dfn:`var-keyword`: مشخص می‌کند که تعداد دلخواهی از آرگومان‌های کلیدواژه‌ای می‌تواند ارائه شود (علاوه بر هر آرگومان کلیدواژه‌ای که پیش‌تر توسط پارامترهای دیگر پذیرفته شده است). چنین پارامتری را می‌توان با افزودن ``**`` به ابتدای نام پارامتر تعریف کرد، برای مثال *kwargs* در مثال بالا." msgid "Parameters can specify both optional and required arguments, as well as default values for some optional arguments." -msgstr "" +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 "" +msgstr "همچنین مدخل واژه‌نامهٔ :term:`آرگومان `، پرسش متداول دربارهٔ :ref:`تفاوت بین آرگومان‌ها و پارامترها `، کلاس :class:`inspect.Parameter`، بخش :ref:`function` و :pep:`362` را ببینید." msgid "per-object lock" -msgstr "" +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 "" +msgstr "یک :term:`قفل ` مرتبط با یک نمونهٔ شیء منفرد، به‌جای یک قفل سراسری که بین همهٔ اشیا اشتراک‌گذاری شده باشد. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` از قفل‌های هر شیء استفاده می‌کنند تا امکان عملیات هم‌زمان روی اشیای مختلف را فراهم کنند، در حالی که عملیات روی همان شیء را به‌صورت ترتیبی اجرا می‌کنند. عملیات‌هایی که قفل هر شیء را نگه می‌دارند، از ادامهٔ دیگر عملیات‌های قفل‌کننده روی همان شیء جلوگیری می‌کنند، اما عملیات‌های :term:`بدون قفل ` را مسدود نمی‌کنند." msgid "path entry" -msgstr "" +msgstr "ورودی مسیر" msgid "A single location on the :term:`import path` which the :term:`path based finder` consults to find modules for importing." -msgstr "" +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 "" +msgstr "یک :term:`یابنده ` که توسط یک فراخوانی‌پذیر در :data:`sys.path_hooks` (یعنی یک :term:`قلاب ورودی مسیر `) بازگردانده می‌شود و می‌داند چگونه با داشتن یک :term:`ورودی مسیر `، ماژول‌ها را پیدا کند." msgid "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry finders implement." -msgstr "" +msgstr "برای متدهایی که یابنده‌های ورودی مسیر پیاده‌سازی می‌کنند، :class:`importlib.abc.PathEntryFinder` را ببینید." msgid "path entry hook" -msgstr "" +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 "" +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 "" +msgstr "یکی از :term:`یابندهٔ مسیر فراداده ` پیش‌فرض که یک :term:`ایمپورت مسیر ` را برای یافتن ماژول‌ها جست‌وجو می‌کند." msgid "path-like object" -msgstr "" +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 "" +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 "" +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 "" +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 "" +msgstr "PEP ها برای این طراحی شده‌اند که سازوکارهای اصلی پیشنهاد ویژگی‌های بزرگ جدید، جمع‌آوری نظرهای کامیونیتی دربارهٔ یک موضوع و مستندسازی تصمیم‌های طراحی گرفته‌شده برای پایتون باشند. نویسندهٔ PEP مسئول ایجاد توافق در کامیونیتی و مستندسازی دیدگاه‌های مخالف است." msgid "See :pep:`1`." -msgstr "" +msgstr ":pep:`1` را ببینید." msgid "portion" -msgstr "" +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 "" +msgstr "مجموعه‌ای از فایل‌ها در یک پوشهٔ واحد (که ممکن است در یک فایل zip ذخیره شده باشند) که در یک بستهٔ نام‌فضا، همان‌طور که در :pep:`420` تعریف شده است، مشارکت می‌کنند." msgid "positional argument" -msgstr "" +msgstr "آرگومان جایگاهی" msgid "provisional API" -msgstr "" +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 "" +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 "" +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 "" +msgstr "این فرایند به کتابخانهٔ استاندارد اجازه می‌دهد در طول زمان به تکامل خود ادامه دهد، بدون اینکه خطاهای طراحی مشکل‌ساز را برای دوره‌های طولانی تثبیت کند. برای جزئیات بیشتر، :pep:`411` را ببینید." msgid "provisional package" -msgstr "" +msgstr "بستهٔ موقت" msgid "See :term:`provisional API`." -msgstr "" +msgstr ":term:`API موقت ` را ببینید." msgid "Python 3000" -msgstr "" +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 "" +msgstr "نام مستعار برای خط انتشار Python ۳.x (که مدت‌ها پیش، زمانی که انتشار نسخهٔ ۳ چیزی در آیندهٔ دور بود، ساخته شد.) این عبارت همچنین به‌صورت «Py3k» کوتاه می‌شود." msgid "Pythonic" -msgstr "" +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 "" +msgstr "ایده یا بخشی از کد که به‌جای پیاده‌سازی با مفاهیم رایج در زبان‌های دیگر، به‌طور نزدیک از شیوه‌های رایج زبان پایتون پیروی می‌کند. برای مثال، یک شیوهٔ رایج در پایتون این است که با استفاده از دستور :keyword:`for` روی همهٔ المان‌های یک تکرارپذیر حلقه زده شود. بسیاری از زبان‌های دیگر چنین ساختاری ندارند، بنابراین افرادی که با پایتون آشنا نیستند گاهی به‌جای آن از یک شمارندهٔ عددی استفاده می‌کنند::" msgid "" "for i in range(len(food)):\n" " print(food[i])" msgstr "" +"for i in range(len(food)):\n" +" print(food[i])" msgid "As opposed to the cleaner, Pythonic method::" -msgstr "" +msgstr "در مقابل، روش تمیزتر و پایتونی::" msgid "" "for piece in food:\n" " print(piece)" msgstr "" +"for piece in food:\n" +" 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 "" +msgstr "نامی نقطه‌گذاری‌شده که «مسیر» از محدودهٔ سراسری یک ماژول تا یک کلاس، تابع یا متد تعریف‌شده در آن ماژول را نشان می‌دهد، همان‌طور که در :pep:`3155` تعریف شده است. برای تابع‌ها و کلاس‌های سطح بالا، نام واجد شرایط همان نام شیء است::" msgid "" ">>> class C:\n" @@ -1214,255 +1250,272 @@ msgid "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" msgstr "" +">>> class C:\n" +"... class D:\n" +"... def meth(self):\n" +"... pass\n" +"...\n" +">>> C.__qualname__\n" +"'C'\n" +">>> C.D.__qualname__\n" +"'C.D'\n" +">>> 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 "" +msgstr "هنگامی که برای اشاره به ماژول‌ها استفاده می‌شود، *نام کاملاً واجد شرایط* به معنای کل مسیر نقطه‌گذاری‌شده به ماژول است که شامل هر بستهٔ والد نیز می‌شود، برای مثال ``email.mime.text``::" msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" "'email.mime.text'" msgstr "" +">>> import email.mime.text\n" +">>> email.mime.text.__name__\n" +"'email.mime.text'" msgid "race condition" -msgstr "" +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 "" +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 "" +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 "" +msgstr "در :term:`CPython `، تعداد ارجاع‌ها مقادیر پایدار یا به‌خوبی تعریف‌شده‌ای در نظر گرفته نمی‌شوند؛ تعداد ارجاع‌ها به یک شیء و نحوه تأثیرپذیری این تعداد از کد پایتون ممکن است بین نسخه‌ها متفاوت باشد." msgid "regular package" -msgstr "" +msgstr "بستهٔ معمولی" msgid "A traditional :term:`package`, such as a directory containing an ``__init__.py`` file." -msgstr "" +msgstr "یک :term:`بسته ` سنتی، مانند پوشه‌ای که شامل یک فایل ``__init__.py`` است." msgid "See also :term:`namespace package`." -msgstr "" +msgstr "همچنین :term:`بستهٔ نام‌فضا ` را ببینید." msgid "reentrant" -msgstr "" +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 "" +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 "" +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 "" +msgstr "در مورد قفل‌ها، :class:`threading.RLock` پایتون (قفل بازورودپذیر) بازورودپذیر است؛ یعنی نخٔ اجرایی‌ای که از پیش قفل را در اختیار دارد، می‌تواند دوباره آن را دریافت کند، بدون آنکه مسدود شود. در مقابل، :class:`threading.Lock` بازورودپذیر نیست؛ تلاش برای دریافت آن دو بار از همان نخٔ اجرایی باعث یک بن‌بست می‌شود." msgid "See also :term:`lock` and :term:`deadlock`." -msgstr "" +msgstr "همچنین :term:`قفل ` و :term:`بن‌بست ` را ببینید." msgid "REPL" -msgstr "" +msgstr "REPL" msgid "An acronym for the \"read–eval–print loop\", another name for the :term:`interactive` interpreter shell." -msgstr "" +msgstr "سرواژهٔ «read–eval–print loop» و نام دیگری برای پوستهٔ مفسر :term:`تعاملی ` است." msgid "__slots__" -msgstr "" +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 "" +msgstr "یک اعلان درون یک کلاس که با پیش‌اعلام فضای موردنیاز برای ویژگی‌های نمونه و حذف دیکشنری‌های نمونه، در حافظه صرفه‌جویی می‌کند. با وجود محبوبیت این روش، پیاده‌سازی درست آن تا حدی دشوار است و بهتر است آن را به موارد نادری محدود کنید که تعداد نمونه‌ها زیاد است و برنامه از نظر حافظه حساس است." msgid "sequence" -msgstr "" +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 "" +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 "" +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 "" +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 "" +msgstr "روشی فشرده برای پردازش همه یا بخشی از المان‌های یک تکرارپذیر و بازگرداندن یک مجموعه با نتایج. ``results = {c for c in 'abracadabra' if c not in 'abc'}`` مجموعه‌ای از رشته‌ها به‌شکل ``{'r', 'd'}`` تولید می‌کند. :ref:`comprehensions` را ببینید." msgid "single dispatch" -msgstr "" +msgstr "توزیع تک‌گانه" msgid "A form of :term:`generic function` dispatch where the implementation is chosen based on the type of a single argument." -msgstr "" +msgstr "نوعی توزیع :term:`تابع عمومی ` که در آن پیاده‌سازی بر اساس نوع یک آرگومان واحد انتخاب می‌شود." msgid "slice" -msgstr "" +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 "" +msgstr "یک شیء از نوع :class:`slice` که برای توصیف بخشی از یک :term:`دنباله ` استفاده می‌شود. یک شیء برش هنگام استفاده از شکل :ref:`slicing ` در :ref:`subscript notation `، با دو نقطه درون کروشه‌ها، مانند ``variable_name[1:3:5]``، ایجاد می‌شود." msgid "soft deprecated" -msgstr "" +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 "" +msgstr "از یک API که به‌صورت منسوخ‌سازی نرم علامت‌گذاری شده است نباید در کد جدید استفاده شود، اما استفاده از آن در کدهای موجود ایمن است. این API همچنان مستندسازی و آزمایش می‌شود، اما دیگر بهبود داده نخواهد شد." msgid "Soft deprecation, unlike normal deprecation, does not plan on removing the API and will not emit warnings." -msgstr "" +msgstr "منسوخ‌سازی نرم، برخلاف منسوخ‌سازی معمولی، قصد حذف API را ندارد و هیچ هشداری نیز ایجاد نمی‌کند." msgid "See `PEP 387: Soft Deprecation `_." -msgstr "" +msgstr "`PEP 387: Soft Deprecation `_ را نیز ببینید." msgid "special method" -msgstr "" +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 "" +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 "" +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 "" +msgstr "همچنین :data:`sys.stdlib_module_names` را برای فهرستی از همهٔ نام‌های ممکن ماژول‌های کتابخانهٔ استاندارد ببینید." msgid "statement" -msgstr "" +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 "" +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 "" +msgstr "یک ابزار خارجی که کد پایتون را می‌خواند و آن را تحلیل می‌کند و به‌دنبال مشکلاتی مانند نوع‌های نادرست می‌گردد. همچنین :term:`راهنمای نوع ` و ماژول :mod:`typing` را ببینید." msgid "stdlib" -msgstr "" +msgstr "stdlib" msgid "An abbreviation of :term:`standard library`." -msgstr "" +msgstr "شکل کوتاه‌شدهٔ :term:`کتابخانهٔ استاندارد `." msgid "strong reference" -msgstr "" +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 "" +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 "" +msgstr "از تابع :c:func:`Py_NewRef` می‌توان برای ایجاد یک ارجاع قوی به یک شیء استفاده کرد. معمولاً باید تابع :c:func:`Py_DECREF` پیش از خروج از محدودهٔ ارجاع قوی، روی آن فراخوانی شود تا از نشت یک ارجاع جلوگیری شود." msgid "See also :term:`borrowed reference`." -msgstr "" +msgstr "همچنین :term:`ارجاع قرض‌گرفته‌شده ` را ببینید." msgid "subscript" -msgstr "" +msgstr "زیرنویس" 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 "" +msgstr "عبارت درون کروشه‌های یک :ref:`subscription expression `، برای مثال ``3`` در ``items[3]``. معمولاً برای انتخاب یک المان از یک کانتینر استفاده می‌شود. هنگام زیرنویس‌گذاری یک :term:`نگاشت `، به آن :term:`کلید ` نیز گفته می‌شود و هنگام زیرنویس‌گذاری یک :term:`دنباله `، به آن :term:`اندیس ` گفته می‌شود." msgid "synchronization primitive" -msgstr "" +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 "" +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 "" +msgstr "t-string" msgid "t-strings" -msgstr "" +msgstr "t-strings" msgid "String literals prefixed with ``t`` or ``T`` are commonly called \"t-strings\" which is short for :ref:`template string literals `." -msgstr "" +msgstr "لیترال‌های رشته‌ای که با ``t`` یا ``T`` پیشوندگذاری شده‌اند، معمولاً «t-string» نامیده می‌شوند که شکل کوتاه‌شدهٔ :ref:`template string literals ` است." msgid "text encoding" -msgstr "" +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 "" +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 "" +msgstr "سریال‌سازی یک رشته به‌صورت دنباله‌ای از بایت‌ها «کدگذاری» نامیده می‌شود و بازسازی رشته از دنبالهٔ بایت‌ها «کدگشایی» نام دارد." msgid "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." -msgstr "" +msgstr "انواع مختلفی از :ref:`codecs ` برای سریال‌سازی متن وجود دارند که در مجموع «کدگذاری‌های متن» نامیده می‌شوند." msgid "text file" -msgstr "" +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 "" +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 "" +msgstr "همچنین برای یک شیء فایل که می‌تواند :term:`شیء شبه‌بایت ` را بخواند و بنویسد، :term:`فایل دودویی ` را ببینید." msgid "thread state" -msgstr "" +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 "" +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 "" +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 "" +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 "" +msgstr "هر وضعیت نخٔ اجرایی به یک مفسر واحد تعلق دارد، اما هر مفسر ممکن است وضعیت‌های نخٔ اجرایی متعددی داشته باشد، از جمله چند وضعیت برای یک نخٔ اجرایی سیستم‌عامل یکسان. وضعیت‌های نخٔ اجرایی از مفسرهای متعدد ممکن است به یک نخٔ اجرایی یکسان وابسته باشند، اما در هر لحظه فقط یکی از آن‌ها می‌تواند در آن نخٔ اجرایی :term:`وضعیت نخٔ متصل ` باشد." msgid "See :ref:`Thread State and the Global Interpreter Lock ` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر، :ref:`Thread State and the Global Interpreter Lock ` را ببینید." msgid "thread-safe" -msgstr "" +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 "" +msgstr "یک ماژول، تابع یا کلاس که هنگام استفادهٔ هم‌زمان توسط چند نخٔ اجرایی، به‌درستی رفتار می‌کند. کد ایمن برای نخ‌های اجرایی از :term:`اولیه ` مناسب، مانند :term:`قفل `، برای محافظت از وضعیت تغییرپذیر مشترک استفاده می‌کند یا به‌گونه‌ای طراحی شده است که به‌طور کامل از وضعیت تغییرپذیر مشترک اجتناب کند. در ساخت :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict`، :class:`list` و :class:`set` از قفل‌گذاری داخلی برای ایمن‌کردن بسیاری از عملیات در برابر اجرای هم‌زمان نخ‌های اجرایی استفاده می‌کنند، هرچند ایمنی در برابر نخ‌های اجرایی لزوماً تضمین‌شده نیست. کدی که برای نخ‌های اجرایی ایمن نیست، هنگام استفاده در برنامه‌های چندنخی ممکن است دچار :term:`شرط رقابت ` و :term:`رقابت داده ` شود." msgid "token" -msgstr "" +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 "" +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 "" +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 "" +msgstr "رشته‌ای که با سه نمونه از یکی از علامت‌های نقل‌قول (\") یا آپاستروف (') محصور شده است. با اینکه این رشته‌ها قابلیت جدیدی فراتر از رشته‌های تک‌نقل‌قولی فراهم نمی‌کنند، به دلایل متعددی مفید هستند. آن‌ها به شما اجازه می‌دهند علامت‌های نقل‌قول تکی و دوتایی را بدون خنثی‌سازی درون یک رشته قرار دهید و می‌توانند بدون استفاده از نویسهٔ ادامهٔ خط، چندین خط را دربر بگیرند؛ بنابراین هنگام نوشتن docstringها به‌ویژه مفید هستند." msgid "type" -msgstr "" +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 "" +msgstr "نوع یک شیء پایتون تعیین می‌کند که آن شیء از چه نوعی است؛ هر شیء یک نوع دارد. نوع یک شیء به‌عنوان ویژگی :attr:`~object.__class__` آن در دسترس است یا می‌توان آن را با ``type(obj)`` به‌دست آورد." msgid "type alias" -msgstr "" +msgstr "نام مستعار نوع" msgid "A synonym for a type, created by assigning the type to an identifier." -msgstr "" +msgstr "مترادفی برای یک نوع که با نسبت‌دادن نوع به یک شناسه ایجاد می‌شود." msgid "Type aliases are useful for simplifying :term:`type hints `. For example::" -msgstr "" +msgstr "نام‌های مستعار نوع برای ساده‌سازی :term:`راهنمای نوع ` مفید هستند. برای مثال::" msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" msgstr "" +"def remove_gray_shades(\n" +" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" +" pass" msgid "could be made more readable like this::" -msgstr "" +msgstr "می‌توانست به این شکل خواناتر شود::" msgid "" "Color = tuple[int, int, int]\n" @@ -1470,95 +1523,101 @@ msgid "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" msgstr "" +"Color = tuple[int, int, int]\n" +"\n" +"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" +" pass" msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." -msgstr "" +msgstr "برای توضیح این قابلیت، :mod:`typing` و :pep:`484` را ببینید." msgid "type hint" -msgstr "" +msgstr "راهنمای نوع" msgid "An :term:`annotation` that specifies the expected type for a variable, a class attribute, or a function parameter or return value." -msgstr "" +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 "" +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 "" +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 "" +msgstr "روشی برای تفسیر جریان‌های متنی که در آن همهٔ موارد زیر به‌عنوان پایان یک خط شناخته می‌شوند: قرارداد پایان خط یونیکس ``'\\n'``، قرارداد ویندوز ``'\\r\\n'`` و قرارداد قدیمی مکینتاش ``'\\r'``. همچنین :pep:`278` و :pep:`3116` و نیز :func:`bytes.splitlines` را برای کاربردی دیگر ببینید." msgid "variable annotation" -msgstr "" +msgstr "حاشیه‌نویسی متغیر" msgid "An :term:`annotation` of a variable or a class attribute." -msgstr "" +msgstr "یک :term:`حاشیه‌گذاری ` برای یک متغیر یا یک ویژگی کلاس." msgid "When annotating a variable or a class attribute, assignment is optional::" -msgstr "" +msgstr "هنگام حاشیه‌نویسی یک متغیر یا یک ویژگی کلاس، انتساب اختیاری است::" msgid "" "class C:\n" " field: 'annotation'" 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 "" +msgstr "حاشیه‌نویسی‌های متغیر معمولاً برای :term:`راهنمای نوع ` استفاده می‌شوند؛ برای مثال، انتظار می‌رود این متغیر مقادیر :class:`int` را بپذیرد::" msgid "count: int = 0" -msgstr "" +msgstr "count: int = 0" msgid "Variable annotation syntax is explained in section :ref:`annassign`." -msgstr "" +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 "" +msgstr "همچنین :term:`حاشیه‌گذاری تابع `، :pep:`484` و :pep:`526` را که این قابلیت را توصیف می‌کنند، ببینید. برای بهترین روش‌های کار با حاشیه‌نویسی‌ها نیز :ref:`annotations-howto` را ببینید." msgid "virtual environment" -msgstr "" +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 "" +msgstr "یک محیط ران‌تایم ایزوله‌شدهٔ مشارکتی که به کاربران و برنامه‌های پایتون اجازه می‌دهد بسته‌های توزیعی پایتون را بدون تداخل با رفتار سایر برنامه‌های پایتونی در حال اجرا روی همان سیستم، نصب و ارتقا دهند." msgid "See also :mod:`venv`." -msgstr "" +msgstr "همچنین :mod:`venv` را ببینید." msgid "virtual machine" -msgstr "" +msgstr "ماشین مجازی" msgid "A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler." -msgstr "" +msgstr "یک رایانه که به‌طور کامل در نرم‌افزار تعریف شده است. ماشین مجازی پایتون :term:`بایت‌کد ` تولیدشده توسط کامپایلر بایت‌کد را اجرا می‌کند." msgid "walrus operator" -msgstr "" +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 "" +msgstr "روشی شوخ‌طبعانه برای اشاره به عملگر :ref:`assignment expression ` یعنی ``:=``، زیرا اگر سرتان را کمی کج کنید، ظاهر آن تا حدی شبیه یک والروس است." msgid "Zen of Python" -msgstr "" +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 "" +msgstr "فهرستی از اصول و فلسفه‌های طراحی پایتون که برای درک و استفاده از این زبان مفید هستند. این فهرست با واردکردن «``import this``» در اعلان تعاملی قابل مشاهده است." msgid "..." -msgstr "" +msgstr "..." msgid "ellipsis literal" -msgstr "" +msgstr "لیترال سه‌نقطه" msgid "C-contiguous" -msgstr "" +msgstr "پیوسته در C" msgid "Fortran contiguous" -msgstr "" +msgstr "پیوسته در Fortran" msgid "magic" -msgstr "" +msgstr "جادو" msgid "special" -msgstr "" +msgstr "ویژه" \ No newline at end of file diff --git a/library/functions.po b/library/functions.po index 526ddd918..0f73c73f9 100644 --- a/library/functions.po +++ b/library/functions.po @@ -1006,7 +1006,7 @@ msgid "If one positional argument is provided, it should be an :term:`iterable`. 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` پرتاب می‌شود." +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)``، سازگار است." @@ -1051,7 +1051,7 @@ msgid "*file* is a :term:`path-like object` giving the pathname (absolute or rel 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* را مشخص نکنید.) حالت‌های موجود عبارت‌اند از:" +msgstr "*mode* یک رشتهٔ اختیاری است که حالت باز شدن پرونده را مشخص می‌کند. مقدار پیش‌فرض آن ``'r'`` است که به معنای باز کردن پرونده برای خواندن در حالت متنی است. مقادیر رایج دیگر عبارت‌اند از ``'w'`` برای نوشتن (که اگر پرونده از قبل وجود داشته باشد، محتوای آن را حذف می‌کند)، ``'x'`` برای ایجاد انحصاری، و ``'a'`` برای افزودن به انتهای پرونده (که در *برخی* از سیستم‌های یونیکس به این معناست که *تمام* عملیات نوشتن، صرف‌نظر از موقعیت فعلی نشانگر، به انتهای پرونده افزوده می‌شوند). در حالت متنی، اگر *encoding* مشخص نشده باشد، کدگذاری مورد استفاده به سکو بستگی دارد؛ در این حالت، :func:`locale.getencoding` برای دریافت کدگذاری محلی (locale) فعلی فراخوانی می‌شود. (برای خواندن و نوشتن بایت‌های خام، از حالت دودویی استفاده کنید و *encoding* را مشخص نکنید.) حالت‌های موجود عبارت‌اند از:" msgid "Character" msgstr "نویسه" @@ -1105,7 +1105,7 @@ msgid "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'`` 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* داده‌شده رمزگشایی می‌شوند." +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 "پایتون به مفهوم پروندهٔ متنی در سیستم‌عامل زیربنایی وابسته نیست؛ تمام پردازش‌ها توسط خود پایتون انجام می‌شوند و بنابراین مستقل از سکو هستند." @@ -1120,25 +1120,25 @@ msgid "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` ret 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` مراجعه کنید." +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` ثبت شده باشد نیز معتبر است. نام‌های استاندارد شامل موارد زیر هستند:" +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`` نیز همین رفتار را دارد." +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'`` باعث می‌شود در محل داده‌های نادرست، یک نویسهٔ جایگزین (مانند ``'?'``) درج شود." 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``، این واحدهای کد جانشین دوباره به همان بایت‌ها تبدیل می‌شوند. این قابلیت برای پردازش پرونده‌هایی با رمزگذاری نامشخص مفید است." +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};` جایگزین می‌شوند." +msgstr "``'xmlcharrefreplace'`` فقط هنگام نوشتن در یک پرونده پشتیبانی می‌شود. نویسه‌هایی که توسط کدگذاری پشتیبانی نمی‌شوند، با ارجاع نویسهٔ XML متناظر آن‌ها به صورت :samp:`&#{nnn};` جایگزین می‌شوند." msgid "``'backslashreplace'`` replaces malformed data by Python's backslashed escape sequences." msgstr "``'backslashreplace'`` داده‌های نادرست را با توالی‌های گریز دارای بک‌اسلش در پایتون جایگزین می‌کند." @@ -1275,7 +1275,7 @@ msgid "All non-keyword arguments are converted to strings like :func:`str` does msgstr "همهٔ آرگومان‌های غیرکلیدواژه‌ای، همانند :func:`str`، به رشته تبدیل شده و با جداکنندهٔ *sep* از یکدیگر جدا شده و سپس همراه با *end* در جریان (stream) نوشته می‌شوند. هر دو مقدار *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(...)`` استفاده کنید." +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 باشد، جریان داده به‌اجبار تخلیه می‌شود." @@ -1405,7 +1405,7 @@ msgid "Rather than being a function, :class:`range` is actually an immutable seq 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` پرتاب می‌کند." +msgstr "رشته‌ای را برمی‌گرداند که نمایش قابل چاپی از یک شیء را در بر دارد. برای بسیاری از نوع‌ها، این تابع تلاش می‌کند رشته‌ای برگرداند که اگر به :func:`eval` داده شود، شی‌ءای با همان مقدار تولید کند؛ در غیر این صورت، نمایش به‌صورت رشته‌ای درون کروشه‌های زاویه‌دار خواهد بود که نام نوع شیء و اطلاعات اضافی، که معمولاً شامل نام و نشانی شیء است، در آن قرار دارد. یک کلاس می‌تواند با تعریف متد :meth:`~object.__repr__` مشخص کند که این تابع برای نمونه‌های آن چه مقداری برگرداند. اگر :func:`sys.displayhook` در دسترس نباشد، این تابع استثنای :exc:`RuntimeError` پرتاب می‌کند." msgid "This class has a custom representation that can be evaluated::" msgstr "این کلاس یک نمایش (representation) سفارشی دارد که قابل ارزیابی است::" @@ -1428,7 +1428,7 @@ msgstr "" " 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`` شروع می‌شوند) پشتیبانی کند." +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`` باشد، نزدیک‌ترین عدد صحیح به ورودی را برمی‌گرداند." @@ -1620,7 +1620,7 @@ msgid "Rather than being a function, :class:`tuple` is actually an immutable seq 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__` بازگردانده می‌شود." +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` توصیه می‌شود، زیرا زیرکلاس‌ها را نیز در نظر می‌گیرد." @@ -1656,7 +1656,7 @@ 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` پرتاب می‌شود." +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` به‌روزرسانی شده است." @@ -1783,7 +1783,7 @@ 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` به یک نام منتسب می‌شود." +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`` به نتیجهٔ زیر منجر می‌شود::" diff --git a/scripts/fix_term_refs.py b/scripts/fix_term_refs.py new file mode 100644 index 000000000..a18cfe2cc --- /dev/null +++ b/scripts/fix_term_refs.py @@ -0,0 +1,307 @@ +#!/usr/bin/env python3 +""" +fix_term_refs.py + +Converts plain Sphinx `:term:`English`` references inside the *translated* +(msgstr) strings of a gettext .po file into the explicit-title form: + + :term:`Persian translation ` + +so that the reader sees translated text while the link still resolves to the +correct (English) glossary entry ID. + +The English msgid lines are left completely untouched. Only msgstr strings +are modified, and only occurrences of :term:`X` where X has no `<...>` +already (i.e. plain references, not ones that already specify a custom title). + +Persian translations are looked up in two places, in priority order: + 1. This .po file's own entries — i.e. if somewhere in the file there's a + msgid "duck-typing" / msgstr "نوع‌دهی اردکی", that translation is used. + 2. A fallback dictionary (FALLBACK_MAP below) for terms that aren't + separately defined in the .po file itself. Edit/extend this dict for + your own glossary as needed. + +If a term can't be resolved through either source, the reference is left +unchanged and reported at the end so you can add it to FALLBACK_MAP or fix +the source file. + +Usage: + python3 fix_term_refs.py input.po output.po + +If output.po is omitted, writes to input.fixed.po next to the input file. +""" + +import re +import sys + +# --------------------------------------------------------------------------- +# Fallback English -> target-language translations, used only when a term +# isn't itself defined as a msgid/msgstr pair inside the .po file. +# Extend this for your own glossary/language as needed. +# --------------------------------------------------------------------------- +FALLBACK_MAP = { + "accessibility": "دسترسی‌پذیری", + "await": "await", + "argument": "آرگومان", + "async": "ناهمگام، غیرهمگام", + "API": "API", + "attribute": "ویژگی، صفت، شاخصه", + "boolean": "بولی", + "built-in": "توکار، درونی، درون‌ساخته", + "callback": "کال‌بک، فراخوانی بازگشتی", + "character": "نویسه", + "context management": "مدیریت زمینه", + "class": "کلاس", + "cache": "نهانگاه", + "coroutine": "هم‌روال", + "command line": "خط فرمان", + "community": "کامیونیتی", + "component": "کامپوننت", + "custom": "سفارشی، اختصاصی", + "decorator": "دکوراتور، آراینده", + "debugging": "اشکال‌زدایی، دیباگ کردن", + "decoding": "کدگشایی", + "deprecated": "منسوخ، از رده خارج شده", + "dependency": "وابستگی", + "dictionary": "دیکشنری", + "directory": "پوشه", + "duck-typing": "نوع‌دهی اردکی", + "DOM": "DOM", + "element": "المان، عنصر", + "endpoint": "پایانه", + "escape": "خنثی کردن", + "encoding": "کدگذاری", + "ecosystem": "اکوسیستم", + "event": "رویداد", + "exception": "استثنا", + "expression": "عبارت", + "function": "تابع", + "f-string": "اف‌استرینگ", + "generator": "تولیدگر", + "global": "سراسری", + "garbage collection": "زباله‌روبی", + "generic function": "تابع عام، تابع عمومی", + "hexadecimal": "مبنای شانزده", + "immortal": "نامیرا", + "import": "ایمپورت", + "immutable": "تغییرناپذیر", + "index": "اندیس، شماره", + "instance": "نمونه", + "integer": "عدد صحیح", + "interface": "رابط", + "interpreter": "مفسر", + "item": "آیتم", + "iterable": "تکرارپذیر", + "keyword": "کلیدواژه", + "keyword argument": "آرگومان کلیدواژه‌ای", + "list": "فهرست", + "list comprehension": "درک فهرستی", + "load": "بارگذاری", + "loader": "بارگذار", + "local": "محلی", + "loop": "حلقه", + "method": "متد", + "metaclass": "فراکلاس", + "mock": "ماک", + "module": "ماژول", + "mutable": "تغییرپذیر", + "namespace": "نام‌فضا", + "object": "شیء", + "operator": "عملگر", + "package": "بسته", + "parameter": "پارامتر", + "positional": "جایگاهی", + "property": "ویژگی، پراپرتی، خصوصیت", + "parallelism": "موازی‌سازی", + "quotation": "علامت نقل‌قول", + "raise": "پرتاب", + "return": "بازگشت، برگرداندن", + "runtime": "ران‌تایم", + "race": "رقابت", + "scope": "محدوده", + "shadowing": "پوشاندن", + "stack traceback": "ردگیری پشته", + "statement": "دستور", + "string": "رشته", + "syntax": "سینتکس، نحو", + "shell": "پوسته", + "syntactic sugar": "قند نحوی", + "tracking": "پیگیری", + "type": "نوع، نوع داده، تایپ", + "thread": "نخ", + "unit test": "یونیت تست", + "unpacking": "واگشایی", + "value": "مقدار", + "variable": "متغیر", + "wrapper": "پوششی، دربرگیرنده", + "iterator": "تکرارگر", +} + +# Matches BOTH forms so both get (re)normalized to :term:`Persian `: +# :term:`X` -- plain ref, target/display are both X +# :term:`Something ` -- already has explicit title (target is X); +# "Something" may be stale English display +# text left over from the source file. +# Group 'target' is always the real glossary-entry id to link to. +TERM_RE = re.compile( + r":term:`(?:(?P[^`<>]+)|[^`<>]*<(?P[^`<>]+)>)`" +) + + +def po_unescape(s): + return s.replace("\\n", "\n").replace('\\"', '"').replace("\\\\", "\\") + + +def po_escape(s): + return s.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") + + +def parse_po_string_block(lines, i, n): + """Parse a 'msgid "..."' or 'msgstr "..."' plus any continuation quoted + lines. Returns (keyword, parts, next_index).""" + m = re.match(r'^(msgid|msgstr)\s+"(.*)"\s*$', lines[i]) + keyword = m.group(1) + parts = [m.group(2)] + j = i + 1 + while j < n and re.match(r'^\s*"(.*)"\s*$', lines[j]): + parts.append(re.match(r'^\s*"(.*)"\s*$', lines[j]).group(1)) + j += 1 + return keyword, parts, j + + +def parse_po(text): + """Parse .po text into a list of entries: pairs (msgid/msgstr) or other + raw lines (comments, headers, blanks), preserving order.""" + lines = text.split("\n") + n = len(lines) + entries = [] + i = 0 + while i < n: + if re.match(r'^msgid\s+"', lines[i]): + _, id_parts, j1 = parse_po_string_block(lines, i, n) + if j1 < n and re.match(r'^msgstr\s+"', lines[j1]): + _, str_parts, j2 = parse_po_string_block(lines, j1, n) + entries.append( + {"type": "pair", "msgid_parts": id_parts, "msgstr_parts": str_parts} + ) + i = j2 + else: + entries.append({"type": "other", "raw": [lines[i]]}) + i = i + 1 # fall back to line-by-line if malformed + else: + entries.append({"type": "other", "raw": [lines[i]]}) + i += 1 + return entries + + +def join_parts_decoded(parts): + return "".join(po_unescape(p) for p in parts) + + +def build_term_map(entries): + """Build English-term -> translation dict from the .po file's own short, + markup-free msgid/msgstr pairs (these are glossary entry definitions).""" + term_map = {} + for e in entries: + if e["type"] != "pair": + continue + msgid_full = join_parts_decoded(e["msgid_parts"]).strip() + msgstr_full = join_parts_decoded(e["msgstr_parts"]).strip() + if not msgid_full or not msgstr_full: + continue + if re.search(r"[`:]", msgid_full) or len(msgid_full) > 60: + continue + term_map[msgid_full] = msgstr_full + return term_map + + +def fix_po(text): + """Run the conversion. Returns (new_text, changed_count, missing_terms).""" + entries = parse_po(text) + term_map = build_term_map(entries) + missing = set() + + def translate(term): + if term in term_map: + return term_map[term] + if term in FALLBACK_MAP: + return FALLBACK_MAP[term] + return None + + def replace_in_text(s): + def repl(m): + term = m.group("target_only") or m.group("target_bracketed") + translated = translate(term) + if translated is None: + missing.add(term) + return m.group(0) # leave completely unchanged + return f":term:`{translated} <{term}>`" + + return TERM_RE.sub(repl, s) + + changed_count = 0 + for e in entries: + if e["type"] != "pair": + continue + msgstr_full = join_parts_decoded(e["msgstr_parts"]) + if ":term:`" not in msgstr_full: + continue + new_full = replace_in_text(msgstr_full) + if new_full == msgstr_full: + continue + changed_count += 1 + if len(e["msgstr_parts"]) > 1: + segs = new_full.split("\n") + new_parts = [""] + for k, seg in enumerate(segs): + suffix = "\\n" if k < len(segs) - 1 else "" + new_parts.append(po_escape(seg) + suffix) + e["msgstr_parts"] = new_parts + else: + e["msgstr_parts"] = [po_escape(new_full)] + + out_lines = [] + for e in entries: + if e["type"] == "other": + out_lines.extend(e["raw"]) + else: + out_lines.append(f'msgid "{e["msgid_parts"][0]}"') + for p in e["msgid_parts"][1:]: + out_lines.append(f'"{p}"') + out_lines.append(f'msgstr "{e["msgstr_parts"][0]}"') + for p in e["msgstr_parts"][1:]: + out_lines.append(f'"{p}"') + + return "\n".join(out_lines), changed_count, missing + + +def main(): + if len(sys.argv) < 2: + print("Usage: python3 fix_term_refs.py input.po [output.po]") + sys.exit(1) + + in_path = sys.argv[1] + out_path = ( + sys.argv[2] if len(sys.argv) > 2 else re.sub(r"\.po$", ".fixed.po", in_path) + ) + + with open(in_path, encoding="utf-8") as f: + text = f.read() + + new_text, changed_count, missing = fix_po(text) + + with open(out_path, "w", encoding="utf-8") as f: + f.write(new_text) + + print(f"Wrote: {out_path}") + print(f"Changed msgstr entries: {changed_count}") + if missing: + print(f"Terms left unchanged (no translation found, {len(missing)}):") + for t in sorted(missing): + print(f" - {t}") + else: + print("All :term: references resolved.") + + +if __name__ == "__main__": + main() diff --git a/tutorial/classes.po b/tutorial/classes.po index 950a471e0..94eede45e 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -64,7 +64,7 @@ msgid "By the way, I use the word *attribute* for any name following a dot --- f msgstr "به‌هرحال، من واژه‌ی *ویژگی* «*attribute*» را برای هر نامی که بعد از یک نقطه بیاید به کار می‌برم — برای مثال، در عبارت ``z.real``, ``real`` یک ویژگی شیء ``z`` است. از نظر دقیق‌تر، ارجاع به نام‌ها در ماژول‌ها نیز نوعی ارجاع به ویژگی محسوب می‌شود: در عبارت ``modname.funcname``, ``modname`` یک شیء ماژول است و ``funcname`` یکی از ویژگیهای آن است. در این حالت، نگاشتی ساده و مستقیم بین ویژگیهای ماژول و نام‌های سراسری تعریف‌شده در آن وجود دارد: هر دو یک فضای نام (namespace) را به اشتراک می‌گذارند! [#]_" msgid "Attributes may be read-only or writable. In the latter case, assignment to attributes is possible. Module attributes are writable: you can write ``modname.the_answer = 42``. Writable attributes may also be deleted with the :keyword:`del` statement. For example, ``del modname.the_answer`` will remove the attribute :attr:`!the_answer` from the object named by ``modname``." -msgstr "ویژگیها ممکن است فقط خواندنی یا قابل نوشتن باشند. در حالت دوم، اختصاص دادن به ویژگیها ممکن است. ویژگیهای ماژول قابل نوشتن هستند: می‌توانید ``modname.the_answer = 42`` را بنویسید. ویژگیهای قابل نوشتن را می‌توان با دستور :keyword:`del` نیز حذف کرد. به‌عنوان مثال، ``del modname.the_answer`` ویژگی :attr:`!the_answer` را از شیئی که توسط ``modname`` نامگذاری شده است حذف خواهد کرد." +msgstr "ویژگیها ممکن است فقط خواندنی یا قابل نوشتن باشند. در حالت دوم، اختصاص دادن به ویژگیها ممکن است. ویژگیهای ماژول قابل نوشتن هستند: می‌توانید ``modname.the_answer = 42`` را بنویسید. ویژگیهای قابل نوشتن را می‌توان با دستور :keyword:`del` نیز حذف کرد. به‌عنوان مثال، ``del modname.the_answer`` ویژگی :attr:`!the_answer` را از شی‌ءای که توسط ``modname`` نامگذاری شده است حذف خواهد کرد." msgid "Namespaces are created at different moments and have different lifetimes. The namespace containing the built-in names is created when the Python interpreter starts up, and is never deleted. The global namespace for a module is created when the module definition is read in; normally, module namespaces also last until the interpreter quits. The statements executed by the top-level invocation of the interpreter, either read from a script file or interactively, are considered part of a module called :mod:`__main__`, so they have their own global namespace. (The built-in names actually also live in a module; this is called :mod:`builtins`.)" msgstr "فضا‌های نام در لحظات مختلف ایجاد می‌شوند و دارای طول عمر‌های متفاوتی هستند. فضای نام که شامل نام‌های داخلی است، زمانی که مفسر پایتون شروع به کار می‌کند ایجاد می‌شود و هرگز حذف نمی‌شود. فضای نام عمومی برای یک ماژول زمانی که تعریف ماژول خوانده می‌شود ایجاد می‌گردد؛ به‌طور معمول، فضا‌های نام ماژول نیز تا زمانی که مفسر پایان یابد باقی می‌مانند. دستوراتی که توسط اجرای سطح بالای مفسر، یا از فایل اسکریپت خوانده شده یا به‌طور تعاملی اجرا می‌شوند، به‌عنوان بخشی از ماژولی به نام :mod:`__main__` در نظر گرفته می‌شوند، بنابراین آن‌ها فضای نام عمومی خود را دارند. (نام‌های درون‌ساخت نیز در واقع در یک ماژول قرار دارند؛ این ماژول :mod:`builtins` نامیده می‌شود.)" @@ -393,7 +393,7 @@ msgstr "" "'Buddy'" msgid "As discussed in :ref:`tut-object`, shared data can have possibly surprising effects involving :term:`mutable` objects such as lists and dictionaries. For example, the *tricks* list in the following code should not be used as a class variable because just a single list would be shared by all *Dog* instances::" -msgstr "همان‌طور که در :ref:`tut-object` بحث شد، داده‌های مشترک می‌توانند تأثیرات شگفت‌آوری بر روی اشیاء :term:`mutable` مانند فهرستها و دیکشنری‌ها داشته باشند. برای مثال، فهرست *tricks* در کد زیر نباید به‌عنوان یک متغیر کلاس استفاده شود، زیرا فقط یک فهرست واحد بین همه‌ی نمونه‌های *Dog* مشترک خواهد بود::" +msgstr "همان‌طور که در :ref:`tut-object` بحث شد، داده‌های مشترک می‌توانند تأثیرات شگفت‌آوری بر روی اشیاء :term:`تغییرپذیر ` مانند فهرستها و دیکشنری‌ها داشته باشند. برای مثال، فهرست *tricks* در کد زیر نباید به‌عنوان یک متغیر کلاس استفاده شود، زیرا فقط یک فهرست واحد بین همه‌ی نمونه‌های *Dog* مشترک خواهد بود::" msgid "" "class Dog:\n" @@ -885,7 +885,7 @@ msgid "Generators" msgstr "تولیدگر" msgid ":term:`Generators ` are a simple and powerful tool for creating iterators. They are written like regular functions but use the :keyword:`yield` statement whenever they want to return data. Each time :func:`next` is called on it, the generator resumes where it left off (it remembers all the data values and which statement was last executed). An example shows that generators can be trivially easy to create::" -msgstr ":term:`Generators ` یک ابزار ساده و قدرتمند برای ایجاد اینتراتور‌ها هستند. آن‌ها مانند توابع عادی نوشته می‌شوند اما هر زمان که می‌خواهند داده‌ای را بازگردانند از دستور :keyword:`yield` استفاده می‌کنند. هر بار که :func:`next` بر روی آن فراخوانی می‌شود، تولیدگر از جایی که متوقف شده ادامه می‌یابد (تمام مقادیر داده‌ها و اینکه آخرین دستور اجرا شده چه بوده را به خاطر می‌آورد). یک مثال نشان می‌دهد که ایجاد تولیدگر‌ها می‌تواند به طرز باور‌نکردنی ساده باشد::" +msgstr ":term:`تولیدگر ` یک ابزار ساده و قدرتمند برای ایجاد اینتراتور‌ها هستند. آن‌ها مانند توابع عادی نوشته می‌شوند اما هر زمان که می‌خواهند داده‌ای را بازگردانند از دستور :keyword:`yield` استفاده می‌کنند. هر بار که :func:`next` بر روی آن فراخوانی می‌شود، تولیدگر از جایی که متوقف شده ادامه می‌یابد (تمام مقادیر داده‌ها و اینکه آخرین دستور اجرا شده چه بوده را به خاطر می‌آورد). یک مثال نشان می‌دهد که ایجاد تولیدگر‌ها می‌تواند به طرز باور‌نکردنی ساده باشد::" msgid "" "def reverse(data):\n" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index b7baca16a..49ebead53 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -212,10 +212,10 @@ msgstr "" "range(0, 10)" msgid "In many ways the object returned by :func:`range` behaves as if it is a list, but in fact it isn't. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn't really make the list, thus saving space." -msgstr "از بسیاری جهات، شیئی که توسط :func:`range` برگردانده می‌شود طوری رفتار می‌کند که گویی یک فهرست است، اما در واقع چنین نیست. این یک شیء است که هنگام پیمایش، آیتم‌های متوالی دنبالهٔ موردنظر را برمی‌گرداند، اما واقعاً فهرست را ایجاد نمی‌کند و در نتیجه در فضا صرفه‌جویی می‌شود." +msgstr "از بسیاری جهات، شی‌ءای که توسط :func:`range` برگردانده می‌شود طوری رفتار می‌کند که گویی یک فهرست است، اما در واقع چنین نیست. این یک شیء است که هنگام پیمایش، آیتم‌های متوالی دنبالهٔ موردنظر را برمی‌گرداند، اما واقعاً فهرست را ایجاد نمی‌کند و در نتیجه در فضا صرفه‌جویی می‌شود." msgid "We say such an object is :term:`iterable`, that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the :keyword:`for` statement is such a construct, while an example of a function that takes an iterable is :func:`sum`::" -msgstr "می‌گوییم چنین شیئی :term:`iterable` است؛ یعنی برای استفاده به‌عنوان هدف تابع‌ها و ساختارهایی مناسب است که انتظار دارند چیزی وجود داشته باشد که بتوانند از آن آیتم‌های متوالی را تا زمانی که چیزی باقی نمانده است دریافت کنند. دیدیم که دستور :keyword:`for` چنین ساختاری است، در حالی که نمونه‌ای از تابعی که یک شیء تکرارپذیر دریافت می‌کند :func:`sum` است::" +msgstr "می‌گوییم چنین شی‌ءای :term:`تکرارپذیر ` است؛ یعنی برای استفاده به‌عنوان هدف تابع‌ها و ساختارهایی مناسب است که انتظار دارند چیزی وجود داشته باشد که بتوانند از آن آیتم‌های متوالی را تا زمانی که چیزی باقی نمانده است دریافت کنند. دیدیم که دستور :keyword:`for` چنین ساختاری است، در حالی که نمونه‌ای از تابعی که یک شیء تکرارپذیر دریافت می‌کند :func:`sum` است::" msgid "" ">>> sum(range(4)) # 0 + 1 + 2 + 3\n" @@ -397,7 +397,7 @@ msgid "For this last case, many people use the ellipsis literal :code:`...` inst msgstr "برای حالت آخر، بسیاری از افراد به‌جای :code:`pass` از مقدار لفظی بیضی :code:`...` استفاده می‌کنند. این استفاده هیچ معنای ویژه‌ای برای پایتون ندارد و بخشی از تعریف زبان نیست (در اینجا می‌توانستید از هر عبارت ثابتی استفاده کنید)، اما :code:`...` به‌صورت قراردادی به‌عنوان بدنهٔ جای‌نگهدار نیز استفاده می‌شود. به :ref:`bltin-ellipsis-object` مراجعه کنید." msgid ":keyword:`!match` Statements" -msgstr ":keyword:`!match` دستورات" +msgstr "دستورات :keyword:`!match`" msgid "A :keyword:`match` statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it's more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed." msgstr "یک دستور :keyword:`match` یک عبارت را دریافت می‌کند و مقدار آن را با الگوهای متوالی که در یک یا چند بلوک case ارائه شده‌اند مقایسه می‌کند. این دستور در ظاهر شبیه دستور switch در C، Java یا JavaScript (و بسیاری از زبان‌های دیگر) است، اما شباهت بیشتری به تطبیق الگو (*pattern matching*) در زبان‌هایی مانند Rust یا Haskell دارد. تنها اولین الگویی که تطبیق پیدا کند اجرا می‌شود و این دستور همچنین می‌تواند اجزا (عناصر دنباله یا ویژگی‌های شیء) را از مقدار استخراج کرده و در متغیرها قرار دهد. اگر هیچ caseای تطبیق پیدا نکند، هیچ‌یک از شاخه‌ها اجرا نمی‌شوند." @@ -694,7 +694,7 @@ msgid "The actual parameters (arguments) to a function call are introduced in th msgstr "پارامترهای واقعی (آرگومان‌ها) در یک فراخوانی تابع، هنگام فراخوانی تابع در جدول نماد محلی تابع فراخوانی‌شده قرار می‌گیرند؛ بنابراین، آرگومان‌ها با استفاده از *انتقال با مقدار* (*call by value*) ارسال می‌شوند (که در آن *مقدار* همیشه یک ارجاع به شیء است، نه مقدار خود شیء). [#]_ هنگامی که یک تابع، تابع دیگری را فراخوانی می‌کند یا به‌صورت بازگشتی خودش را فراخوانی می‌کند، یک جدول نماد محلی جدید برای آن فراخوانی ایجاد می‌شود." msgid "A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function::" -msgstr "یک تعریف تابع، نام تابع را با شیء تابع در جدول نماد فعلی مرتبط می‌کند. مفسر شیئی را که آن نام به آن اشاره می‌کند به‌عنوان یک تابع تعریف‌شده توسط کاربر تشخیص می‌دهد. نام‌های دیگر نیز می‌توانند به همان شیء تابع اشاره کنند و برای دسترسی به تابع استفاده شوند::" +msgstr "یک تعریف تابع، نام تابع را با شیء تابع در جدول نماد فعلی مرتبط می‌کند. مفسر شی‌ءای را که آن نام به آن اشاره می‌کند به‌عنوان یک تابع تعریف‌شده توسط کاربر تشخیص می‌دهد. نام‌های دیگر نیز می‌توانند به همان شیء تابع اشاره کنند و برای دسترسی به تابع استفاده شوند::" msgid "" ">>> fib\n" @@ -887,7 +887,7 @@ msgid "Keyword Arguments" msgstr "آرگومان‌های کلیدواژه‌ای" msgid "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following function::" -msgstr "تابع‌ها همچنین می‌توانند با استفاده از :term:`keyword arguments ` به شکل ``kwarg=value`` فراخوانی شوند. برای نمونه، تابع زیر::" +msgstr "تابع‌ها همچنین می‌توانند با استفاده از :term:`آرگومان کلیدواژه‌ای ` به شکل ``kwarg=value`` فراخوانی شوند. برای نمونه، تابع زیر::" msgid "" "def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" @@ -1543,7 +1543,7 @@ msgid "function annotations" msgstr "حاشیه‌نویسی‌های تابع" msgid ": (colon)" -msgstr ": (علامت نقل‌وقول)" +msgstr ": (علامت نقل‌قول)" msgid "coding" msgstr "کد زدن" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 0ba83e4c1..c31a09ff1 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -519,7 +519,7 @@ msgid "As you see, on output tuples are always enclosed in parentheses, so that msgstr "همان‌طور که می‌بینید، در خروجی تاپل‌ها همیشه درون پرانتز قرار می‌گیرند تا تاپل‌های تو‌در‌تو به‌درستی تفسیر شوند؛ آن‌ها می‌توانند با یا بدون پرانتزهای اطرافشان وارد شوند، اگرچه اغلب پرانتزها به هر حال لازم هستند (اگر تاپل بخشی از یک عبارت بزرگ‌تر باشد). امکان انتساب به آیتم‌های جداگانهٔ یک تاپل وجود ندارد، بااین‌حال می‌توان تاپل‌هایی ایجاد کرد که شامل اشیای تغییرپذیر، مانند فهرست‌ها، باشند." msgid "Though tuples may seem similar to lists, they are often used in different situations and for different purposes. Tuples are :term:`immutable`, and usually contain a heterogeneous sequence of elements that are accessed via unpacking (see later in this section) or indexing (or even by attribute in the case of :func:`namedtuples `). Lists are :term:`mutable`, and their elements are usually homogeneous and are accessed by iterating over the list." -msgstr "اگرچه تاپل‌ها ممکن است شبیه فهرست‌ها به نظر برسند، اغلب در موقعیت‌ها و برای اهداف متفاوتی استفاده می‌شوند. تاپل‌ها :term:`immutable` هستند و معمولاً شامل یک دنبالهٔ ناهمگن از عناصر هستند که از طریق واگشایی (در ادامهٔ این بخش توضیح داده می‌شود) یا اندیس‌‌گذاری (یا حتی از طریق ویژگی‌ها در مورد :func:`namedtuples `) به آن‌ها دسترسی پیدا می‌شود. فهرست‌ها :term:`mutable` هستند و عناصر آن‌ها معمولاً همگن هستند و با پیمایش روی فهرست به آن‌ها دسترسی پیدا می‌شود." +msgstr "اگرچه تاپل‌ها ممکن است شبیه فهرست‌ها به نظر برسند، اغلب در موقعیت‌ها و برای اهداف متفاوتی استفاده می‌شوند. تاپل‌ها :term:`تغییرناپذیر ` هستند و معمولاً شامل یک دنبالهٔ ناهمگن از عناصر هستند که از طریق واگشایی (در ادامهٔ این بخش توضیح داده می‌شود) یا اندیس‌‌گذاری (یا حتی از طریق ویژگی‌ها در مورد :func:`namedtuples `) به آن‌ها دسترسی پیدا می‌شود. فهرست‌ها :term:`تغییرپذیر ` هستند و عناصر آن‌ها معمولاً همگن هستند و با پیمایش روی فهرست به آن‌ها دسترسی پیدا می‌شود." msgid "A special problem is the construction of tuples containing 0 or 1 items: the syntax has some extra quirks to accommodate these. Empty tuples are constructed by an empty pair of parentheses; a tuple with one item is constructed by following a value with a comma (it is not sufficient to enclose a single value in parentheses). Ugly, but effective. For example::" msgstr "یک مسئلهٔ ویژه، ساخت تاپل‌هایی است که شامل 0 یا 1 آیتم هستند: نحو زبان برای سازگاری با این موارد چند نکتهٔ خاص دارد. تاپل‌های خالی با یک جفت پرانتز خالی ساخته می‌شوند؛ یک تاپل با یک آیتم با قرار دادن یک ویرگول پس از یک مقدار ساخته می‌شود (قرار دادن یک مقدار تنها درون پرانتز کافی نیست). زشت، اما مؤثر. برای مثال::" @@ -627,13 +627,13 @@ msgstr "" "{'r', 'd'}" msgid "Dictionaries" -msgstr "فرهنگ‌های لغت" +msgstr "دیکشنری‌ها" msgid "Another useful data type built into Python is the *dictionary* (see :ref:`typesmapping`). Dictionaries are sometimes found in other languages as \"associative memories\" or \"associative arrays\". Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by *keys*, which can be any immutable type; strings and numbers can always be keys. Tuples can be used as keys if they contain only strings, numbers, or tuples; if a tuple contains any mutable object either directly or indirectly, it cannot be used as a key. You can't use lists as keys, since lists can be modified in place using index assignments, slice assignments, or methods like :meth:`~list.append` and :meth:`~list.extend`." -msgstr "یک نوع دادهٔ مفید دیگر که به‌صورت داخلی در پایتون وجود دارد، *دیکشنری* است (به :ref:`typesmapping` مراجعه کنید). فرهنگ‌های لغت در برخی زبان‌های دیگر با نام «حافظه‌های انجمنی» یا «آرایه‌های انجمنی» شناخته می‌شوند. برخلاف دنباله‌ها که با یک بازه از اعداد اندیس‌‌گذاری می‌شوند، فرهنگ‌های لغت با *کلیدها* اندیس‌‌گذاری می‌شوند؛ کلیدها می‌توانند هر نوع تغییرناپذیری باشند؛ رشته‌ها و اعداد همیشه می‌توانند کلید باشند. تاپل‌ها نیز می‌توانند به‌عنوان کلید استفاده شوند، اگر فقط شامل رشته‌ها، اعداد یا تاپل‌ها باشند؛ اگر یک تاپل به‌صورت مستقیم یا غیرمستقیم شامل یک شیء تغییرپذیر باشد، نمی‌توان از آن به‌عنوان کلید استفاده کرد. نمی‌توانید از فهرست‌ها به‌عنوان کلید استفاده کنید، زیرا فهرست‌ها را می‌توان با استفاده از انتساب اندیسی، انتساب برش، یا متدهایی مانند :meth:`~list.append` و :meth:`~list.extend` در محل تغییر داد." +msgstr "یک نوع دادهٔ مفید دیگر که به‌صورت داخلی در پایتون وجود دارد، *دیکشنری* است (به :ref:`typesmapping` مراجعه کنید). دیکشنری‌ها در برخی زبان‌های دیگر با نام «حافظه‌های انجمنی» یا «آرایه‌های انجمنی» شناخته می‌شوند. برخلاف دنباله‌ها که با یک بازه از اعداد اندیس‌‌گذاری می‌شوند، دیکشنری‌ها با *کلیدها* اندیس‌‌گذاری می‌شوند؛ کلیدها می‌توانند هر نوع تغییرناپذیری باشند؛ رشته‌ها و اعداد همیشه می‌توانند کلید باشند. تاپل‌ها نیز می‌توانند به‌عنوان کلید استفاده شوند، اگر فقط شامل رشته‌ها، اعداد یا تاپل‌ها باشند؛ اگر یک تاپل به‌صورت مستقیم یا غیرمستقیم شامل یک شیء تغییرپذیر باشد، نمی‌توان از آن به‌عنوان کلید استفاده کرد. نمی‌توانید از فهرست‌ها به‌عنوان کلید استفاده کنید، زیرا فهرست‌ها را می‌توان با استفاده از انتساب اندیسی، انتساب برش، یا متدهایی مانند :meth:`~list.append` و :meth:`~list.extend` در محل تغییر داد." msgid "It is best to think of a dictionary as a set of *key: value* pairs, with the requirement that the keys are unique (within one dictionary). A pair of braces creates an empty dictionary: ``{}``. Placing a comma-separated list of key:value pairs within the braces adds initial key:value pairs to the dictionary; this is also the way dictionaries are written on output." -msgstr "بهترین روش این است که یک دیکشنری را به‌عنوان مجموعه‌ای از جفت‌های *کلید: مقدار* در نظر بگیرید، با این شرط که کلیدها (درون یک دیکشنری) یکتا باشند. یک جفت آکولاد یک دیکشنری خالی ایجاد می‌کند: ``{}``. قرار دادن یک فهرست جداشده با ویرگول از جفت‌های کلید:مقدار درون آکولاد، جفت‌های اولیهٔ کلید:مقدار را به دیکشنری اضافه می‌کند؛ این همان روشی است که فرهنگ‌های لغت در خروجی نوشته می‌شوند." +msgstr "بهترین روش این است که یک دیکشنری را به‌عنوان مجموعه‌ای از جفت‌های *کلید: مقدار* در نظر بگیرید، با این شرط که کلیدها (درون یک دیکشنری) یکتا باشند. یک جفت آکولاد یک دیکشنری خالی ایجاد می‌کند: ``{}``. قرار دادن یک فهرست جداشده با ویرگول از جفت‌های کلید:مقدار درون آکولاد، جفت‌های اولیهٔ کلید:مقدار را به دیکشنری اضافه می‌کند؛ این همان روشی است که دیکشنری‌ها در خروجی نوشته می‌شوند." msgid "The main operations on a dictionary are storing a value with some key and extracting the value given the key. It is also possible to delete a key:value pair with ``del``. If you store using a key that is already in use, the old value associated with that key is forgotten." msgstr "عملیات اصلی روی یک دیکشنری، ذخیره کردن یک مقدار با یک کلید مشخص و استخراج مقدار با استفاده از کلید است. همچنین امکان حذف یک جفت کلید:مقدار با استفاده از ``del`` وجود دارد. اگر مقداری را با کلیدی ذخیره کنید که از قبل استفاده شده است، مقدار قدیمی مرتبط با آن کلید فراموش می‌شود." @@ -699,7 +699,7 @@ msgstr "" "False" msgid "The :func:`dict` constructor builds dictionaries directly from sequences of key-value pairs::" -msgstr "سازندهٔ :func:`dict` فرهنگ‌های لغت را مستقیماً از دنباله‌هایی از جفت‌های کلید-مقدار ایجاد می‌کند::" +msgstr "سازندهٔ :func:`dict` دیکشنری‌ها را مستقیماً از دنباله‌هایی از جفت‌های کلید-مقدار ایجاد می‌کند::" msgid "" ">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" @@ -709,7 +709,7 @@ msgstr "" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" msgid "In addition, dict comprehensions can be used to create dictionaries from arbitrary key and value expressions::" -msgstr "علاوه بر این، درک‌های دیکشنری می‌توانند برای ایجاد فرهنگ‌های لغت از عبارت‌های دلخواه کلید و مقدار استفاده شوند::" +msgstr "علاوه بر این، درک‌های دیکشنری می‌توانند برای ایجاد دیکشنری‌ها از عبارت‌های دلخواه کلید و مقدار استفاده شوند::" msgid "" ">>> {x: x**2 for x in (2, 4, 6)}\n" @@ -732,7 +732,7 @@ msgid "Looping Techniques" msgstr "تکنیک‌های حلقه‌زنی" msgid "When looping through dictionaries, the key and corresponding value can be retrieved at the same time using the :meth:`~dict.items` method. ::" -msgstr "هنگام پیمایش روی فرهنگ‌های لغت، کلید و مقدار متناظر آن را می‌توان به‌طور هم‌زمان با استفاده از متد :meth:`~dict.items` دریافت کرد. ::" +msgstr "هنگام پیمایش روی دیکشنری‌ها، کلید و مقدار متناظر آن را می‌توان به‌طور هم‌زمان با استفاده از متد :meth:`~dict.items` دریافت کرد. ::" msgid "" ">>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}\n" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 25fb01e5a..9417739db 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -402,7 +402,7 @@ msgid "Reading and Writing Files" msgstr "خواندن و نوشتن فایلها" msgid ":func:`open` returns a :term:`file object`, and is most commonly used with two positional arguments and one keyword argument: ``open(filename, mode, encoding=None)``" -msgstr ":func:`open` یک :term:`file object` بازمی‌گرداند و معمولاً با دو آرگومان جایگاهی و یک آرگومان کلیدواژه‌ای استفاده می‌شود: ``open(filename, mode, encoding=None)``" +msgstr ":func:`open` یک :term:`شیء فایل ` بازمی‌گرداند و معمولاً با دو آرگومان جایگاهی و یک آرگومان کلیدواژه‌ای استفاده می‌شود: ``open(filename, mode, encoding=None)``" msgid ">>> f = open('workfile', 'w', encoding=\"utf-8\")" msgstr ">>> f = open('workfile', 'w', encoding=\"utf-8\")" @@ -411,7 +411,7 @@ msgid "The first argument is a string containing the filename. The second argum msgstr "آرگومان اول رشته‌ای است که نام فایل را در بر دارد. آرگومان دوم رشته‌ی دیگری است که شامل چند نویسه است و نحوه‌ی استفاده از فایل را توضیح می‌دهد. *mode* می‌تواند ``'r'`` باشد زمانی که فایل فقط خوانده می‌شود، ``'w'`` برای فقط نوشتن (یک فایل موجود با همان نام حذف خواهد شد)، و ``'a'`` فایل را برای افزودن (append) باز می‌کند؛ هر داده‌ای که در فایل نوشته شود به‌طور خودکار به انتهای آن اضافه می‌شود. ``'r+'`` فایل را هم برای خواندن و هم برای نوشتن باز می‌کند. آرگومان *mode* اختیاری است؛ اگر حذف شود، ``'r'`` در نظر گرفته می‌شود." msgid "Normally, files are opened in :dfn:`text mode`, that means, you read and write strings from and to the file, which are encoded in a specific *encoding*. If *encoding* is not specified, the default is platform dependent (see :func:`open`). Because UTF-8 is the modern de-facto standard, ``encoding=\"utf-8\"`` is recommended unless you know that you need to use a different encoding. Appending a ``'b'`` to the mode opens the file in :dfn:`binary mode`. Binary mode data is read and written as :class:`bytes` objects. You can not specify *encoding* when opening file in binary mode." -msgstr "به‌طور معمول، فایل‌ها در :dfn:`text mode` باز می‌شوند، یعنی شما رشته‌ها را از فایل می‌خوانید و در فایل می‌نویسید، که با یک *encoding* (رمزگذاری) خاص کدگذاری شده‌اند. اگر *encoding* مشخص نشود، مقدار پیش‌فرض به سیستم‌عامل بستگی دارد (به :func:`open` مراجعه کنید). از آنجا که UTF-8 استاندارد بالفعل مدرن است، ``encoding=\"utf-8\"`` توصیه می‌شود مگر اینکه بدانید باید از رمزگذاری دیگری استفاده کنید. اضافه کردن ``'b'`` به حالت، فایل را در :dfn:`binary mode` باز می‌کند. داده‌ها در حالت دودویی به صورت اشیاء :class:`bytes` خوانده و نوشته می‌شوند. هنگام باز کردن فایل در حالت دودویی نمی‌توانید *encoding* را مشخص کنید." +msgstr "به‌طور معمول، فایل‌ها در :dfn:`text mode` باز می‌شوند، یعنی شما رشته‌ها را از فایل می‌خوانید و در فایل می‌نویسید، که با یک *encoding* (کدگذاری) خاص کدگذاری شده‌اند. اگر *encoding* مشخص نشود، مقدار پیش‌فرض به سیستم‌عامل بستگی دارد (به :func:`open` مراجعه کنید). از آنجا که UTF-8 استاندارد بالفعل مدرن است، ``encoding=\"utf-8\"`` توصیه می‌شود مگر اینکه بدانید باید از کدگذاری دیگری استفاده کنید. اضافه کردن ``'b'`` به حالت، فایل را در :dfn:`binary mode` باز می‌کند. داده‌ها در حالت دودویی به صورت اشیاء :class:`bytes` خوانده و نوشته می‌شوند. هنگام باز کردن فایل در حالت دودویی نمی‌توانید *encoding* را مشخص کنید." msgid "In text mode, the default when reading is to convert platform-specific line endings (``\\n`` on Unix, ``\\r\\n`` on Windows) to just ``\\n``. When writing in text mode, the default is to convert occurrences of ``\\n`` back to platform-specific line endings. This behind-the-scenes modification to file data is fine for text files, but will corrupt binary data like that in :file:`JPEG` or :file:`EXE` files. Be very careful to use binary mode when reading and writing such files." msgstr "در حالت متنی، حالت پیش‌فرض هنگام خواندن، تبدیل پایان‌خط‌های ویژه‌ی هر سیستم‌عامل (``\\n`` در یونیکس، ``\\r\\n`` در ویندوز) به فقط ``\\n`` است. هنگام نوشتن در حالت متنی، حالت پیش‌فرض تبدیل ``\\n`` به پایان‌خط‌های ویژه‌ی هر سیستم‌عامل است. این تغییرات پشت‌صحنه در داده‌های فایل برای فایل‌های متنی خوب است، اما داده‌های دودویی مانند فایل‌های :file:`JPEG` یا :file:`EXE` را خراب می‌کند. هنگام خواندن و نوشتن چنین فایل‌هایی بسیار دقت کنید که از حالت دودویی استفاده کنید." @@ -601,19 +601,19 @@ msgstr "" "'[1, \"simple\", \"list\"]'" msgid "Another variant of the :func:`~json.dumps` function, called :func:`~json.dump`, simply serializes the object to a :term:`text file`. So if ``f`` is a :term:`text file` object opened for writing, we can do this::" -msgstr "گونه‌ی دیگری از تابع :func:`~json.dumps`، به نام :func:`~json.dump`، به‌سادگی شیء را در یک :term:`text file` سریال‌سازی می‌کند. بنابراین اگر ``f`` یک شیء :term:`text file` است که برای نوشتن باز شده، می‌توانیم این کار را انجام دهیم::" +msgstr "گونه‌ی دیگری از تابع :func:`~json.dumps`، به نام :func:`~json.dump`، به‌سادگی شیء را در یک :term:`فایل متنی ` سریال‌سازی می‌کند. بنابراین اگر ``f`` یک شیء :term:`فایل متنی ` است که برای نوشتن باز شده، می‌توانیم این کار را انجام دهیم::" msgid "json.dump(x, f)" msgstr "json.dump(x, f)" msgid "To decode the object again, if ``f`` is a :term:`binary file` or :term:`text file` object which has been opened for reading::" -msgstr "برای رمزگشایی مجدد شیء، اگر ``f`` یک شیء :term:`binary file` یا :term:`text file` است که برای خواندن باز شده است::" +msgstr "برای کدگشایی مجدد شیء، اگر ``f`` یک شیء :term:`فایل دودویی ` یا :term:`فایل متنی ` است که برای خواندن باز شده است::" msgid "x = json.load(f)" msgstr "x = json.load(f)" msgid "JSON files must be encoded in UTF-8. Use ``encoding=\"utf-8\"`` when opening JSON file as a :term:`text file` for both of reading and writing." -msgstr "فایل‌های JSON باید با UTF-8 کدگذاری شوند. هنگام باز کردن فایل JSON به‌عنوان یک :term:`text file` برای هر دو عمل خواندن و نوشتن، از ``encoding=\"utf-8\"`` استفاده کنید." +msgstr "فایل‌های JSON باید با UTF-8 کدگذاری شوند. هنگام باز کردن فایل JSON به‌عنوان یک :term:`فایل متنی ` برای هر دو عمل خواندن و نوشتن، از ``encoding=\"utf-8\"`` استفاده کنید." msgid "This simple serialization technique can handle lists and dictionaries, but serializing arbitrary class instances in JSON requires a bit of extra effort. The reference for the :mod:`json` module contains an explanation of this." msgstr "این تکنیک ساده‌ی سریال‌سازی می‌تواند فهرست‌ها و دیکشنری‌ها را مدیریت کند، اما سریال‌سازی نمونه‌های دلخواه از کلاس‌ها در JSON نیازمند کمی تلاش اضافی است. مرجع ماژول :mod:`json` شامل توضیحاتی در مورد این موضوع است." diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 07917700f..b34060e10 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -33,7 +33,7 @@ msgid "Tab Completion and History Editing" msgstr "تکمیل با کلید Tab و ویرایش تاریخچه" msgid "Completion of variable and module names is :ref:`automatically enabled ` at interpreter startup so that the :kbd:`Tab` key invokes the completion function; it looks at Python statement names, the current local variables, and the available module names. For dotted expressions such as ``string.a``, it will evaluate the expression up to the final ``'.'`` and then suggest completions from the attributes of the resulting object. Note that this may execute application-defined code if an object with a :meth:`~object.__getattr__` method is part of the expression. The default configuration also saves your history into a file named :file:`.python_history` in your user directory. The history will be available again during the next interactive interpreter session." -msgstr "تکمیل نام متغیرها و ماژول‌ها به‌طور :ref:`خودکار فعال می‌شود ` تا هنگام راه‌اندازی مفسر، به‌گونه‌ای که با فشردن کلید :kbd:`Tab`، تابع تکمیل فراخوانی شود. این تابع نام‌های دستورات پایتون، متغیرهای محلی فعلی و نام ماژول‌های موجود را بررسی می‌کند. برای عبارت‌های نقطه‌ای مانند ``string.a``، عبارت تا پیش از آخرین ``'.'`` ارزیابی می‌شود و سپس پیشنهادهایی بر اساس ویژگی‌های شیء حاصل ارائه می‌گردد. توجه داشته باشید که اگر شیئی با متد :meth:`~object.__getattr__` بخشی از عبارت باشد، ممکن است در این فرایند کدی که توسط برنامه تعریف شده است اجرا شود. پیکربندی پیش‌فرض همچنین تاریخچهٔ شما را در فایلی با نام :file:`.python_history` در پوشهٔ کاربری‌تان ذخیره می‌کند. این تاریخچه در نشست تعاملی بعدی مفسر دوباره در دسترس خواهد بود." +msgstr "تکمیل نام متغیرها و ماژول‌ها به‌طور :ref:`خودکار فعال می‌شود ` تا هنگام راه‌اندازی مفسر، به‌گونه‌ای که با فشردن کلید :kbd:`Tab`، تابع تکمیل فراخوانی شود. این تابع نام‌های دستورات پایتون، متغیرهای محلی فعلی و نام ماژول‌های موجود را بررسی می‌کند. برای عبارت‌های نقطه‌ای مانند ``string.a``، عبارت تا پیش از آخرین ``'.'`` ارزیابی می‌شود و سپس پیشنهادهایی بر اساس ویژگی‌های شیء حاصل ارائه می‌گردد. توجه داشته باشید که اگر شی‌ءای با متد :meth:`~object.__getattr__` بخشی از عبارت باشد، ممکن است در این فرایند کدی که توسط برنامه تعریف شده است اجرا شود. پیکربندی پیش‌فرض همچنین تاریخچهٔ شما را در فایلی با نام :file:`.python_history` در پوشهٔ کاربری‌تان ذخیره می‌کند. این تاریخچه در نشست تعاملی بعدی مفسر دوباره در دسترس خواهد بود." msgid "Alternatives to the Interactive Interpreter" msgstr "جایگزین‌هایی برای مفسر تعاملی" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 96b811443..f40923af2 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -84,7 +84,7 @@ msgid "The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, t msgstr "اعداد صحیح (برای مثال ``2``، ``4``، ``20``) دارای نوع :class:`int` هستند و اعدادی که بخش اعشاری دارند (برای مثال ``5.0``، ``1.6``) دارای نوع :class:`float` هستند. در ادامهٔ این آموزش دربارهٔ انواع عددی بیشتر خواهیم دید." msgid "Division (``/``) always returns a float. To do :term:`floor division` and get an integer result you can use the ``//`` operator; to calculate the remainder you can use ``%``::" -msgstr "تقسیم (``/``) همیشه یک مقدار اعشاری برمی‌گرداند. برای انجام :term:`floor division` و دریافت یک نتیجهٔ صحیح می‌توانید از عملگر ``//`` استفاده کنید؛ برای محاسبهٔ باقی‌مانده می‌توانید از ``%`` استفاده کنید::" +msgstr "تقسیم (``/``) همیشه یک مقدار اعشاری برمی‌گرداند. برای انجام :term:`تقسیم کف ` و دریافت یک نتیجهٔ صحیح می‌توانید از عملگر ``//`` استفاده کنید؛ برای محاسبهٔ باقی‌مانده می‌توانید از ``%`` استفاده کنید::" msgid "" ">>> 17 / 3 # classic division returns a float\n" @@ -205,7 +205,7 @@ msgstr "" "'spam eggs'\n" ">>> \"Paris rabbit got your back :)! Yay!\" # علامت نقل‌قول دوتایی\n" "'Paris rabbit got your back :)! Yay!'\n" -">>> '1975' # رقم‌ها و عددهایی که داخل علامت نقل‌وقول قرار می‌گیرند نیز رشته هستند\n" +">>> '1975' # رقم‌ها و عددهایی که داخل علامت نقل‌قول قرار می‌گیرند نیز رشته هستند\n" "'1975'" msgid "To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. Alternatively, we can use the other type of quotation marks::" @@ -225,7 +225,7 @@ msgid "" msgstr "" ">>> 'doesn\\'t' # برای خنثی کردن علامت نقل‌قول تکی، از \\' استفاده کنید...\n" "\"doesn't\"\n" -">>> \"doesn't\" # ...یا به‌جای آن از علامت نقل‌وقول دوتایی استفاده کنید\n" +">>> \"doesn't\" # ...یا به‌جای آن از علامت نقل‌قول دوتایی استفاده کنید\n" "\"doesn't\"\n" ">>> '\"Yes,\" they said.'\n" "'\"Yes,\" they said.'\n" @@ -265,7 +265,7 @@ msgstr "" ">>> print('C:\\this\\name') # در اینجا \\t نشان‌دهندهٔ تب و \\n نشان‌دهندهٔ خط جدید است\n" "C: his\n" "ame\n" -">>> print(r'C:\\this\\name') # به حرف r قبل از علامت نقل‌وقول توجه کنید\n" +">>> print(r'C:\\this\\name') # به حرف r قبل از علامت نقل‌قول توجه کنید\n" "C:\\this\\name" msgid "There is one subtle aspect to raw strings: a raw string may not end in an odd number of ``\\`` characters; see :ref:`the FAQ entry ` for more information and workarounds." @@ -505,7 +505,7 @@ msgstr "" "''" msgid "Python strings cannot be changed --- they are :term:`immutable`. Therefore, assigning to an indexed position in the string results in an error::" -msgstr "رشته‌های پایتون قابل تغییر نیستند --- آن‌ها :term:`immutable` هستند. بنابراین، اختصاص دادن مقدار به یک موقعیت اندیس‌‌گذاری‌شده در رشته باعث ایجاد خطا می‌شود::" +msgstr "رشته‌های پایتون قابل تغییر نیستند --- آن‌ها :term:`تغییرناپذیر ` هستند. بنابراین، اختصاص دادن مقدار به یک موقعیت اندیس‌‌گذاری‌شده در رشته باعث ایجاد خطا می‌شود::" msgid "" ">>> word[0] = 'J'\n" @@ -598,7 +598,7 @@ msgstr "" "[1, 4, 9, 16, 25]" msgid "Like strings (and all other built-in :term:`sequence` types), lists can be indexed and sliced::" -msgstr "مانند رشته‌ها (و تمام نوع‌های داخلی دیگر :term:`sequence`)، فهرست‌ها را می‌توان اندیس‌‌گذاری و برش داد::" +msgstr "مانند رشته‌ها (و تمام نوع‌های داخلی دیگر :term:`دنباله `)، فهرست‌ها را می‌توان اندیس‌‌گذاری و برش داد::" msgid "" ">>> squares[0] # indexing returns the item\n" @@ -626,7 +626,7 @@ msgstr "" "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" msgid "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` type, i.e. it is possible to change their content::" -msgstr "برخلاف رشته‌ها که :term:`immutable` هستند، فهرست‌ها یک نوع :term:`mutable` هستند؛ یعنی امکان تغییر محتوای آن‌ها وجود دارد::" +msgstr "برخلاف رشته‌ها که :term:`تغییرناپذیر ` هستند، فهرست‌ها یک نوع :term:`تغییرپذیر ` هستند؛ یعنی امکان تغییر محتوای آن‌ها وجود دارد::" msgid "" ">>> cubes = [1, 8, 27, 65, 125] # something's wrong here\n" diff --git a/tutorial/modules.po b/tutorial/modules.po index cb39b0b6c..b717357ed 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -655,7 +655,7 @@ msgid "Packages in Multiple Directories" msgstr "بسته‌ها در چندین پوشه" msgid "Packages support one more special attribute, :attr:`~module.__path__`. This is initialized to be a :term:`sequence` of strings containing the name of the directory holding the package's :file:`__init__.py` before the code in that file is executed. This variable can be modified; doing so affects future searches for modules and subpackages contained in the package." -msgstr "بسته‌ها یک ویژگی ویژهٔ دیگر را نیز پشتیبانی می‌کنند: :attr:`~module.__path__`. این ویژگی مقداردهی اولیه می‌شود تا پیش از اجرای کد موجود در آن فایل، یک :term:`sequence` از رشته‌ها باشد که نام پوشهٔ شامل :file:`__init__.py` بسته را در خود دارد. این متغیر قابل تغییر است؛ تغییر آن بر جست‌وجوهای آینده برای ماژول‌ها و زیر‌بسته‌های موجود در بسته تأثیر می‌گذارد." +msgstr "بسته‌ها یک ویژگی ویژهٔ دیگر را نیز پشتیبانی می‌کنند: :attr:`~module.__path__`. این ویژگی مقداردهی اولیه می‌شود تا پیش از اجرای کد موجود در آن فایل، یک :term:`دنباله ` از رشته‌ها باشد که نام پوشهٔ شامل :file:`__init__.py` بسته را در خود دارد. این متغیر قابل تغییر است؛ تغییر آن بر جست‌وجوهای آینده برای ماژول‌ها و زیر‌بسته‌های موجود در بسته تأثیر می‌گذارد." msgid "While this feature is not often needed, it can be used to extend the set of modules found in a package." msgstr "اگرچه این قابلیت معمولاً موردنیاز نیست، می‌توان از آن برای گسترش مجموعهٔ ماژول‌هایی که در یک بسته پیدا می‌شوند استفاده کرد." diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 041db6064..dec35512b 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -471,7 +471,7 @@ msgid "The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementi msgstr "ماژول‌های :mod:`xmlrpc.client` و :mod:`xmlrpc.server` پیاده‌سازی فراخوانی رویه‌های راه‌دور (Remote Procedure Calls یا RPC) را به کاری تقریباً ساده و بدیهی تبدیل می‌کنند. با وجود نام این ماژول‌ها، نیازی به دانش یا کار مستقیم با XML نیست." msgid "The :mod:`email` package is a library for managing email messages, including MIME and other :rfc:`5322`-based message documents. Unlike :mod:`smtplib` and :mod:`poplib` which actually send and receive messages, the email package has a complete toolset for building or decoding complex message structures (including attachments) and for implementing internet encoding and header protocols." -msgstr "بستهٔ :mod:`email` کتابخانه‌ای برای مدیریت پیام‌های ایمیل است که از MIME و سایر قالب‌های پیام مبتنی بر :rfc:`5322` نیز پشتیبانی می‌کند. برخلاف ماژول‌های :mod:`smtplib` و :mod:`poplib` که وظیفهٔ ارسال و دریافت پیام‌ها را بر عهده دارند، بستهٔ `email` مجموعه‌ای کامل از ابزارها را برای ساخت یا رمزگشایی ساختارهای پیچیدهٔ پیام (از جمله پیوست‌ها) و همچنین پیاده‌سازی پروتکل‌های کدگذاری اینترنتی و سرآیندهای پیام فراهم می‌کند." +msgstr "بستهٔ :mod:`email` کتابخانه‌ای برای مدیریت پیام‌های ایمیل است که از MIME و سایر قالب‌های پیام مبتنی بر :rfc:`5322` نیز پشتیبانی می‌کند. برخلاف ماژول‌های :mod:`smtplib` و :mod:`poplib` که وظیفهٔ ارسال و دریافت پیام‌ها را بر عهده دارند، بستهٔ `email` مجموعه‌ای کامل از ابزارها را برای ساخت یا کدگشایی ساختارهای پیچیدهٔ پیام (از جمله پیوست‌ها) و همچنین پیاده‌سازی پروتکل‌های کدگذاری اینترنتی و سرآیندهای پیام فراهم می‌کند." msgid "The :mod:`json` package provides robust support for parsing this popular data interchange format. The :mod:`csv` module supports direct reading and writing of files in Comma-Separated Value format, commonly supported by databases and spreadsheets. XML processing is supported by the :mod:`xml.etree.ElementTree`, :mod:`xml.dom` and :mod:`xml.sax` packages. Together, these modules and packages greatly simplify data interchange between Python applications and other tools." msgstr "بستهٔ :mod:`json` از تجزیه و پردازش این قالب پرکاربرد تبادل داده به‌خوبی پشتیبانی می‌کند. ماژول :mod:`csv` امکان خواندن و نوشتن مستقیم فایل‌ها در قالب مقادیر جداشده با ویرگول (CSV) را فراهم می‌کند؛ قالبی که معمولاً توسط پایگاه‌های داده و نرم‌افزارهای صفحه‌گسترده پشتیبانی می‌شود. پردازش XML نیز توسط بسته‌های :mod:`xml.etree.ElementTree`، :mod:`xml.dom` و :mod:`xml.sax` پشتیبانی می‌شود. در کنار هم، این ماژول‌ها و بسته‌ها تبادل داده میان برنامه‌های پایتون و سایر ابزارها را تا حد زیادی ساده می‌کنند." diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index fd5b62ba4..31d3b8482 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -353,7 +353,7 @@ msgid "Weak references" msgstr "ارجاع‌های ضعیف" msgid "Python does automatic memory management (reference counting for most objects and :term:`garbage collection` to eliminate cycles). The memory is freed shortly after the last reference to it has been eliminated." -msgstr "پایتون مدیریت حافظه را به‌صورت خودکار انجام می‌دهد (برای بیشتر اشیا با استفاده از شمارش ارجاع‌ها و :term:`garbage collection` (جمع‌آوری زباله) برای حذف چرخه‌ها). حافظه اندکی پس از حذف آخرین ارجاع به یک شی آزاد می‌شود." +msgstr "پایتون مدیریت حافظه را به‌صورت خودکار انجام می‌دهد (برای بیشتر اشیا با استفاده از شمارش ارجاع‌ها و :term:`زباله‌روبی ` (جمع‌آوری زباله) برای حذف چرخه‌ها). حافظه اندکی پس از حذف آخرین ارجاع به یک شی آزاد می‌شود." msgid "This approach works fine for most applications but occasionally there is a need to track objects only as long as they are being used by something else. Unfortunately, just tracking them creates a reference that makes them permanent. The :mod:`weakref` module provides tools for tracking objects without creating a reference. When the object is no longer needed, it is automatically removed from a weakref table and a callback is triggered for weakref objects. Typical applications include caching objects that are expensive to create::" msgstr "این روش برای بیشتر برنامه‌ها مناسب است، اما گاهی لازم است اشیا فقط تا زمانی دنبال شوند که توسط چیز دیگری در حال استفاده باشند. مشکل اینجاست که صرفِ دنبال کردن یک شی، خود یک ارجاع ایجاد می‌کند و باعث می‌شود آن شی هرگز آزاد نشود. ماژول :mod:`weakref` ابزارهایی برای دنبال کردن اشیا بدون ایجاد ارجاع فراهم می‌کند. هنگامی که دیگر نیازی به یک شی نباشد، آن شی به‌طور خودکار از جدول weakref حذف می‌شود و یک callback برای اشیای weakref فراخوانی می‌شود. یکی از کاربردهای رایج این قابلیت، ذخیرهٔ موقت (cache) اشیایی است که ایجاد آن‌ها پرهزینه است::"