diff --git a/.github/workflows/update-lint-and-build.yml b/.github/workflows/update-lint-and-build.yml index e2acea46..6208acff 100644 --- a/.github/workflows/update-lint-and-build.yml +++ b/.github/workflows/update-lint-and-build.yml @@ -20,8 +20,6 @@ jobs: python-version: 3 - run: pip install sphinx-lint - uses: actions/checkout@master - with: - ref: 3.13 - uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 - run: sphinx-lint @@ -41,12 +39,11 @@ jobs: working-directory: ./Doc - uses: actions/checkout@master with: - ref: 3.13 path: Doc/locales/fa/LC_MESSAGES - run: git pull working-directory: ./Doc/locales/fa/LC_MESSAGES - uses: sphinx-doc/github-problem-matcher@v1.1 - - run: make -e SPHINXOPTS="--color -D language='fa' -W --keep-going" html + - run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=True -W --keep-going" html working-directory: ./Doc - uses: actions/upload-artifact@master if: success() || failure() diff --git a/bugs.po b/bugs.po index ba92541a..5dba6915 100644 --- a/bugs.po +++ b/bugs.po @@ -17,125 +17,284 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: bugs.rst:5 +#, fuzzy msgid "Dealing with Bugs" -msgstr "" +msgstr "مقابله با اشکالات" #: bugs.rst:7 -msgid "Python is a mature programming language which has established a reputation for stability. In order to maintain this reputation, the developers would like to know of any deficiencies you find in Python." +#, fuzzy +msgid "" +"Python is a mature programming language which has established a reputation " +"for stability. In order to maintain this reputation, the developers would " +"like to know of any deficiencies you find in Python." msgstr "" +"پایتون یک زبان برنامه نویسی بالغ است که به دلیل ثبات شهرت دارد. برای حفظ " +"این شهرت، توسعه‌دهندگان مایلند هر گونه نقصی را که در پایتون پیدا می‌کنید " +"بدانند." #: bugs.rst:11 -msgid "It can be sometimes faster to fix bugs yourself and contribute patches to Python as it streamlines the process and involves less people. Learn how to :ref:`contribute `." +#, fuzzy +msgid "" +"It can be sometimes faster to fix bugs yourself and contribute patches to " +"Python as it streamlines the process and involves less people. Learn how to " +":ref:`contribute `." msgstr "" +"گاهی اوقات ممکن است سریع‌تر باشد که خودتان باگ‌ها را برطرف کنید و وصله‌هایی " +"را به پایتون اضافه کنید زیرا فرآیند را ساده می‌کند و افراد کمتری را درگیر " +"می‌کند. آموزش :ref:`contribute `." #: bugs.rst:16 +#, fuzzy msgid "Documentation bugs" -msgstr "" +msgstr "اشکالات مستندات" #: bugs.rst:18 -msgid "If you find a bug in this documentation or would like to propose an improvement, please submit a bug report on the :ref:`tracker `. If you have a suggestion on how to fix it, include that as well." +#, fuzzy +msgid "" +"If you find a bug in this documentation or would like to propose an " +"improvement, please submit a bug report on the :ref:`tracker `. If you have a suggestion on how to fix it, include that as well." msgstr "" +"اگر اشکالی در این مستندات پیدا کردید یا می‌خواهید بهبودی را پیشنهاد دهید، " +"لطفاً یک گزارش اشکال در :ref:`tracker ` ارسال کنید. اگر " +"پیشنهادی در مورد چگونگی رفع آن دارید، آن را نیز درج کنید." #: bugs.rst:22 -msgid "You can also open a discussion item on our `Documentation Discourse forum `_." +#, fuzzy +msgid "" +"You can also open a discussion item on our `Documentation Discourse forum " +"`_." msgstr "" +"همچنین می توانید یک مورد بحث را در `Documentation Discourse forum " +"`_ ما باز کنید." #: bugs.rst:25 -msgid "If you find a bug in the theme (HTML / CSS / JavaScript) of the documentation, please submit a bug report on the `python-doc-theme bug tracker `_." +#, fuzzy +msgid "" +"If you find a bug in the theme (HTML / CSS / JavaScript) of the " +"documentation, please submit a bug report on the `python-doc-theme bug " +"tracker `_." msgstr "" +"اگر اشکالی در موضوع (HTML / CSS / جاوا اسکریپت) اسناد پیدا کردید، لطفاً یک " +"گزارش اشکال در `python-doc-theme bug tracker " +"`_ ارسال کنید." #: bugs.rst:29 -msgid "If you're short on time, you can also email documentation bug reports to docs@python.org (behavioral bugs can be sent to python-list@python.org). 'docs@' is a mailing list run by volunteers; your request will be noticed, though it may take a while to be processed." -msgstr "" +#, fuzzy +msgid "" +"If you're short on time, you can also email documentation bug reports to " +"docs@python.org (behavioral bugs can be sent to python-list@python.org). " +"'docs@' is a mailing list run by volunteers; your request will be noticed, " +"though it may take a while to be processed." +msgstr "" +"اگر وقتتان کم است، می‌توانید گزارش‌های اشکال مستندات را به docs@python.org " +"ایمیل کنید (اشکالات رفتاری را می‌توان به python-list@python.org ارسال کرد). " +"'docs@' یک لیست پستی است که توسط داوطلبان اداره می شود. درخواست شما مورد " +"توجه قرار خواهد گرفت، اگرچه ممکن است مدتی طول بکشد تا پردازش شود." #: bugs.rst:36 +#, fuzzy msgid "`Documentation bugs`_" -msgstr "" +msgstr "`Documentation bugs`_" #: bugs.rst:37 -msgid "A list of documentation bugs that have been submitted to the Python issue tracker." -msgstr "" +#, fuzzy +msgid "" +"A list of documentation bugs that have been submitted to the Python issue " +"tracker." +msgstr "لیستی از اشکالات اسنادی که به ردیاب مشکل پایتون ارسال شده است." #: bugs.rst:39 +#, fuzzy msgid "`Issue Tracking `_" -msgstr "" +msgstr "`Issue Tracking `_" #: bugs.rst:40 -msgid "Overview of the process involved in reporting an improvement on the tracker." -msgstr "" +#, fuzzy +msgid "" +"Overview of the process involved in reporting an improvement on the tracker." +msgstr "مروری بر فرآیند مربوط به گزارش بهبود در ردیاب." #: bugs.rst:42 -msgid "`Helping with Documentation `_" +#, fuzzy +msgid "" +"`Helping with Documentation " +"`_" msgstr "" +"`Helping with Documentation " +"`_" #: bugs.rst:43 -msgid "Comprehensive guide for individuals that are interested in contributing to Python documentation." +#, fuzzy +msgid "" +"Comprehensive guide for individuals that are interested in contributing to " +"Python documentation." msgstr "" +"راهنمای جامع برای افرادی که علاقه مند به مشارکت در اسناد پایتون هستند." #: bugs.rst:45 -msgid "`Documentation Translations `_" +#, fuzzy +msgid "" +"`Documentation Translations " +"`_" msgstr "" +"`Documentation Translations " +"`_" #: bugs.rst:46 -msgid "A list of GitHub pages for documentation translation and their primary contacts." -msgstr "" +#, fuzzy +msgid "" +"A list of GitHub pages for documentation translation and their primary " +"contacts." +msgstr "فهرستی از صفحات GitHub برای ترجمه اسناد و مخاطبین اصلی آنها." #: bugs.rst:52 +#, fuzzy msgid "Using the Python issue tracker" -msgstr "" +msgstr "با استفاده از ردیاب مسئله پایتون" #: bugs.rst:54 -msgid "Issue reports for Python itself should be submitted via the GitHub issues tracker (https://github.com/python/cpython/issues). The GitHub issues tracker offers a web form which allows pertinent information to be entered and submitted to the developers." -msgstr "" +#, fuzzy +msgid "" +"Issue reports for Python itself should be submitted via the GitHub issues " +"tracker (https://github.com/python/cpython/issues). The GitHub issues " +"tracker offers a web form which allows pertinent information to be entered " +"and submitted to the developers." +msgstr "" +"گزارش های مشکلات خود پایتون باید از طریق ردیاب مسائل GitHub " +"(https://github.com/python/cpython/issues) ارسال شود. ردیاب مسائل GitHub یک " +"فرم وب ارائه می دهد که به توسعه دهندگان اجازه می دهد اطلاعات مربوطه را وارد " +"کرده و ارسال کنید." #: bugs.rst:59 -msgid "The first step in filing a report is to determine whether the problem has already been reported. The advantage in doing so, aside from saving the developers' time, is that you learn what has been done to fix it; it may be that the problem has already been fixed for the next release, or additional information is needed (in which case you are welcome to provide it if you can!). To do this, search the tracker using the search box at the top of the page." -msgstr "" +#, fuzzy +msgid "" +"The first step in filing a report is to determine whether the problem has " +"already been reported. The advantage in doing so, aside from saving the " +"developers' time, is that you learn what has been done to fix it; it may be " +"that the problem has already been fixed for the next release, or additional " +"information is needed (in which case you are welcome to provide it if you " +"can!). To do this, search the tracker using the search box at the top of the" +" page." +msgstr "" +"اولین قدم در ارائه گزارش این است که مشخص شود آیا مشکل قبلا گزارش شده است یا " +"خیر. مزیت انجام این کار، جدای از صرفه جویی در وقت توسعه دهندگان، این است که" +" یاد می گیرید برای رفع آن چه کاری انجام شده است. ممکن است مشکل قبلاً برای " +"نسخه بعدی برطرف شده باشد یا اطلاعات بیشتری مورد نیاز باشد (در این صورت می " +"توانید در صورت امکان آن را ارائه دهید!). برای انجام این کار، ردیاب را با " +"استفاده از کادر جستجو در بالای صفحه جستجو کنید." #: bugs.rst:66 -msgid "If the problem you're reporting is not already in the list, log in to GitHub. If you don't already have a GitHub account, create a new account using the \"Sign up\" link. It is not possible to submit a bug report anonymously." -msgstr "" +#, fuzzy +msgid "" +"If the problem you're reporting is not already in the list, log in to " +"GitHub. If you don't already have a GitHub account, create a new account " +"using the \"Sign up\" link. It is not possible to submit a bug report " +"anonymously." +msgstr "" +"اگر مشکلی که گزارش می‌کنید قبلاً در لیست نیست، وارد GitHub شوید. اگر قبلاً " +"یک حساب GitHub ندارید، با استفاده از پیوند \"ثبت نام\" یک حساب کاربری جدید " +"ایجاد کنید. امکان ارسال گزارش اشکال به صورت ناشناس وجود ندارد." #: bugs.rst:71 -msgid "Being now logged in, you can submit an issue. Click on the \"New issue\" button in the top bar to report a new issue." +#, fuzzy +msgid "" +"Being now logged in, you can submit an issue. Click on the \"New issue\" " +"button in the top bar to report a new issue." msgstr "" +"اکنون که وارد سیستم شده اید، می توانید مشکلی را ارسال کنید. برای گزارش یک " +"مشکل جدید، روی دکمه \"نسخه جدید\" در نوار بالا کلیک کنید." #: bugs.rst:74 +#, fuzzy msgid "The submission form has two fields, \"Title\" and \"Comment\"." -msgstr "" +msgstr "فرم ارسال دارای دو فیلد «عنوان» و «نظر» است." #: bugs.rst:76 -msgid "For the \"Title\" field, enter a *very* short description of the problem; fewer than ten words is good." +#, fuzzy +msgid "" +"For the \"Title\" field, enter a *very* short description of the problem; " +"fewer than ten words is good." msgstr "" +"برای فیلد \"عنوان\", یک توضیح کوتاه *very* از مشکل وارد کنید. کمتر از ده " +"کلمه خوب است" #: bugs.rst:79 -msgid "In the \"Comment\" field, describe the problem in detail, including what you expected to happen and what did happen. Be sure to include whether any extension modules were involved, and what hardware and software platform you were using (including version information as appropriate)." -msgstr "" +#, fuzzy +msgid "" +"In the \"Comment\" field, describe the problem in detail, including what you" +" expected to happen and what did happen. Be sure to include whether any " +"extension modules were involved, and what hardware and software platform you" +" were using (including version information as appropriate)." +msgstr "" +"در قسمت \"نظر\", مشکل را با جزئیات شرح دهید، از جمله آنچه که انتظار داشتید " +"اتفاق بیفتد و چه اتفاقی افتاده است. مطمئن شوید که آیا ماژول های برنامه " +"افزودنی درگیر هستند یا خیر، و از چه پلتفرم سخت افزاری و نرم افزاری استفاده " +"می کردید (از جمله اطلاعات نسخه در صورت لزوم)." #: bugs.rst:84 -msgid "Each issue report will be reviewed by a developer who will determine what needs to be done to correct the problem. You will receive an update each time an action is taken on the issue." +#, fuzzy +msgid "" +"Each issue report will be reviewed by a developer who will determine what " +"needs to be done to correct the problem. You will receive an update each " +"time an action is taken on the issue." msgstr "" +"هر گزارش مشکل توسط یک توسعه دهنده بررسی می شود که تعیین می کند برای اصلاح " +"مشکل چه کاری باید انجام شود. هر بار که اقدامی در مورد این مشکل انجام شود، " +"به‌روزرسانی دریافت خواهید کرد." #: bugs.rst:91 -msgid "`How to Report Bugs Effectively `_" +#, fuzzy +msgid "" +"`How to Report Bugs Effectively " +"`_" msgstr "" +"`How to Report Bugs Effectively " +"`_" #: bugs.rst:92 -msgid "Article which goes into some detail about how to create a useful bug report. This describes what kind of information is useful and why it is useful." +#, fuzzy +msgid "" +"Article which goes into some detail about how to create a useful bug report." +" This describes what kind of information is useful and why it is useful." msgstr "" +"مقاله ای که به جزئیات در مورد نحوه ایجاد یک گزارش اشکال مفید می پردازد. این " +"توضیح می دهد که چه نوع اطلاعات مفید است و چرا مفید است." #: bugs.rst:95 -msgid "`Bug Writing Guidelines `_" +#, fuzzy +msgid "" +"`Bug Writing Guidelines `_" msgstr "" +"`Bug Writing Guidelines `_" #: bugs.rst:96 -msgid "Information about writing a good bug report. Some of this is specific to the Mozilla project, but describes general good practices." +#, fuzzy +msgid "" +"Information about writing a good bug report. Some of this is specific to " +"the Mozilla project, but describes general good practices." msgstr "" +"اطلاعاتی در مورد نوشتن یک گزارش اشکال خوب. برخی از این ها مختص پروژه موزیلا" +" است، اما شیوه های خوب کلی را توصیف می کند." #: bugs.rst:102 +#, fuzzy msgid "Getting started contributing to Python yourself" -msgstr "" +msgstr "شروع به مشارکت در پایتون خودتان" #: bugs.rst:104 -msgid "Beyond just reporting bugs that you find, you are also welcome to submit patches to fix them. You can find more information on how to get started patching Python in the `Python Developer's Guide`_. If you have questions, the `core-mentorship mailing list`_ is a friendly place to get answers to any and all questions pertaining to the process of fixing issues in Python." -msgstr "" +#, fuzzy +msgid "" +"Beyond just reporting bugs that you find, you are also welcome to submit " +"patches to fix them. You can find more information on how to get started " +"patching Python in the `Python Developer's Guide`_. If you have questions, " +"the `core-mentorship mailing list`_ is a friendly place to get answers to " +"any and all questions pertaining to the process of fixing issues in Python." +msgstr "" +"علاوه بر گزارش اشکالاتی که پیدا می‌کنید، می‌توانید وصله‌هایی را نیز برای رفع" +" آنها ارسال کنید. می توانید اطلاعات بیشتری در مورد نحوه شروع وصله پایتون در" +" `Python Developer's Guide`_ بیابید. اگر سؤالی دارید، `core-mentorship " +"mailing list`_ مکانی دوستانه برای دریافت پاسخ به همه سؤالات مربوط به فرآیند " +"رفع مشکلات در پایتون است." diff --git a/library/functions.po b/library/functions.po index e91e3d7a..9aaef6af 100644 --- a/library/functions.po +++ b/library/functions.po @@ -16,641 +16,1130 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: library/functions.rst:5 -#: library/functions.rst:11 +#: library/functions.rst:5 library/functions.rst:11 +#, fuzzy msgid "Built-in Functions" -msgstr "" +msgstr "توابع داخلی" #: library/functions.rst:7 -msgid "The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order." +#, fuzzy +msgid "" +"The Python interpreter has a number of functions and types built into it " +"that are always available. They are listed here in alphabetical order." msgstr "" +"مفسر پایتون تعدادی توابع و انواع دارد که همیشه در دسترس هستند. آنها در " +"اینجا به ترتیب حروف الفبا فهرست شده اند." #: library/functions.rst:0 +#, fuzzy msgid "**A**" -msgstr "" +msgstr "**A**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`abs`" -msgstr "" +msgstr ":func:`abs`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`aiter`" -msgstr "" +msgstr ":func:`aiter`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`all`" -msgstr "" +msgstr ":func:`all`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`anext`" -msgstr "" +msgstr ":func:`anext`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`any`" -msgstr "" +msgstr ":func:`any`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`ascii`" -msgstr "" +msgstr ":func:`ascii`" #: library/functions.rst:0 +#, fuzzy msgid "**B**" -msgstr "" +msgstr "**B**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`bin`" -msgstr "" +msgstr ":func:`bin`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`bool`" -msgstr "" +msgstr ":func:`bool`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`breakpoint`" -msgstr "" +msgstr ":func:`breakpoint`" #: library/functions.rst:0 +#, fuzzy msgid "|func-bytearray|_" -msgstr "" +msgstr "|func-bytearray|_" #: library/functions.rst:0 +#, fuzzy msgid "|func-bytes|_" -msgstr "" +msgstr "|func-bytes|_" #: library/functions.rst:0 +#, fuzzy msgid "**C**" -msgstr "" +msgstr "**C**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`callable`" -msgstr "" +msgstr ":func:`callable`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`chr`" -msgstr "" +msgstr ":func:`chr`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`classmethod`" -msgstr "" +msgstr ":func:`classmethod`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`compile`" -msgstr "" +msgstr ":func:`compile`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`complex`" -msgstr "" +msgstr ":func:`complex`" #: library/functions.rst:0 +#, fuzzy msgid "**D**" -msgstr "" +msgstr "**D**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`delattr`" -msgstr "" +msgstr ":func:`delattr`" #: library/functions.rst:0 +#, fuzzy msgid "|func-dict|_" -msgstr "" +msgstr "|func-dict|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`dir`" -msgstr "" +msgstr ":func:`dir`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`divmod`" -msgstr "" +msgstr ":func:`divmod`" #: library/functions.rst:0 +#, fuzzy msgid "**E**" -msgstr "" +msgstr "**E**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`enumerate`" -msgstr "" +msgstr ":func:`enumerate`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`eval`" -msgstr "" +msgstr ":func:`eval`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`exec`" -msgstr "" +msgstr ":func:`exec`" #: library/functions.rst:0 +#, fuzzy msgid "**F**" -msgstr "" +msgstr "**F**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`filter`" -msgstr "" +msgstr ":func:`filter`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`float`" -msgstr "" +msgstr ":func:`float`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`format`" -msgstr "" +msgstr ":func:`format`" #: library/functions.rst:0 +#, fuzzy msgid "|func-frozenset|_" -msgstr "" +msgstr "|func-frozenset|_" #: library/functions.rst:0 +#, fuzzy msgid "**G**" -msgstr "" +msgstr "**G**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`getattr`" -msgstr "" +msgstr ":func:`getattr`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`globals`" -msgstr "" +msgstr ":func:`globals`" #: library/functions.rst:0 +#, fuzzy msgid "**H**" -msgstr "" +msgstr "**H**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`hasattr`" -msgstr "" +msgstr ":func:`hasattr`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`hash`" -msgstr "" +msgstr ":func:`hash`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`help`" -msgstr "" +msgstr ":func:`help`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`hex`" -msgstr "" +msgstr ":func:`hex`" #: library/functions.rst:0 +#, fuzzy msgid "**I**" -msgstr "" +msgstr "**I**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`id`" -msgstr "" +msgstr ":func:`id`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`input`" -msgstr "" +msgstr ":func:`input`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`int`" -msgstr "" +msgstr ":func:`int`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`isinstance`" -msgstr "" +msgstr ":func:`isinstance`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`issubclass`" -msgstr "" +msgstr ":func:`issubclass`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`iter`" -msgstr "" +msgstr ":func:`iter`" #: library/functions.rst:0 +#, fuzzy msgid "**L**" -msgstr "" +msgstr "**L**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`len`" -msgstr "" +msgstr ":func:`len`" #: library/functions.rst:0 +#, fuzzy msgid "|func-list|_" -msgstr "" +msgstr "|func-list|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`locals`" -msgstr "" +msgstr ":func:`locals`" #: library/functions.rst:0 +#, fuzzy msgid "**M**" -msgstr "" +msgstr "**M**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`map`" -msgstr "" +msgstr ":func:`map`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`max`" -msgstr "" +msgstr ":func:`max`" #: library/functions.rst:0 +#, fuzzy msgid "|func-memoryview|_" -msgstr "" +msgstr "|func-memoryview|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`min`" -msgstr "" +msgstr ":func:`min`" #: library/functions.rst:0 +#, fuzzy msgid "**N**" -msgstr "" +msgstr "**N**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`next`" -msgstr "" +msgstr ":func:`next`" #: library/functions.rst:0 +#, fuzzy msgid "**O**" -msgstr "" +msgstr "**O**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`object`" -msgstr "" +msgstr ":func:`object`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`oct`" -msgstr "" +msgstr ":func:`oct`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`open`" -msgstr "" +msgstr ":func:`open`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`ord`" -msgstr "" +msgstr ":func:`ord`" #: library/functions.rst:0 +#, fuzzy msgid "**P**" -msgstr "" +msgstr "**P**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`pow`" -msgstr "" +msgstr ":func:`pow`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`print`" -msgstr "" +msgstr ":func:`print`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`property`" -msgstr "" +msgstr ":func:`property`" #: library/functions.rst:0 +#, fuzzy msgid "**R**" -msgstr "" +msgstr "**R**" #: library/functions.rst:0 +#, fuzzy msgid "|func-range|_" -msgstr "" +msgstr "|func-range|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`repr`" -msgstr "" +msgstr ":func:`repr`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`reversed`" -msgstr "" +msgstr ":func:`reversed`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`round`" -msgstr "" +msgstr ":func:`round`" #: library/functions.rst:0 +#, fuzzy msgid "**S**" -msgstr "" +msgstr "**S**" #: library/functions.rst:0 +#, fuzzy msgid "|func-set|_" -msgstr "" +msgstr "|func-set|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`setattr`" -msgstr "" +msgstr ":func:`setattr`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`slice`" -msgstr "" +msgstr ":func:`slice`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`sorted`" -msgstr "" +msgstr ":func:`sorted`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`staticmethod`" -msgstr "" +msgstr ":func:`staticmethod`" #: library/functions.rst:0 +#, fuzzy msgid "|func-str|_" -msgstr "" +msgstr "|func-str|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`sum`" -msgstr "" +msgstr ":func:`sum`" #: library/functions.rst:0 +#, fuzzy msgid ":func:`super`" -msgstr "" +msgstr ":func:`super`" #: library/functions.rst:0 +#, fuzzy msgid "**T**" -msgstr "" +msgstr "**T**" #: library/functions.rst:0 +#, fuzzy msgid "|func-tuple|_" -msgstr "" +msgstr "|func-tuple|_" #: library/functions.rst:0 +#, fuzzy msgid ":func:`type`" -msgstr "" +msgstr ":func:`type`" #: library/functions.rst:0 +#, fuzzy msgid "**V**" -msgstr "" +msgstr "**V**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`vars`" -msgstr "" +msgstr ":func:`vars`" #: library/functions.rst:0 +#, fuzzy msgid "**Z**" -msgstr "" +msgstr "**Z**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`zip`" -msgstr "" +msgstr ":func:`zip`" #: library/functions.rst:0 +#, fuzzy msgid "**_**" -msgstr "" +msgstr "**_**" #: library/functions.rst:0 +#, fuzzy msgid ":func:`__import__`" -msgstr "" +msgstr ":func:`__import__`" #: library/functions.rst:59 -msgid "Return the absolute value of a number. The argument may be an integer, a floating-point number, or an object implementing :meth:`~object.__abs__`. If the argument is a complex number, its magnitude is returned." +#, fuzzy +msgid "" +"Return the absolute value of a number. The argument may be an integer, a " +"floating-point number, or an object implementing :meth:`~object.__abs__`. If" +" the argument is a complex number, its magnitude is returned." msgstr "" +"قدر مطلق یک عدد را برگردانید. آرگومان ممکن است یک عدد صحیح، یک عدد ممیز " +"شناور یا یک شی در حال پیاده سازی :meth:`~object.__abs__` باشد. اگر آرگومان " +"یک عدد مختلط باشد، مقدار آن برگردانده می شود." #: library/functions.rst:67 -msgid "Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`. Equivalent to calling ``x.__aiter__()``." +#, fuzzy +msgid "" +"Return an :term:`asynchronous iterator` for an :term:`asynchronous " +"iterable`. Equivalent to calling ``x.__aiter__()``." msgstr "" +"یک :term:`asynchronous iterator` برای :term:`asynchronous iterable` " +"برگردانید. معادل فراخوانی ``x.__aiter__()``." #: library/functions.rst:70 +#, fuzzy msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." -msgstr "" +msgstr "نکته: برخلاف :func:`iter`، :func:`aiter` هیچ گونه آرگومان 2 ندارد." #: library/functions.rst:76 -msgid "Return ``True`` if all elements of the *iterable* are true (or if the iterable is empty). Equivalent to::" +#, fuzzy +msgid "" +"Return ``True`` if all elements of the *iterable* are true (or if the " +"iterable is empty). Equivalent to::" msgstr "" +"اگر همه عناصر *iterable* درست هستند (یا اگر تکرارپذیر خالی است) ``True`` را " +"برگردانید. معادل::" #: library/functions.rst:79 -msgid "def all(iterable):\n" +#, fuzzy +msgid "" +"def all(iterable):\n" " for element in iterable:\n" " if not element:\n" " return False\n" " return True" msgstr "" +"def all(iterable):\n" +" for element in iterable:\n" +" if not element:\n" +" return False\n" +" return True" #: library/functions.rst:89 -msgid "When awaited, return the next item from the given :term:`asynchronous iterator`, or *default* if given and the iterator is exhausted." +#, fuzzy +msgid "" +"When awaited, return the next item from the given :term:`asynchronous " +"iterator`, or *default* if given and the iterator is exhausted." msgstr "" +"در صورت انتظار، آیتم بعدی را از :term:`asynchronous iterator` داده شده " +"برگردانید، یا اگر تکرار کننده تمام شده است، *default* را برگردانید." #: library/functions.rst:92 -msgid "This is the async variant of the :func:`next` builtin, and behaves similarly." -msgstr "" +#, fuzzy +msgid "" +"This is the async variant of the :func:`next` builtin, and behaves " +"similarly." +msgstr "این نوع async داخلی :func:`next` است و رفتار مشابهی دارد." #: library/functions.rst:95 -msgid "This calls the :meth:`~object.__anext__` method of *async_iterator*, returning an :term:`awaitable`. Awaiting this returns the next value of the iterator. If *default* is given, it is returned if the iterator is exhausted, otherwise :exc:`StopAsyncIteration` is raised." +#, fuzzy +msgid "" +"This calls the :meth:`~object.__anext__` method of *async_iterator*, " +"returning an :term:`awaitable`. Awaiting this returns the next value of the " +"iterator. If *default* is given, it is returned if the iterator is " +"exhausted, otherwise :exc:`StopAsyncIteration` is raised." msgstr "" +"این روش :meth:`~object.__anext__` از *async_iterator* را فراخوانی می کند و " +"یک :term:`awaitable` را برمی گرداند. در انتظار این مقدار بعدی تکرار کننده را" +" برمی گرداند. اگر *default* داده شود، اگر تکرار کننده تمام شده باشد، " +"برگردانده می شود، در غیر این صورت :exc:`StopAsyncIteration` افزایش می یابد." #: library/functions.rst:104 -msgid "Return ``True`` if any element of the *iterable* is true. If the iterable is empty, return ``False``. Equivalent to::" +#, fuzzy +msgid "" +"Return ``True`` if any element of the *iterable* is true. If the iterable " +"is empty, return ``False``. Equivalent to::" msgstr "" +"اگر هر عنصری از *iterable* درست است، ``True`` را برگردانید. اگر تکرارپذیر " +"خالی است، ``False`` را برگردانید. معادل::" #: library/functions.rst:107 -msgid "def any(iterable):\n" +#, fuzzy +msgid "" +"def any(iterable):\n" " for element in iterable:\n" " if element:\n" " return True\n" " return False" msgstr "" +"def any(iterable):\n" +" for element in iterable:\n" +" if element:\n" +" return True\n" +" return False" #: library/functions.rst:116 -msgid "As :func:`repr`, return a string containing a printable representation of an object, but escape the non-ASCII characters in the string returned by :func:`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string similar to that returned by :func:`repr` in Python 2." +#, fuzzy +msgid "" +"As :func:`repr`, return a string containing a printable representation of an" +" object, but escape the non-ASCII characters in the string returned by " +":func:`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a " +"string similar to that returned by :func:`repr` in Python 2." msgstr "" +"به عنوان :func:`repr`، یک رشته حاوی نمایش قابل چاپ یک شی را برگردانید، اما " +"از کاراکترهای غیرASCII در رشته ای که توسط :func:`repr` با استفاده از " +"``\\x``، ``\\u`` یا ``\\U`` برگردانده شده است، فرار کنید. این رشته ای شبیه " +"به رشته ای که توسط :func:`repr` در پایتون 2 برگردانده شده است ایجاد می کند." #: library/functions.rst:124 -msgid "Convert an integer number to a binary string prefixed with \"0b\". The result is a valid Python expression. If *x* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. Some examples:" +#, fuzzy +msgid "" +"Convert an integer number to a binary string prefixed with \"0b\". The " +"result is a valid Python expression. If *x* is not a Python :class:`int` " +"object, it has to define an :meth:`~object.__index__` method that returns an" +" integer. Some examples:" msgstr "" +"یک عدد صحیح را به یک رشته باینری با پیشوند \"0b\" تبدیل کنید. نتیجه یک عبارت" +" پایتون معتبر است. اگر *x* یک شی پایتون :class:`int` نیست، باید یک متد " +":meth:`~object.__index__` تعریف کند که یک عدد صحیح برمی گرداند. چند نمونه:" #: library/functions.rst:134 -msgid "If the prefix \"0b\" is desired or not, you can use either of the following ways." +#, fuzzy +msgid "" +"If the prefix \"0b\" is desired or not, you can use either of the following " +"ways." msgstr "" +"اگر پیشوند \"0b\" مورد نظر است یا خیر، می توانید از یکی از راه های زیر " +"استفاده کنید." -#: library/functions.rst:141 -#: library/functions.rst:942 +#: library/functions.rst:141 library/functions.rst:942 #: library/functions.rst:1323 +#, fuzzy msgid "See also :func:`format` for more information." -msgstr "" +msgstr "همچنین برای اطلاعات بیشتر به :func:`format` مراجعه کنید." #: library/functions.rst:146 -msgid "Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is converted using the standard :ref:`truth testing procedure `. If the argument is false or omitted, this returns ``False``; otherwise, it returns ``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`). It cannot be subclassed further. Its only instances are ``False`` and ``True`` (see :ref:`typebool`)." -msgstr "" - -#: library/functions.rst:156 -#: library/functions.rst:807 +#, fuzzy +msgid "" +"Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is " +"converted using the standard :ref:`truth testing procedure `. If the " +"argument is false or omitted, this returns ``False``; otherwise, it returns " +"``True``. The :class:`bool` class is a subclass of :class:`int` (see " +":ref:`typesnumeric`). It cannot be subclassed further. Its only instances " +"are ``False`` and ``True`` (see :ref:`typebool`)." +msgstr "" +"یک مقدار بولی، یعنی یکی از ``True`` یا ``False`` را برگردانید. آرگومان با " +"استفاده از استاندارد :ref:`truth testing procedure ` تبدیل می شود. " +"اگر آرگومان نادرست یا حذف شده باشد، ``False`` را برمی گرداند. در غیر این " +"صورت، ``True`` را برمی گرداند. کلاس :class:`bool` زیر کلاس :class:`int` است" +" (به :ref:`typesnumeric` مراجعه کنید). نمی توان آن را بیشتر طبقه بندی کرد. " +"تنها نمونه های آن ``False`` و ``True`` هستند (به :ref:`typebool` مراجعه " +"کنید)." + +#: library/functions.rst:156 library/functions.rst:807 +#, fuzzy msgid "The parameter is now positional-only." -msgstr "" +msgstr "پارامتر اکنون فقط موقعیتی است." #: library/functions.rst:161 -msgid "This function drops you into the debugger at the call site. Specifically, it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` expecting no arguments. In this case, it is purely a convenience function so you don't have to explicitly import :mod:`pdb` or type as much code to enter the debugger. However, :func:`sys.breakpointhook` can be set to some other function and :func:`breakpoint` will automatically call that, allowing you to drop into the debugger of choice. If :func:`sys.breakpointhook` is not accessible, this function will raise :exc:`RuntimeError`." -msgstr "" +#, fuzzy +msgid "" +"This function drops you into the debugger at the call site. Specifically, " +"it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight " +"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` " +"expecting no arguments. In this case, it is purely a convenience function " +"so you don't have to explicitly import :mod:`pdb` or type as much code to " +"enter the debugger. However, :func:`sys.breakpointhook` can be set to some " +"other function and :func:`breakpoint` will automatically call that, allowing" +" you to drop into the debugger of choice. If :func:`sys.breakpointhook` is " +"not accessible, this function will raise :exc:`RuntimeError`." +msgstr "" +"این تابع شما را وارد دیباگر در سایت تماس می کند. به طور خاص، " +":func:`sys.breakpointhook` را فراخوانی می کند و ``args`` و ``kws`` را " +"مستقیماً عبور می دهد. به‌طور پیش‌فرض، ``sys.breakpointhook()`` " +":func:`pdb.set_trace` را فراخوانی می‌کند و انتظار هیچ آرگومانی را ندارد. در" +" این مورد، این صرفاً یک تابع راحت است، بنابراین نیازی به وارد کردن صریح " +":mod:`pdb` یا تایپ کد زیادی برای ورود به دیباگر نیست. با این حال، " +":func:`sys.breakpointhook` را می توان روی عملکرد دیگری تنظیم کرد و " +":func:`breakpoint` به طور خودکار آن را فراخوانی می کند و به شما امکان می دهد" +" وارد دیباگر انتخابی شوید. اگر :func:`sys.breakpointhook` قابل دسترسی نباشد،" +" این تابع :exc:`RuntimeError` را افزایش می دهد." #: library/functions.rst:173 -msgid "By default, the behavior of :func:`breakpoint` can be changed with the :envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys.breakpointhook` for usage details." +#, fuzzy +msgid "" +"By default, the behavior of :func:`breakpoint` can be changed with the " +":envvar:`PYTHONBREAKPOINT` environment variable. See " +":func:`sys.breakpointhook` for usage details." msgstr "" +"به طور پیش فرض، رفتار :func:`breakpoint` را می توان با متغیر محیطی " +":envvar:`PYTHONBREAKPOINT` تغییر داد. برای جزئیات استفاده به " +":func:`sys.breakpointhook` مراجعه کنید." #: library/functions.rst:177 -msgid "Note that this is not guaranteed if :func:`sys.breakpointhook` has been replaced." +#, fuzzy +msgid "" +"Note that this is not guaranteed if :func:`sys.breakpointhook` has been " +"replaced." msgstr "" +"توجه داشته باشید که اگر :func:`sys.breakpointhook` جایگزین شده باشد، این " +"تضمین نمی شود." #: library/functions.rst:180 -msgid "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with argument ``breakpointhook``." +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " +"argument ``breakpointhook``." msgstr "" +"یک :ref:`auditing event ` ``builtins.breakpoint`` را با آرگومان " +"``breakpointhook`` افزایش می دهد." #: library/functions.rst:190 -msgid "Return a new array of bytes. The :class:`bytearray` class is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of mutable sequences, described in :ref:`typesseq-mutable`, as well as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." +#, fuzzy +msgid "" +"Return a new array of bytes. The :class:`bytearray` class is a mutable " +"sequence of integers in the range 0 <= x < 256. It has most of the usual " +"methods of mutable sequences, described in :ref:`typesseq-mutable`, as well " +"as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." msgstr "" +"یک آرایه جدید از بایت ها را برگردانید. کلاس :class:`bytearray` یک دنباله " +"قابل تغییر از اعداد صحیح در محدوده 0 <= x < 256 است. این کلاس دارای اکثر روش" +" های معمول توالی های قابل تغییر است که در :ref:`typesseq-mutable` توضیح داده" +" شده است، و همچنین اکثر روش هایی که نوع :class:`bytes` دارد، به :ref:`bytes-" +"methods` مراجعه کنید." #: library/functions.rst:195 -msgid "The optional *source* parameter can be used to initialize the array in a few different ways:" +#, fuzzy +msgid "" +"The optional *source* parameter can be used to initialize the array in a few" +" different ways:" msgstr "" +"پارامتر اختیاری *source* می تواند برای مقداردهی اولیه آرایه به چند روش مختلف" +" استفاده شود:" #: library/functions.rst:198 -msgid "If it is a *string*, you must also give the *encoding* (and optionally, *errors*) parameters; :func:`bytearray` then converts the string to bytes using :meth:`str.encode`." +#, fuzzy +msgid "" +"If it is a *string*, you must also give the *encoding* (and optionally, " +"*errors*) parameters; :func:`bytearray` then converts the string to bytes " +"using :meth:`str.encode`." msgstr "" +"اگر *string* است، باید پارامترهای *encoding* (و در صورت تمایل, *errors*) را " +"نیز بدهید. سپس :func:`bytearray` با استفاده از :meth:`str.encode` رشته را به" +" بایت تبدیل می کند." #: library/functions.rst:202 -msgid "If it is an *integer*, the array will have that size and will be initialized with null bytes." +#, fuzzy +msgid "" +"If it is an *integer*, the array will have that size and will be initialized" +" with null bytes." msgstr "" +"اگر *integer* باشد، آرایه آن اندازه را خواهد داشت و با بایت های تهی مقداردهی" +" اولیه می شود." #: library/functions.rst:205 -msgid "If it is an object conforming to the :ref:`buffer interface `, a read-only buffer of the object will be used to initialize the bytes array." +#, fuzzy +msgid "" +"If it is an object conforming to the :ref:`buffer interface " +"`, a read-only buffer of the object will be used to " +"initialize the bytes array." msgstr "" +"اگر یک شی مطابق با :ref:`buffer interface ` باشد، یک بافر فقط" +" خواندنی از شی برای مقداردهی اولیه آرایه بایت استفاده خواهد شد." #: library/functions.rst:208 -msgid "If it is an *iterable*, it must be an iterable of integers in the range ``0 <= x < 256``, which are used as the initial contents of the array." +#, fuzzy +msgid "" +"If it is an *iterable*, it must be an iterable of integers in the range ``0 " +"<= x < 256``, which are used as the initial contents of the array." msgstr "" +"اگر *iterable* باشد، باید تکرارپذیری از اعداد صحیح در محدوده ``0 <= x < " +"256`` باشد که به عنوان محتویات اولیه آرایه استفاده می شود." #: library/functions.rst:211 +#, fuzzy msgid "Without an argument, an array of size 0 is created." -msgstr "" +msgstr "بدون آرگومان، آرایه ای به اندازه 0 ایجاد می شود." #: library/functions.rst:213 +#, fuzzy msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." -msgstr "" +msgstr "همچنین به :ref:`binaryseq` و :ref:`typebytearray` مراجعه کنید." #: library/functions.rst:222 -msgid "Return a new \"bytes\" object which is an immutable sequence of integers in the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :class:`bytearray` -- it has the same non-mutating methods and the same indexing and slicing behavior." +#, fuzzy +msgid "" +"Return a new \"bytes\" object which is an immutable sequence of integers in " +"the range ``0 <= x < 256``. :class:`bytes` is an immutable version of " +":class:`bytearray` -- it has the same non-mutating methods and the same " +"indexing and slicing behavior." msgstr "" +"یک شی \"بایت\" جدید که دنباله ای غیرقابل تغییر از اعداد صحیح در محدوده ``0 " +"<= x < 256`` است را برگردانید. :class:`bytes` یک نسخه تغییرناپذیر از " +":class:`bytearray` است -- روشهای غیر جهشی یکسان و رفتار نمایه سازی و برش " +"یکسانی دارد." #: library/functions.rst:227 -msgid "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." -msgstr "" +#, fuzzy +msgid "" +"Accordingly, constructor arguments are interpreted as for :func:`bytearray`." +msgstr "بر این اساس، آرگومان های سازنده برای :func:`bytearray` تفسیر می شوند." #: library/functions.rst:229 +#, fuzzy msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "" +"اشیاء بایتی را نیز می توان با لفظ ایجاد کرد، به :ref:`strings` مراجعه کنید." #: library/functions.rst:231 +#, fuzzy msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "" +"همچنین به :ref:`binaryseq`، :ref:`typebytes` و :ref:`bytes-methods` مراجعه " +"کنید." #: library/functions.rst:236 -msgid "Return :const:`True` if the *object* argument appears callable, :const:`False` if not. If this returns ``True``, it is still possible that a call fails, but if it is ``False``, calling *object* will never succeed. Note that classes are callable (calling a class returns a new instance); instances are callable if their class has a :meth:`~object.__call__` method." -msgstr "" +#, fuzzy +msgid "" +"Return :const:`True` if the *object* argument appears callable, " +":const:`False` if not. If this returns ``True``, it is still possible that " +"a call fails, but if it is ``False``, calling *object* will never succeed. " +"Note that classes are callable (calling a class returns a new instance); " +"instances are callable if their class has a :meth:`~object.__call__` method." +msgstr "" +"اگر آرگومان *object* قابل فراخوانی ظاهر شد، :const:`True` را برگردانید، در " +"غیر این صورت، :const:`False` را برگردانید. اگر ``True`` را برگرداند، باز هم" +" ممکن است یک تماس با شکست مواجه شود، اما اگر ``False`` باشد، فراخوانی " +"*object* هرگز موفق نخواهد شد. توجه داشته باشید که کلاس ها قابل فراخوانی " +"هستند (با فراخوانی یک کلاس یک نمونه جدید برمی گردد). اگر کلاس آنها دارای متد" +" :meth:`~object.__call__` باشد، نمونه ها قابل فراخوانی هستند." #: library/functions.rst:242 -msgid "This function was first removed in Python 3.0 and then brought back in Python 3.2." +#, fuzzy +msgid "" +"This function was first removed in Python 3.0 and then brought back in " +"Python 3.2." msgstr "" +"این تابع ابتدا در پایتون 3.0 حذف شد و سپس در پایتون 3.2 بازگردانده شد." #: library/functions.rst:249 -msgid "Return the string representing a character whose Unicode code point is the integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while ``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." +#, fuzzy +msgid "" +"Return the string representing a character whose Unicode code point is the " +"integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " +"``chr(8364)`` returns the string ``'€'``. This is the inverse of " +":func:`ord`." msgstr "" +"رشته ای که نشان دهنده یک کاراکتر است که نقطه کد یونیکد آن عدد صحیح *i* است " +"را برگردانید. برای مثال، ``chr(97)`` رشته ``'a'`` را برمی‌گرداند، در حالی " +"که ``chr(8364)`` رشته ``'€'`` را برمی‌گرداند. این برعکس :func:`ord` است." #: library/functions.rst:253 -msgid "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16). :exc:`ValueError` will be raised if *i* is outside that range." +#, fuzzy +msgid "" +"The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " +"base 16). :exc:`ValueError` will be raised if *i* is outside that range." msgstr "" +"محدوده معتبر برای آرگومان از 0 تا 1,114,111 (0x10FFFF در پایه 16) است. اگر " +"*i* خارج از این محدوده باشد، :exc:`ValueError` افزایش می یابد." #: library/functions.rst:259 +#, fuzzy msgid "Transform a method into a class method." -msgstr "" +msgstr "یک متد را به متد کلاسی تبدیل کنید." #: library/functions.rst:261 -msgid "A class method receives the class as an implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom::" +#, fuzzy +msgid "" +"A class method receives the class as an implicit first argument, just like " +"an instance method receives the instance. To declare a class method, use " +"this idiom::" msgstr "" +"یک متد کلاس، کلاس را به عنوان اولین آرگومان ضمنی دریافت می کند، درست مانند " +"متد نمونه، نمونه را دریافت می کند. برای اعلام متد کلاس، از این اصطلاح " +"استفاده کنید::" #: library/functions.rst:265 -msgid "class C:\n" +#, fuzzy +msgid "" +"class C:\n" " @classmethod\n" " def f(cls, arg1, arg2): ..." msgstr "" +"class C:\n" +" @classmethod\n" +" def f(cls, arg1, arg2): ..." #: library/functions.rst:269 -msgid "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:`function` for details." +#, fuzzy +msgid "" +"The ``@classmethod`` form is a function :term:`decorator` -- see " +":ref:`function` for details." msgstr "" +"فرم ``@classmethod`` یک تابع :term:`decorator` است -- برای جزئیات به " +":ref:`function` مراجعه کنید." #: library/functions.rst:272 -msgid "A class method can be called either on the class (such as ``C.f()``) or on an instance (such as ``C().f()``). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument." +#, fuzzy +msgid "" +"A class method can be called either on the class (such as ``C.f()``) or on " +"an instance (such as ``C().f()``). The instance is ignored except for its " +"class. If a class method is called for a derived class, the derived class " +"object is passed as the implied first argument." msgstr "" +"یک متد کلاس را می توان بر روی کلاس (مانند ``C.f()``) یا در یک نمونه (مانند " +"``C().f()``) فراخوانی کرد. نمونه به جز کلاس آن نادیده گرفته می شود. اگر یک " +"متد کلاس برای یک کلاس مشتق شده فراخوانی شود، شی کلاس مشتق شده به عنوان اولین" +" آرگومان ضمنی ارسال می شود." #: library/functions.rst:277 -msgid "Class methods are different than C++ or Java static methods. If you want those, see :func:`staticmethod` in this section. For more information on class methods, see :ref:`types`." +#, fuzzy +msgid "" +"Class methods are different than C++ or Java static methods. If you want " +"those, see :func:`staticmethod` in this section. For more information on " +"class methods, see :ref:`types`." msgstr "" +"متدهای کلاس با روش‌های استاتیک C++ یا جاوا متفاوت هستند. اگر آنها را می " +"خواهید، :func:`staticmethod` را در این بخش ببینید. برای اطلاعات بیشتر در " +"مورد روش های کلاس، به :ref:`types` مراجعه کنید." #: library/functions.rst:281 -msgid "Class methods can now wrap other :term:`descriptors ` such as :func:`property`." +#, fuzzy +msgid "" +"Class methods can now wrap other :term:`descriptors ` such as " +":func:`property`." msgstr "" +"متدهای کلاس اکنون می توانند :term:`descriptors ` دیگر مانند " +":func:`property` را بپیچند." #: library/functions.rst:285 -msgid "Class methods now inherit the method attributes (:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a new ``__wrapped__`` attribute." +#, fuzzy +msgid "" +"Class methods now inherit the method attributes " +"(:attr:`~function.__module__`, :attr:`~function.__name__`, " +":attr:`~function.__qualname__`, :attr:`~function.__doc__` and " +":attr:`~function.__annotations__`) and have a new ``__wrapped__`` attribute." msgstr "" +"متدهای کلاس اکنون ویژگی های متد (:attr:`~function.__module__`, " +":attr:`~function.__name__`, :attr:`~function.__qualname__`, " +":attr:`~function.__doc__` و :attr:`~function.__annotations__`) را به ارث می " +"برند و یک ویژگی ``__wrapped__`` جدید دارند." #: library/functions.rst:292 -msgid "Class methods can no longer wrap other :term:`descriptors ` such as :func:`property`." +#, fuzzy +msgid "" +"Class methods can no longer wrap other :term:`descriptors ` such" +" as :func:`property`." msgstr "" +"متدهای کلاس دیگر نمی توانند :term:`descriptors ` دیگر مانند " +":func:`property` را بپیچند." #: library/functions.rst:299 -msgid "Compile the *source* into a code or AST object. Code objects can be executed by :func:`exec` or :func:`eval`. *source* can either be a normal string, a byte string, or an AST object. Refer to the :mod:`ast` module documentation for information on how to work with AST objects." +#, fuzzy +msgid "" +"Compile the *source* into a code or AST object. Code objects can be " +"executed by :func:`exec` or :func:`eval`. *source* can either be a normal " +"string, a byte string, or an AST object. Refer to the :mod:`ast` module " +"documentation for information on how to work with AST objects." msgstr "" +"*source* را در یک کد یا شی AST کامپایل کنید. اشیاء کد را می توان توسط " +":func:`exec` یا :func:`eval` اجرا کرد. *source* می تواند یک رشته معمولی، یک" +" رشته بایت یا یک شی AST باشد. برای اطلاعات در مورد نحوه کار با اشیاء AST به" +" مستندات ماژول :mod:`ast` مراجعه کنید." #: library/functions.rst:304 -msgid "The *filename* argument should give the file from which the code was read; pass some recognizable value if it wasn't read from a file (``''`` is commonly used)." +#, fuzzy +msgid "" +"The *filename* argument should give the file from which the code was read; " +"pass some recognizable value if it wasn't read from a file (``''`` " +"is commonly used)." msgstr "" +"آرگومان *filename* باید فایلی را ارائه کند که کد از آن خوانده شده است. اگر " +"از یک فایل خوانده نشده باشد مقداری قابل تشخیص را ارسال کنید (معمولاً از " +"``''`` استفاده می شود)." #: library/functions.rst:308 -msgid "The *mode* argument specifies what kind of code must be compiled; it can be ``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if it consists of a single expression, or ``'single'`` if it consists of a single interactive statement (in the latter case, expression statements that evaluate to something other than ``None`` will be printed)." -msgstr "" +#, fuzzy +msgid "" +"The *mode* argument specifies what kind of code must be compiled; it can be " +"``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " +"it consists of a single expression, or ``'single'`` if it consists of a " +"single interactive statement (in the latter case, expression statements that" +" evaluate to something other than ``None`` will be printed)." +msgstr "" +"آرگومان *mode* مشخص می کند که چه نوع کدی باید کامپایل شود. اگر *source* از " +"دنباله ای از دستورات تشکیل شده باشد، می تواند ``'exec'`` باشد، اگر از یک " +"عبارت واحد تشکیل شده باشد ``'eval'``، یا اگر از یک عبارت تعاملی تشکیل شده " +"باشد، ``'single'`` باشد (در مورد دوم, عبارات عبارتی که به چیزی غیر از " +"``None`` ارزیابی می شوند چاپ می شوند)." #: library/functions.rst:314 -msgid "The optional arguments *flags* and *dont_inherit* control which :ref:`compiler options ` should be activated and which :ref:`future features ` should be allowed. If neither is present (or both are zero) the code is compiled with the same flags that affect the code that is calling :func:`compile`. If the *flags* argument is given and *dont_inherit* is not (or is zero) then the compiler options and the future statements specified by the *flags* argument are used in addition to those that would be used anyway. If *dont_inherit* is a non-zero integer then the *flags* argument is it -- the flags (future features and compiler options) in the surrounding code are ignored." -msgstr "" +#, fuzzy +msgid "" +"The optional arguments *flags* and *dont_inherit* control which " +":ref:`compiler options ` should be activated and which " +":ref:`future features ` should be allowed. If neither is present (or" +" both are zero) the code is compiled with the same flags that affect the " +"code that is calling :func:`compile`. If the *flags* argument is given and " +"*dont_inherit* is not (or is zero) then the compiler options and the future " +"statements specified by the *flags* argument are used in addition to those " +"that would be used anyway. If *dont_inherit* is a non-zero integer then the " +"*flags* argument is it -- the flags (future features and compiler options) " +"in the surrounding code are ignored." +msgstr "" +"آرگومان های اختیاری *flags* و *dont_inherit* کنترل می کنند که کدام " +":ref:`compiler options ` باید فعال شود و کدام " +":ref:`future features ` باید مجاز باشد. اگر هیچ کدام وجود نداشته " +"باشد (یا هر دو صفر باشند), کد با همان پرچم هایی که روی کدی که " +":func:`compile` را فراخوانی می کند تأثیر می گذارد، کامپایل می شود. اگر " +"آرگومان *flags* داده شود و *dont_inherit* نباشد (یا صفر باشد), گزینه های " +"کامپایلر و عبارات آینده مشخص شده توسط آرگومان *flags* علاوه بر مواردی که به " +"هر حال مورد استفاده قرار می گیرند استفاده می شود. اگر *dont_inherit* یک عدد " +"صحیح غیر صفر است، آرگومان *flags* همان است -- پرچم ها (ویژگی های آینده و " +"گزینه های کامپایلر) در کد اطراف نادیده گرفته می شوند." #: library/functions.rst:325 -msgid "Compiler options and future statements are specified by bits which can be bitwise ORed together to specify multiple options. The bitfield required to specify a given future feature can be found as the :attr:`~__future__._Feature.compiler_flag` attribute on the :class:`~__future__._Feature` instance in the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with ``PyCF_`` prefix." -msgstr "" +#, fuzzy +msgid "" +"Compiler options and future statements are specified by bits which can be " +"bitwise ORed together to specify multiple options. The bitfield required to " +"specify a given future feature can be found as the " +":attr:`~__future__._Feature.compiler_flag` attribute on the " +":class:`~__future__._Feature` instance in the :mod:`__future__` module. " +":ref:`Compiler flags ` can be found in :mod:`ast` " +"module, with ``PyCF_`` prefix." +msgstr "" +"گزینه‌های کامپایلر و عبارات آینده توسط بیت‌هایی مشخص می‌شوند که می‌توانند به" +" صورت بیتی با هم OR شوند تا چندین گزینه را مشخص کنند. فیلد بیتی مورد نیاز " +"برای تعیین یک ویژگی آینده داده شده را می توان به عنوان ویژگی " +":attr:`~__future__._Feature.compiler_flag` در نمونه " +":class:`~__future__._Feature` در ماژول :mod:`__future__` یافت. " +":ref:`Compiler flags ` را می توان در ماژول :mod:`ast` با" +" پیشوند ``PyCF_`` یافت." #: library/functions.rst:333 -msgid "The argument *optimize* specifies the optimization level of the compiler; the default value of ``-1`` selects the optimization level of the interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no optimization; ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false) or ``2`` (docstrings are removed too)." -msgstr "" +#, fuzzy +msgid "" +"The argument *optimize* specifies the optimization level of the compiler; " +"the default value of ``-1`` selects the optimization level of the " +"interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no" +" optimization; ``__debug__`` is true), ``1`` (asserts are removed, " +"``__debug__`` is false) or ``2`` (docstrings are removed too)." +msgstr "" +"آرگومان *optimize* سطح بهینه سازی کامپایلر را مشخص می کند. مقدار پیش‌فرض " +"``-1`` سطح بهینه‌سازی مفسر را مطابق با گزینه‌های :option:`-O` انتخاب می‌کند." +" سطوح صریح ``0`` (بدون بهینه سازی؛ ``__debug__`` درست است)، ``1`` (ادعاها " +"حذف می شوند, ``__debug__`` نادرست است) یا ``2`` (رشته های اسناد نیز حذف می " +"شوند)." #: library/functions.rst:339 -msgid "This function raises :exc:`SyntaxError` if the compiled source is invalid, and :exc:`ValueError` if the source contains null bytes." +#, fuzzy +msgid "" +"This function raises :exc:`SyntaxError` if the compiled source is invalid, " +"and :exc:`ValueError` if the source contains null bytes." msgstr "" +"اگر منبع کامپایل شده نامعتبر باشد، این تابع :exc:`SyntaxError` را افزایش می " +"دهد و اگر منبع حاوی بایت های تهی باشد، :exc:`ValueError` را افزایش می دهد." #: library/functions.rst:342 -msgid "If you want to parse Python code into its AST representation, see :func:`ast.parse`." +#, fuzzy +msgid "" +"If you want to parse Python code into its AST representation, see " +":func:`ast.parse`." msgstr "" +"اگر می خواهید کد پایتون را در نمایش AST آن تجزیه کنید، به :func:`ast.parse` " +"مراجعه کنید." -#: library/functions.rst:345 -#: library/functions.rst:347 -msgid "Raises an :ref:`auditing event ` ``compile`` with arguments ``source`` and ``filename``. This event may also be raised by implicit compilation." +#: library/functions.rst:345 library/functions.rst:347 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``compile`` with arguments " +"``source`` and ``filename``. This event may also be raised by implicit " +"compilation." msgstr "" +"یک :ref:`auditing event ` ``compile`` را با آرگومان های ``source``" +" و ``filename`` افزایش می دهد. این رویداد ممکن است با گردآوری ضمنی نیز مطرح " +"شود." #: library/functions.rst:353 -msgid "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` mode, input must be terminated by at least one newline character. This is to facilitate detection of incomplete and complete statements in the :mod:`code` module." +#, fuzzy +msgid "" +"When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " +"mode, input must be terminated by at least one newline character. This is " +"to facilitate detection of incomplete and complete statements in the " +":mod:`code` module." msgstr "" +"هنگام کامپایل یک رشته با کد چند خطی در حالت ``'single'`` یا ``'eval'``، " +"ورودی باید حداقل با یک کاراکتر خط جدید خاتمه یابد. این برای تسهیل تشخیص " +"عبارات ناقص و کامل در ماژول :mod:`code` است." #: library/functions.rst:360 -msgid "It is possible to crash the Python interpreter with a sufficiently large/complex string when compiling to an AST object due to stack depth limitations in Python's AST compiler." +#, fuzzy +msgid "" +"It is possible to crash the Python interpreter with a sufficiently " +"large/complex string when compiling to an AST object due to stack depth " +"limitations in Python's AST compiler." msgstr "" +"به دلیل محدودیت‌های عمق پشته در کامپایلر AST پایتون، ممکن است هنگام کامپایل " +"کردن به یک شی AST، مفسر پایتون با یک رشته به اندازه کافی بزرگ/پیچیده خراب " +"شود." #: library/functions.rst:364 -msgid "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode does not have to end in a newline anymore. Added the *optimize* parameter." +#, fuzzy +msgid "" +"Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " +"does not have to end in a newline anymore. Added the *optimize* parameter." msgstr "" +"استفاده از خطوط جدید ویندوز و مک مجاز است. همچنین، ورودی در حالت ``'exec'``" +" دیگر لازم نیست به خط جدید ختم شود. پارامتر *optimize* اضافه شد." #: library/functions.rst:368 -msgid "Previously, :exc:`TypeError` was raised when null bytes were encountered in *source*." +#, fuzzy +msgid "" +"Previously, :exc:`TypeError` was raised when null bytes were encountered in " +"*source*." msgstr "" +"پیش از این، :exc:`TypeError` زمانی که بایت های تهی در *source* مواجه می " +"شدند، افزایش می یافت." #: library/functions.rst:372 -msgid "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable support for top-level ``await``, ``async for``, and ``async with``." +#, fuzzy +msgid "" +"``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " +"support for top-level ``await``, ``async for``, and ``async with``." msgstr "" +"اکنون می‌توان ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` را در پرچم‌ها برای فعال " +"کردن پشتیبانی از ``await``، ``async for`` و ``async with`` سطح بالا منتقل " +"کرد." #: library/functions.rst:381 -msgid "Convert a single string or number to a complex number, or create a complex number from real and imaginary parts." +#, fuzzy +msgid "" +"Convert a single string or number to a complex number, or create a complex " +"number from real and imaginary parts." msgstr "" +"یک رشته یا عدد را به یک عدد مختلط تبدیل کنید یا یک عدد مختلط از قسمت های " +"واقعی و خیالی ایجاد کنید." -#: library/functions.rst:384 -#: library/functions.rst:752 +#: library/functions.rst:384 library/functions.rst:752 #: library/functions.rst:998 +#, fuzzy msgid "Examples:" -msgstr "" +msgstr "مثال ها:" #: library/functions.rst:386 -msgid ">>> complex('+1.23')\n" +#, fuzzy +msgid "" +">>> complex('+1.23')\n" "(1.23+0j)\n" ">>> complex('-4.5j')\n" "-4.5j\n" @@ -667,233 +1156,608 @@ msgid ">>> complex('+1.23')\n" ">>> complex(-1.23, 4.5)\n" "(-1.23+4.5j)" msgstr "" +">>> complex('+1.23')\n" +"(1.23+0j)\n" +">>> complex('-4.5j')\n" +"-4.5j\n" +">>> complex('-1.23+4.5j')\n" +"(-1.23+4.5j)\n" +">>> complex('\\t( -1.23+4.5J )\\n')\n" +"(-1.23+4.5j)\n" +">>> complex('-Infinity+NaNj')\n" +"(-inf+nanj)\n" +">>> complex(1.23)\n" +"(1.23+0j)\n" +">>> complex(imag=-4.5)\n" +"-4.5j\n" +">>> complex(-1.23, 4.5)\n" +"(-1.23+4.5j)" #: library/functions.rst:405 -msgid "If the argument is a string, it must contain either a real part (in the same format as for :func:`float`) or an imaginary part (in the same format but with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the sign of the imaginary part is mandatory in this case). The string can optionally be surrounded by whitespaces and the round parentheses ``'('`` and ``')'``, which are ignored. The string must not contain whitespace between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` raises :exc:`ValueError`. More precisely, the input must conform to the :token:`~float:complexvalue` production rule in the following grammar, after parentheses and leading and trailing whitespace characters are removed:" -msgstr "" +#, fuzzy +msgid "" +"If the argument is a string, it must contain either a real part (in the same" +" format as for :func:`float`) or an imaginary part (in the same format but " +"with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the " +"sign of the imaginary part is mandatory in this case). The string can " +"optionally be surrounded by whitespaces and the round parentheses ``'('`` " +"and ``')'``, which are ignored. The string must not contain whitespace " +"between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal " +"number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` " +"raises :exc:`ValueError`. More precisely, the input must conform to the " +":token:`~float:complexvalue` production rule in the following grammar, after" +" parentheses and leading and trailing whitespace characters are removed:" +msgstr "" +"اگر آرگومان یک رشته باشد، باید شامل یک قسمت واقعی (با همان قالب " +":func:`float`) یا یک قسمت خیالی (در همان قالب اما با پسوند ``'j'`` یا " +"``'J'``) یا هر دو قسمت واقعی و خیالی باشد (علامت قسمت خیالی در این مورد " +"اجباری است). رشته را می توان به صورت اختیاری با فضاهای خالی و پرانتزهای گرد " +"``'('`` و ``')'`` احاطه کرد که نادیده گرفته می شوند. رشته نباید دارای فضای " +"خالی بین ``'+'``، ``'-'``، پسوند ``'j'`` یا ``'J'`` و عدد اعشاری باشد. به " +"عنوان مثال، ``complex('1+2j')`` خوب است، اما ``complex('1 + 2j')`` " +":exc:`ValueError` را افزایش می دهد. به‌طور دقیق‌تر، ورودی باید با قانون " +"تولید :token:`~float:complexvalue` در گرامر زیر مطابقت داشته باشد، پس از حذف" +" پرانتزها و کاراکترهای فضای خالی اصلی و انتهایی:" #: library/functions.rst:424 -msgid "If the argument is a number, the constructor serves as a numeric conversion like :class:`int` and :class:`float`. For a general Python object ``x``, ``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`." -msgstr "" +#, fuzzy +msgid "" +"If the argument is a number, the constructor serves as a numeric conversion " +"like :class:`int` and :class:`float`. For a general Python object ``x``, " +"``complex(x)`` delegates to ``x.__complex__()``. If " +":meth:`~object.__complex__` is not defined then it falls back to " +":meth:`~object.__float__`. If :meth:`!__float__` is not defined then it " +"falls back to :meth:`~object.__index__`." +msgstr "" +"اگر آرگومان یک عدد باشد، سازنده به عنوان یک تبدیل عددی مانند :class:`int` و " +":class:`float` عمل می کند. برای یک شیء عمومی پایتون ``x``، ``complex(x)`` به" +" ``x.__complex__()`` واگذار می شود. اگر :meth:`~object.__complex__` تعریف " +"نشده باشد، به :meth:`~object.__float__` برمی گردد. اگر :meth:`!__float__` " +"تعریف نشده باشد، به :meth:`~object.__index__` برمی گردد." #: library/functions.rst:433 -msgid "If two arguments are provided or keyword arguments are used, each argument may be any numeric type (including complex). If both arguments are real numbers, return a complex number with the real component *real* and the imaginary component *imag*. If both arguments are complex numbers, return a complex number with the real component ``real.real-imag.imag`` and the imaginary component ``real.imag+imag.real``. If one of arguments is a real number, only its real component is used in the above expressions." -msgstr "" +#, fuzzy +msgid "" +"If two arguments are provided or keyword arguments are used, each argument " +"may be any numeric type (including complex). If both arguments are real " +"numbers, return a complex number with the real component *real* and the " +"imaginary component *imag*. If both arguments are complex numbers, return a " +"complex number with the real component ``real.real-imag.imag`` and the " +"imaginary component ``real.imag+imag.real``. If one of arguments is a real " +"number, only its real component is used in the above expressions." +msgstr "" +"اگر دو آرگومان ارائه شود یا از آرگومان های کلمه کلیدی استفاده شود، هر " +"آرگومان ممکن است از هر نوع عددی (از جمله مختلط) باشد. اگر هر دو آرگومان " +"اعداد واقعی هستند، یک عدد مختلط با جزء واقعی *real* و جزء خیالی *imag* " +"برگردانید. اگر هر دو آرگومان اعداد مختلط هستند، یک عدد مختلط با مؤلفه واقعی " +"``real.real-imag.imag`` و مؤلفه خیالی ``real.imag+imag.real`` برگردانید. اگر" +" یکی از آرگومان ها یک عدد واقعی باشد، فقط جزء واقعی آن در عبارات بالا " +"استفاده می شود." #: library/functions.rst:443 +#, fuzzy msgid "If all arguments are omitted, returns ``0j``." -msgstr "" +msgstr "اگر همه آرگومان ها حذف شوند، ``0j`` را برمی گرداند." #: library/functions.rst:445 +#, fuzzy msgid "The complex type is described in :ref:`typesnumeric`." -msgstr "" +msgstr "نوع پیچیده در :ref:`typesnumeric` توضیح داده شده است." -#: library/functions.rst:447 -#: library/functions.rst:804 +#: library/functions.rst:447 library/functions.rst:804 #: library/functions.rst:1047 +#, fuzzy msgid "Grouping digits with underscores as in code literals is allowed." -msgstr "" +msgstr "گروه بندی ارقام با زیرخط مانند حروف کد مجاز است." #: library/functions.rst:450 -msgid "Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :meth:`~object.__float__` are not defined." +#, fuzzy +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and " +":meth:`~object.__float__` are not defined." msgstr "" +"اگر :meth:`~object.__complex__` و :meth:`~object.__float__` تعریف نشده باشند" +" به :meth:`~object.__index__` برمی گردد." #: library/functions.rst:457 -msgid "This is a relative of :func:`setattr`. The arguments are an object and a string. The string must be the name of one of the object's attributes. The function deletes the named attribute, provided the object allows it. For example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* need not be a Python identifier (see :func:`setattr`)." -msgstr "" +#, fuzzy +msgid "" +"This is a relative of :func:`setattr`. The arguments are an object and a " +"string. The string must be the name of one of the object's attributes. The" +" function deletes the named attribute, provided the object allows it. For " +"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* " +"need not be a Python identifier (see :func:`setattr`)." +msgstr "" +"این یکی از بستگان :func:`setattr` است. آرگومان ها یک شی و یک رشته هستند. " +"رشته باید نام یکی از ویژگی های شی باشد. تابع ویژگی نامگذاری شده را حذف می " +"کند، مشروط بر اینکه شیء اجازه دهد. به عنوان مثال، ``delattr(x, 'foobar')`` " +"معادل ``del x.foobar`` است. *name* نباید یک شناسه پایتون باشد (به " +":func:`setattr` مراجعه کنید)." #: library/functions.rst:470 -msgid "Create a new dictionary. The :class:`dict` object is the dictionary class. See :class:`dict` and :ref:`typesmapping` for documentation about this class." +#, fuzzy +msgid "" +"Create a new dictionary. The :class:`dict` object is the dictionary class. " +"See :class:`dict` and :ref:`typesmapping` for documentation about this " +"class." msgstr "" +"یک فرهنگ لغت جدید ایجاد کنید. شی :class:`dict` کلاس دیکشنری است. برای " +"مستندات مربوط به این کلاس به :class:`dict` و :ref:`typesmapping` مراجعه " +"کنید." #: library/functions.rst:473 -msgid "For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, as well as the :mod:`collections` module." +#, fuzzy +msgid "" +"For other containers see the built-in :class:`list`, :class:`set`, and " +":class:`tuple` classes, as well as the :mod:`collections` module." msgstr "" +"برای سایر کانتینرها به کلاس های داخلی :class:`list`، :class:`set` و " +":class:`tuple` و همچنین ماژول :mod:`collections` مراجعه کنید." #: library/functions.rst:480 -msgid "Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object." +#, fuzzy +msgid "" +"Without arguments, return the list of names in the current local scope. " +"With an argument, attempt to return a list of valid attributes for that " +"object." msgstr "" +"بدون آرگومان، فهرست اسامی را در محدوده محلی فعلی برگردانید. با یک آرگومان، " +"سعی کنید لیستی از ویژگی های معتبر برای آن شی را برگردانید." #: library/functions.rst:483 -msgid "If the object has a method named :meth:`~object.__dir__`, this method will be called and must return the list of attributes. This allows objects that implement a custom :func:`~object.__getattr__` or :func:`~object.__getattribute__` function to customize the way :func:`dir` reports their attributes." -msgstr "" +#, fuzzy +msgid "" +"If the object has a method named :meth:`~object.__dir__`, this method will " +"be called and must return the list of attributes. This allows objects that " +"implement a custom :func:`~object.__getattr__` or " +":func:`~object.__getattribute__` function to customize the way :func:`dir` " +"reports their attributes." +msgstr "" +"اگر شی دارای متدی به نام :meth:`~object.__dir__` باشد، این متد فراخوانی می " +"شود و باید لیست ویژگی ها را برگرداند. این به اشیایی که یک تابع سفارشی " +":func:`~object.__getattr__` یا :func:`~object.__getattribute__` را پیاده " +"سازی می کنند اجازه می دهد تا نحوه گزارش :func:`dir` ویژگی های خود را سفارشی " +"کنند." #: library/functions.rst:490 -msgid "If the object does not provide :meth:`~object.__dir__`, the function tries its best to gather information from the object's :attr:`~object.__dict__` attribute, if defined, and from its type object. The resulting list is not necessarily complete and may be inaccurate when the object has a custom :func:`~object.__getattr__`." +#, fuzzy +msgid "" +"If the object does not provide :meth:`~object.__dir__`, the function tries " +"its best to gather information from the object's :attr:`~object.__dict__` " +"attribute, if defined, and from its type object. The resulting list is not " +"necessarily complete and may be inaccurate when the object has a custom " +":func:`~object.__getattr__`." msgstr "" +"اگر شیء :meth:`~object.__dir__` را ارائه نکند، تابع تمام تلاش خود را می کند " +"تا اطلاعات را از ویژگی :attr:`~object.__dict__` شیء، در صورت تعریف، و از شی " +"نوع آن جمع آوری کند. لیست حاصل لزوماً کامل نیست و ممکن است زمانی که شیء " +"دارای :func:`~object.__getattr__` سفارشی باشد، نادرست باشد." #: library/functions.rst:496 -msgid "The default :func:`dir` mechanism behaves differently with different types of objects, as it attempts to produce the most relevant, rather than complete, information:" +#, fuzzy +msgid "" +"The default :func:`dir` mechanism behaves differently with different types " +"of objects, as it attempts to produce the most relevant, rather than " +"complete, information:" msgstr "" +"مکانیسم پیش‌فرض :func:`dir` با انواع مختلف اشیا رفتار متفاوتی دارد، زیرا " +"تلاش می‌کند مرتبط‌ترین و نه کامل‌ترین اطلاعات را تولید کند:" #: library/functions.rst:500 -msgid "If the object is a module object, the list contains the names of the module's attributes." -msgstr "" +#, fuzzy +msgid "" +"If the object is a module object, the list contains the names of the " +"module's attributes." +msgstr "اگر شی یک شی ماژول است، لیست شامل نام ویژگی های ماژول است." #: library/functions.rst:503 -msgid "If the object is a type or class object, the list contains the names of its attributes, and recursively of the attributes of its bases." +#, fuzzy +msgid "" +"If the object is a type or class object, the list contains the names of its " +"attributes, and recursively of the attributes of its bases." msgstr "" +"اگر شی یک شی نوع یا کلاس باشد، لیست شامل نام ویژگی های آن و به صورت بازگشتی " +"از ویژگی های پایه های آن است." #: library/functions.rst:506 -msgid "Otherwise, the list contains the object's attributes' names, the names of its class's attributes, and recursively of the attributes of its class's base classes." +#, fuzzy +msgid "" +"Otherwise, the list contains the object's attributes' names, the names of " +"its class's attributes, and recursively of the attributes of its class's " +"base classes." msgstr "" +"در غیر این صورت، لیست شامل نام ویژگی های شی، نام ویژگی های کلاس آن، و به " +"صورت بازگشتی از ویژگی های کلاس های پایه کلاس خود است." #: library/functions.rst:510 +#, fuzzy msgid "The resulting list is sorted alphabetically. For example:" -msgstr "" +msgstr "لیست به دست آمده بر اساس حروف الفبا مرتب شده است. به عنوان مثال:" #: library/functions.rst:530 -msgid "Because :func:`dir` is supplied primarily as a convenience for use at an interactive prompt, it tries to supply an interesting set of names more than it tries to supply a rigorously or consistently defined set of names, and its detailed behavior may change across releases. For example, metaclass attributes are not in the result list when the argument is a class." -msgstr "" +#, fuzzy +msgid "" +"Because :func:`dir` is supplied primarily as a convenience for use at an " +"interactive prompt, it tries to supply an interesting set of names more than" +" it tries to supply a rigorously or consistently defined set of names, and " +"its detailed behavior may change across releases. For example, metaclass " +"attributes are not in the result list when the argument is a class." +msgstr "" +"از آنجایی که :func:`dir` عمدتاً به عنوان یک راحتی برای استفاده در یک اعلان " +"تعاملی ارائه می‌شود، سعی می‌کند مجموعه‌ای جالب از نام‌ها را بیش از تلاش برای" +" ارائه مجموعه‌ای از نام‌ها به‌طور دقیق یا به‌طور پیوسته ارائه کند، و رفتار " +"جزئیات آن ممکن است در نسخه‌ها تغییر کند. به عنوان مثال، هنگامی که آرگومان " +"یک کلاس است، ویژگی های متاکلاس در لیست نتیجه وجود ندارد." #: library/functions.rst:540 -msgid "Take two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as ``(a // b, a % b)``. For floating-point numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 <= abs(a % b) < abs(b)``." -msgstr "" +#, fuzzy +msgid "" +"Take two (non-complex) numbers as arguments and return a pair of numbers " +"consisting of their quotient and remainder when using integer division. " +"With mixed operand types, the rules for binary arithmetic operators apply. " +"For integers, the result is the same as ``(a // b, a % b)``. For floating-" +"point numbers the result is ``(q, a % b)``, where *q* is usually " +"``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a " +"% b`` is very close to *a*, if ``a % b`` is non-zero it has the same sign as" +" *b*, and ``0 <= abs(a % b) < abs(b)``." +msgstr "" +"دو عدد (غیر مختلط) را به عنوان آرگومان در نظر بگیرید و هنگام استفاده از " +"تقسیم اعداد صحیح، یک جفت اعداد متشکل از ضریب و باقیمانده آنها را برگردانید." +" با انواع عملوند مختلط، قوانین عملگرهای حسابی باینری اعمال می شود. برای " +"اعداد صحیح، نتیجه مشابه ``(a // b, a % b)`` است. برای اعداد ممیز شناور، " +"نتیجه ``(q, a % b)`` است، که در آن *q* معمولاً ``math.floor(a / b)`` است اما" +" ممکن است 1 کمتر از آن باشد. در هر صورت ``q * b + a % b`` بسیار نزدیک به " +"*a* است، اگر ``a % b`` غیر صفر باشد همان علامت *b* و ``0 <= abs(a % b) < " +"abs(b)`` را دارد." #: library/functions.rst:552 -msgid "Return an enumerate object. *iterable* must be a sequence, an :term:`iterator`, or some other object which supports iteration. The :meth:`~iterator.__next__` method of the iterator returned by :func:`enumerate` returns a tuple containing a count (from *start* which defaults to 0) and the values obtained from iterating over *iterable*." -msgstr "" +#, fuzzy +msgid "" +"Return an enumerate object. *iterable* must be a sequence, an " +":term:`iterator`, or some other object which supports iteration. The " +":meth:`~iterator.__next__` method of the iterator returned by " +":func:`enumerate` returns a tuple containing a count (from *start* which " +"defaults to 0) and the values obtained from iterating over *iterable*." +msgstr "" +"یک شئ enumerate را برگردانید. *iterable* باید یک دنباله، یک :term:`iterator`" +" یا شیء دیگری باشد که از تکرار پشتیبانی می کند. متد " +":meth:`~iterator.__next__` تکرارکننده که توسط :func:`enumerate` برگردانده " +"شده است یک تاپل حاوی یک شمارش (از *start* که به طور پیش فرض روی 0 است) و " +"مقادیر به دست آمده از تکرار بر روی *iterable* را برمی گرداند." #: library/functions.rst:564 +#, fuzzy msgid "Equivalent to::" -msgstr "" +msgstr "معادل::" #: library/functions.rst:566 -msgid "def enumerate(iterable, start=0):\n" +#, fuzzy +msgid "" +"def enumerate(iterable, start=0):\n" " n = start\n" " for elem in iterable:\n" " yield n, elem\n" " n += 1" msgstr "" +"def enumerate(iterable, start=0):\n" +" n = start\n" +" for elem in iterable:\n" +" yield n, elem\n" +" n += 1" #: library/functions.rst:0 +#, fuzzy msgid "Parameters" -msgstr "" +msgstr "پارامترها" #: library/functions.rst:576 +#, fuzzy msgid "A Python expression." -msgstr "" +msgstr "یک عبارت پایتون" #: library/functions.rst:580 +#, fuzzy msgid "The global namespace (default: ``None``)." -msgstr "" +msgstr "فضای نام جهانی (پیش‌فرض: ``None``)." #: library/functions.rst:584 +#, fuzzy msgid "The local namespace (default: ``None``)." -msgstr "" +msgstr "فضای نام محلی (پیش‌فرض: ``None``)." #: library/functions.rst:0 +#, fuzzy msgid "Returns" -msgstr "" +msgstr "برمی گرداند" #: library/functions.rst:588 +#, fuzzy msgid "The result of the evaluated expression." -msgstr "" +msgstr "نتیجه عبارت ارزیابی شده" #: library/functions.rst:0 +#, fuzzy msgid "raises" -msgstr "" +msgstr "را افزایش می دهد" #: library/functions.rst:589 +#, fuzzy msgid "Syntax errors are reported as exceptions." -msgstr "" +msgstr "خطاهای نحوی به عنوان استثنا گزارش می شوند." -#: library/functions.rst:593 -#: library/functions.rst:654 -msgid "This function executes arbitrary code. Calling it with user-supplied input may lead to security vulnerabilities." +#: library/functions.rst:593 library/functions.rst:654 +#, fuzzy +msgid "" +"This function executes arbitrary code. Calling it with user-supplied input " +"may lead to security vulnerabilities." msgstr "" +"این تابع کد دلخواه را اجرا می کند. فراخوانی آن با ورودی ارائه شده توسط کاربر" +" ممکن است منجر به آسیب‌پذیری‌های امنیتی شود." #: library/functions.rst:596 -msgid "The *expression* argument is parsed and evaluated as a Python expression (technically speaking, a condition list) using the *globals* and *locals* mappings as global and local namespace. If the *globals* dictionary is present and does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key before *expression* is parsed. That way you can control what builtins are available to the executed code by inserting your own ``__builtins__`` dictionary into *globals* before passing it to :func:`eval`. If the *locals* mapping is omitted it defaults to the *globals* dictionary. If both mappings are omitted, the expression is executed with the *globals* and *locals* in the environment where :func:`eval` is called. Note, *eval()* will only have access to the :term:`nested scopes ` (non-locals) in the enclosing environment if they are already referenced in the scope that is calling :func:`eval` (e.g. via a :keyword:`nonlocal` statement)." -msgstr "" +#, fuzzy +msgid "" +"The *expression* argument is parsed and evaluated as a Python expression " +"(technically speaking, a condition list) using the *globals* and *locals* " +"mappings as global and local namespace. If the *globals* dictionary is " +"present and does not contain a value for the key ``__builtins__``, a " +"reference to the dictionary of the built-in module :mod:`builtins` is " +"inserted under that key before *expression* is parsed. That way you can " +"control what builtins are available to the executed code by inserting your " +"own ``__builtins__`` dictionary into *globals* before passing it to " +":func:`eval`. If the *locals* mapping is omitted it defaults to the " +"*globals* dictionary. If both mappings are omitted, the expression is " +"executed with the *globals* and *locals* in the environment where " +":func:`eval` is called. Note, *eval()* will only have access to the " +":term:`nested scopes ` (non-locals) in the enclosing " +"environment if they are already referenced in the scope that is calling " +":func:`eval` (e.g. via a :keyword:`nonlocal` statement)." +msgstr "" +"آرگومان *expression* با استفاده از نگاشت *globals* و *locals* به عنوان فضای " +"نام سراسری و محلی به عنوان یک عبارت پایتون (از نظر فنی, لیست شرایط) تجزیه و " +"ارزیابی می شود. اگر فرهنگ لغت *globals* وجود داشته باشد و حاوی مقداری برای " +"کلید ``__builtins__`` نباشد، قبل از تجزیه *expression*، مرجعی به فرهنگ لغت " +"ماژول داخلی :mod:`builtins` در زیر آن کلید درج می شود. به این ترتیب می " +"توانید با وارد کردن فرهنگ لغت ``__builtins__`` خود در *globals* قبل از ارسال" +" آن به :func:`eval`، کنترل کنید که چه داخلی هایی برای کد اجرا شده در دسترس " +"هستند. اگر نگاشت *locals* حذف شود، به طور پیش فرض به فرهنگ لغت *globals* " +"تبدیل می شود. اگر هر دو نقشه برداری حذف شوند، عبارت با *globals* و *locals*" +" در محیطی که :func:`eval` فراخوانی می شود اجرا می شود. توجه داشته باشید، " +"*eval()* تنها در صورتی به :term:`nested scopes ` (غیر محلی) در" +" محیط محصور دسترسی خواهد داشت که قبلاً در محدوده ای که :func:`eval` را " +"فراخوانی می کند ارجاع داده شده باشد (مثلاً از طریق یک عبارت " +":keyword:`nonlocal`)." #: library/functions.rst:612 +#, fuzzy msgid "Example:" -msgstr "" +msgstr "مثال:" #: library/functions.rst:618 -msgid "This function can also be used to execute arbitrary code objects (such as those created by :func:`compile`). In this case, pass a code object instead of a string. If the code object has been compiled with ``'exec'`` as the *mode* argument, :func:`eval`\\'s return value will be ``None``." +#, fuzzy +msgid "" +"This function can also be used to execute arbitrary code objects (such as " +"those created by :func:`compile`). In this case, pass a code object instead" +" of a string. If the code object has been compiled with ``'exec'`` as the " +"*mode* argument, :func:`eval`\\'s return value will be ``None``." msgstr "" +"این تابع همچنین می تواند برای اجرای اشیاء کد دلخواه (مانند موارد ایجاد شده " +"توسط :func:`compile`) استفاده شود. در این حالت به جای رشته، یک شی کد ارسال " +"کنید. اگر شی کد با ``'exec'`` به عنوان آرگومان *mode* کامپایل شده باشد، " +"مقدار بازگشتی :func:`eval` ``None`` خواهد بود." #: library/functions.rst:623 -msgid "Hints: dynamic execution of statements is supported by the :func:`exec` function. The :func:`globals` and :func:`locals` functions return the current global and local dictionary, respectively, which may be useful to pass around for use by :func:`eval` or :func:`exec`." +#, fuzzy +msgid "" +"Hints: dynamic execution of statements is supported by the :func:`exec` " +"function. The :func:`globals` and :func:`locals` functions return the " +"current global and local dictionary, respectively, which may be useful to " +"pass around for use by :func:`eval` or :func:`exec`." msgstr "" +"نکات: اجرای پویا عبارات توسط تابع :func:`exec` پشتیبانی می شود. توابع " +":func:`globals` و :func:`locals` به ترتیب فرهنگ لغت جهانی و محلی فعلی را " +"برمی گرداند که ممکن است برای استفاده توسط :func:`eval` یا :func:`exec` مفید " +"باشد." #: library/functions.rst:628 -msgid "If the given source is a string, then leading and trailing spaces and tabs are stripped." +#, fuzzy +msgid "" +"If the given source is a string, then leading and trailing spaces and tabs " +"are stripped." msgstr "" +"اگر منبع داده شده یک رشته باشد، فضاها و زبانه های پیشرو و انتهایی حذف می " +"شوند." #: library/functions.rst:631 -msgid "See :func:`ast.literal_eval` for a function that can safely evaluate strings with expressions containing only literals." +#, fuzzy +msgid "" +"See :func:`ast.literal_eval` for a function that can safely evaluate strings" +" with expressions containing only literals." msgstr "" +":func:`ast.literal_eval` را برای تابعی که می تواند به طور ایمن رشته ها را با" +" عباراتی که فقط حاوی لفظ هستند، ارزیابی کند، ببینید." -#: library/functions.rst:634 -#: library/functions.rst:636 -#: library/functions.rst:696 -#: library/functions.rst:698 -msgid "Raises an :ref:`auditing event ` ``exec`` with the code object as the argument. Code compilation events may also be raised." +#: library/functions.rst:634 library/functions.rst:636 +#: library/functions.rst:696 library/functions.rst:698 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``exec`` with the code object as " +"the argument. Code compilation events may also be raised." msgstr "" +"یک :ref:`auditing event ` ``exec`` را با شی کد به عنوان آرگومان " +"افزایش می دهد. رویدادهای تدوین کد نیز ممکن است مطرح شود." -#: library/functions.rst:641 -#: library/functions.rst:718 +#: library/functions.rst:641 library/functions.rst:718 +#, fuzzy msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "" +"آرگومان های *globals* و *locals* اکنون می توانند به عنوان کلمات کلیدی ارسال " +"شوند." -#: library/functions.rst:645 -#: library/functions.rst:722 -msgid "The semantics of the default *locals* namespace have been adjusted as described for the :func:`locals` builtin." +#: library/functions.rst:645 library/functions.rst:722 +#, fuzzy +msgid "" +"The semantics of the default *locals* namespace have been adjusted as " +"described for the :func:`locals` builtin." msgstr "" +"معنای فضای نام پیش‌فرض *locals* همانطور که برای داخلی :func:`locals` توضیح " +"داده شد تنظیم شده است." #: library/functions.rst:657 -msgid "This function supports dynamic execution of Python code. *source* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [#]_ If it is a code object, it is simply executed. In all cases, the code that's executed is expected to be valid as file input (see the section :ref:`file-input` in the Reference Manual). Be aware that the :keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may not be used outside of function definitions even within the context of code passed to the :func:`exec` function. The return value is ``None``." -msgstr "" +#, fuzzy +msgid "" +"This function supports dynamic execution of Python code. *source* must be " +"either a string or a code object. If it is a string, the string is parsed " +"as a suite of Python statements which is then executed (unless a syntax " +"error occurs). [#]_ If it is a code object, it is simply executed. In all " +"cases, the code that's executed is expected to be valid as file input (see " +"the section :ref:`file-input` in the Reference Manual). Be aware that the " +":keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may" +" not be used outside of function definitions even within the context of code" +" passed to the :func:`exec` function. The return value is ``None``." +msgstr "" +"این تابع از اجرای پویا کد پایتون پشتیبانی می کند. *source* باید یک رشته یا " +"یک شی کد باشد. اگر یک رشته باشد، رشته به عنوان مجموعه ای از عبارات پایتون " +"تجزیه می شود که سپس اجرا می شود (مگر اینکه یک خطای نحوی رخ دهد). [#]_ اگر یک" +" شی کد باشد، به سادگی اجرا می شود. در همه موارد، انتظار می رود کدی که اجرا " +"می شود به عنوان ورودی فایل معتبر باشد (به بخش :ref:`file-input` در کتابچه " +"راهنمای مرجع مراجعه کنید). توجه داشته باشید که دستورات :keyword:`nonlocal`، " +":keyword:`yield` و :keyword:`return` ممکن است خارج از تعاریف تابع حتی در " +"زمینه کد ارسال شده به تابع :func:`exec` مورد استفاده قرار نگیرند. مقدار " +"بازگشتی ``None`` است." #: library/functions.rst:668 -msgid "In all cases, if the optional parts are omitted, the code is executed in the current scope. If only *globals* is provided, it must be a dictionary (and not a subclass of dictionary), which will be used for both the global and the local variables. If *globals* and *locals* are given, they are used for the global and local variables, respectively. If provided, *locals* can be any mapping object. Remember that at the module level, globals and locals are the same dictionary." -msgstr "" +#, fuzzy +msgid "" +"In all cases, if the optional parts are omitted, the code is executed in the" +" current scope. If only *globals* is provided, it must be a dictionary (and" +" not a subclass of dictionary), which will be used for both the global and " +"the local variables. If *globals* and *locals* are given, they are used for" +" the global and local variables, respectively. If provided, *locals* can be" +" any mapping object. Remember that at the module level, globals and locals " +"are the same dictionary." +msgstr "" +"در تمام موارد، اگر قسمت های اختیاری حذف شوند، کد در محدوده فعلی اجرا می شود." +" اگر فقط *globals* ارائه شده باشد، باید یک فرهنگ لغت باشد (و نه زیر کلاس " +"فرهنگ لغت), که هم برای متغیرهای سراسری و هم برای متغیرهای محلی استفاده می " +"شود. اگر *globals* و *locals* داده شوند، به ترتیب برای متغیرهای سراسری و " +"محلی استفاده می شوند. در صورت ارائه، *locals* می تواند هر شی نگاشت باشد. " +"به یاد داشته باشید که در سطح ماژول، جهانی ها و محلی ها یک فرهنگ لغت هستند." #: library/functions.rst:678 -msgid "When ``exec`` gets two separate objects as *globals* and *locals*, the code will be executed as if it were embedded in a class definition. This means functions and classes defined in the executed code will not be able to access variables assigned at the top level (as the \"top level\" variables are treated as class variables in a class definition)." -msgstr "" +#, fuzzy +msgid "" +"When ``exec`` gets two separate objects as *globals* and *locals*, the code " +"will be executed as if it were embedded in a class definition. This means " +"functions and classes defined in the executed code will not be able to " +"access variables assigned at the top level (as the \"top level\" variables " +"are treated as class variables in a class definition)." +msgstr "" +"هنگامی که ``exec`` دو شی جداگانه به عنوان *globals* و *locals* دریافت می " +"کند، کد به گونه ای اجرا می شود که گویی در یک تعریف کلاس تعبیه شده است. این " +"بدان معناست که توابع و کلاس های تعریف شده در کد اجرا شده قادر به دسترسی به " +"متغیرهای اختصاص داده شده در سطح بالا نخواهند بود (زیرا متغیرهای \"سطح بالا\"" +" به عنوان متغیرهای کلاس در تعریف کلاس در نظر گرفته می شوند)." #: library/functions.rst:684 -msgid "If the *globals* dictionary does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key. That way you can control what builtins are available to the executed code by inserting your own ``__builtins__`` dictionary into *globals* before passing it to :func:`exec`." -msgstr "" +#, fuzzy +msgid "" +"If the *globals* dictionary does not contain a value for the key " +"``__builtins__``, a reference to the dictionary of the built-in module " +":mod:`builtins` is inserted under that key. That way you can control what " +"builtins are available to the executed code by inserting your own " +"``__builtins__`` dictionary into *globals* before passing it to " +":func:`exec`." +msgstr "" +"اگر فرهنگ لغت *globals* حاوی مقداری برای کلید ``__builtins__`` نباشد، مرجعی " +"به فرهنگ لغت ماژول داخلی :mod:`builtins` در زیر آن کلید درج می شود. به این " +"ترتیب می توانید با وارد کردن فرهنگ لغت ``__builtins__`` خود در *globals* قبل" +" از ارسال آن به :func:`exec`، کنترل کنید که چه داخلی هایی برای کد اجرا شده " +"در دسترس هستند." #: library/functions.rst:690 -msgid "The *closure* argument specifies a closure--a tuple of cellvars. It's only valid when the *object* is a code object containing :term:`free (closure) variables `. The length of the tuple must exactly match the length of the code object's :attr:`~codeobject.co_freevars` attribute." +#, fuzzy +msgid "" +"The *closure* argument specifies a closure--a tuple of cellvars. It's only " +"valid when the *object* is a code object containing :term:`free (closure) " +"variables `. The length of the tuple must exactly match " +"the length of the code object's :attr:`~codeobject.co_freevars` attribute." msgstr "" +"آرگومان *closure* یک بسته شدن را مشخص می‌کند - چند cellvar. فقط زمانی معتبر " +"است که *object* یک شی کد حاوی :term:`free (closure) variables ` باشد. طول تاپل باید دقیقاً با طول ویژگی " +":attr:`~codeobject.co_freevars` شی کد مطابقت داشته باشد." #: library/functions.rst:703 -msgid "The built-in functions :func:`globals` and :func:`locals` return the current global and local namespace, respectively, which may be useful to pass around for use as the second and third argument to :func:`exec`." +#, fuzzy +msgid "" +"The built-in functions :func:`globals` and :func:`locals` return the current" +" global and local namespace, respectively, which may be useful to pass " +"around for use as the second and third argument to :func:`exec`." msgstr "" +"توابع داخلی :func:`globals` و :func:`locals` به ترتیب فضای نام جهانی و محلی " +"فعلی را برمی‌گردانند که ممکن است برای استفاده به عنوان آرگومان دوم و سوم به " +":func:`exec` مفید باشد." #: library/functions.rst:709 -msgid "The default *locals* act as described for function :func:`locals` below. Pass an explicit *locals* dictionary if you need to see effects of the code on *locals* after function :func:`exec` returns." +#, fuzzy +msgid "" +"The default *locals* act as described for function :func:`locals` below. " +"Pass an explicit *locals* dictionary if you need to see effects of the code " +"on *locals* after function :func:`exec` returns." msgstr "" +"پیش فرض *locals* همانطور که برای عملکرد :func:`locals` در زیر توضیح داده شده" +" است عمل می کند. اگر نیاز به دیدن اثرات کد بر روی *locals* پس از بازگشت تابع" +" :func:`exec` دارید، یک فرهنگ لغت صریح *locals* را ارسال کنید." #: library/functions.rst:713 +#, fuzzy msgid "Added the *closure* parameter." -msgstr "" +msgstr "پارامتر *closure* اضافه شد." #: library/functions.rst:728 -msgid "Construct an iterator from those elements of *iterable* for which *function* is true. *iterable* may be either a sequence, a container which supports iteration, or an iterator. If *function* is ``None``, the identity function is assumed, that is, all elements of *iterable* that are false are removed." +#, fuzzy +msgid "" +"Construct an iterator from those elements of *iterable* for which *function*" +" is true. *iterable* may be either a sequence, a container which supports " +"iteration, or an iterator. If *function* is ``None``, the identity function" +" is assumed, that is, all elements of *iterable* that are false are removed." msgstr "" +"یک تکرار کننده از آن عناصر *iterable* بسازید که *function* برای آنها درست " +"است. *iterable* ممکن است یک دنباله باشد، یک ظرف که از تکرار پشتیبانی می " +"کند، یا یک تکرار. اگر *function* ``None`` باشد، تابع هویت فرض می شود، یعنی " +"تمام عناصر *iterable* که false هستند حذف می شوند." #: library/functions.rst:734 -msgid "Note that ``filter(function, iterable)`` is equivalent to the generator expression ``(item for item in iterable if function(item))`` if function is not ``None`` and ``(item for item in iterable if item)`` if function is ``None``." +#, fuzzy +msgid "" +"Note that ``filter(function, iterable)`` is equivalent to the generator " +"expression ``(item for item in iterable if function(item))`` if function is " +"not ``None`` and ``(item for item in iterable if item)`` if function is " +"``None``." msgstr "" +"توجه داشته باشید که ``filter(function, iterable)`` معادل عبارت ژنراتور " +"``(item for item in iterable if function(item))`` است اگر تابع ``None`` " +"نباشد و ``(item for item in iterable if item)`` اگر تابع ``None`` باشد." #: library/functions.rst:739 -msgid "See :func:`itertools.filterfalse` for the complementary function that returns elements of *iterable* for which *function* is false." +#, fuzzy +msgid "" +"See :func:`itertools.filterfalse` for the complementary function that " +"returns elements of *iterable* for which *function* is false." msgstr "" +"برای تابع مکملی که عناصر *iterable* را که *function* نادرست است، به " +":func:`itertools.filterfalse` برمی گرداند." #: library/functions.rst:750 +#, fuzzy msgid "Return a floating-point number constructed from a number or a string." -msgstr "" +msgstr "یک عدد ممیز شناور ساخته شده از یک عدد یا یک رشته را برگردانید." #: library/functions.rst:754 -msgid ">>> float('+1.23')\n" +#, fuzzy +msgid "" +">>> float('+1.23')\n" "1.23\n" ">>> float(' -12345\\n')\n" "-12345.0\n" @@ -904,158 +1768,410 @@ msgid ">>> float('+1.23')\n" ">>> float('-Infinity')\n" "-inf" msgstr "" +">>> float('+1.23')\n" +"1.23\n" +">>> float(' -12345\\n')\n" +"-12345.0\n" +">>> float('1e-003')\n" +"0.001\n" +">>> float('+1E6')\n" +"1000000.0\n" +">>> float('-Infinity')\n" +"-inf" #: library/functions.rst:767 -msgid "If the argument is a string, it should contain a decimal number, optionally preceded by a sign, and optionally embedded in whitespace. The optional sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value produced. The argument may also be a string representing a NaN (not-a-number), or positive or negative infinity. More precisely, the input must conform to the :token:`~float:floatvalue` production rule in the following grammar, after leading and trailing whitespace characters are removed:" -msgstr "" +#, fuzzy +msgid "" +"If the argument is a string, it should contain a decimal number, optionally " +"preceded by a sign, and optionally embedded in whitespace. The optional " +"sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value " +"produced. The argument may also be a string representing a NaN (not-a-" +"number), or positive or negative infinity. More precisely, the input must " +"conform to the :token:`~float:floatvalue` production rule in the following " +"grammar, after leading and trailing whitespace characters are removed:" +msgstr "" +"اگر آرگومان یک رشته باشد، باید دارای یک عدد اعشاری باشد که به صورت اختیاری " +"قبل از یک علامت، و به صورت اختیاری در فضای خالی تعبیه شده است. علامت " +"اختیاری ممکن است ``'+'`` یا ``'-'`` باشد. علامت ``'+'`` هیچ تاثیری بر مقدار " +"تولید شده ندارد. آرگومان ممکن است رشته ای باشد که یک NaN (عدد نیست) یا بی " +"نهایت مثبت یا منفی را نشان می دهد. به‌طور دقیق‌تر، ورودی باید با قانون تولید" +" :token:`~float:floatvalue` در گرامر زیر مطابقت داشته باشد، پس از حذف " +"کاراکترهای فضای خالی اصلی و انتهایی:" #: library/functions.rst:788 -msgid "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", and \"iNfINity\" are all acceptable spellings for positive infinity." +#, fuzzy +msgid "" +"Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " +"and \"iNfINity\" are all acceptable spellings for positive infinity." msgstr "" +"حروف بزرگ و کوچک معنادار نیست، بنابراین، برای مثال، «inf»، «Inf»، «INFINITY»" +" و «iNfINity» همه املای قابل قبولی برای بی‌نهایت مثبت هستند." #: library/functions.rst:791 -msgid "Otherwise, if the argument is an integer or a floating-point number, a floating-point number with the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` will be raised." +#, fuzzy +msgid "" +"Otherwise, if the argument is an integer or a floating-point number, a " +"floating-point number with the same value (within Python's floating-point " +"precision) is returned. If the argument is outside the range of a Python " +"float, an :exc:`OverflowError` will be raised." msgstr "" +"در غیر این صورت، اگر آرگومان یک عدد صحیح یا یک عدد ممیز شناور باشد، یک عدد " +"ممیز شناور با همان مقدار (در محدوده دقت ممیز شناور پایتون) برگردانده می‌شود." +" اگر آرگومان خارج از محدوده یک شناور پایتون باشد، یک :exc:`OverflowError` " +"بالا می رود." #: library/functions.rst:796 -msgid "For a general Python object ``x``, ``float(x)`` delegates to ``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls back to :meth:`~object.__index__`." +#, fuzzy +msgid "" +"For a general Python object ``x``, ``float(x)`` delegates to " +"``x.__float__()``. If :meth:`~object.__float__` is not defined then it " +"falls back to :meth:`~object.__index__`." msgstr "" +"برای یک شیء عمومی پایتون ``x``، ``float(x)`` به ``x.__float__()`` واگذار می " +"شود. اگر :meth:`~object.__float__` تعریف نشده باشد، به " +":meth:`~object.__index__` برمی گردد." #: library/functions.rst:800 +#, fuzzy msgid "If no argument is given, ``0.0`` is returned." -msgstr "" +msgstr "اگر آرگومان داده نشود، ``0.0`` برگردانده می شود." #: library/functions.rst:802 +#, fuzzy msgid "The float type is described in :ref:`typesnumeric`." -msgstr "" +msgstr "نوع شناور در :ref:`typesnumeric` توضیح داده شده است." #: library/functions.rst:810 -msgid "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not defined." +#, fuzzy +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " +"defined." msgstr "" +"اگر :meth:`~object.__float__` تعریف نشده باشد به :meth:`~object.__index__` " +"برمی گردد." #: library/functions.rst:820 -msgid "Convert a *value* to a \"formatted\" representation, as controlled by *format_spec*. The interpretation of *format_spec* will depend on the type of the *value* argument; however, there is a standard formatting syntax that is used by most built-in types: :ref:`formatspec`." +#, fuzzy +msgid "" +"Convert a *value* to a \"formatted\" representation, as controlled by " +"*format_spec*. The interpretation of *format_spec* will depend on the type " +"of the *value* argument; however, there is a standard formatting syntax that" +" is used by most built-in types: :ref:`formatspec`." msgstr "" +"یک *value* را به یک نمایش \"قالب‌بندی شده\" که توسط *format_spec* کنترل " +"می‌شود، تبدیل کنید. تفسیر *format_spec* به نوع آرگومان *value* بستگی دارد. " +"با این حال، یک نحو قالب بندی استاندارد وجود دارد که توسط اکثر انواع داخلی " +"استفاده می شود: :ref:`formatspec`." #: library/functions.rst:825 -msgid "The default *format_spec* is an empty string which usually gives the same effect as calling :func:`str(value) `." +#, fuzzy +msgid "" +"The default *format_spec* is an empty string which usually gives the same " +"effect as calling :func:`str(value) `." msgstr "" +"*format_spec* پیش‌فرض یک رشته خالی است که معمولاً همان جلوه فراخوانی " +":func:`str(value) ` را می‌دهد." #: library/functions.rst:828 -msgid "A call to ``format(value, format_spec)`` is translated to ``type(value).__format__(value, format_spec)`` which bypasses the instance dictionary when searching for the value's :meth:`~object.__format__` method. A :exc:`TypeError` exception is raised if the method search reaches :mod:`object` and the *format_spec* is non-empty, or if either the *format_spec* or the return value are not strings." -msgstr "" +#, fuzzy +msgid "" +"A call to ``format(value, format_spec)`` is translated to " +"``type(value).__format__(value, format_spec)`` which bypasses the instance " +"dictionary when searching for the value's :meth:`~object.__format__` method." +" A :exc:`TypeError` exception is raised if the method search reaches " +":mod:`object` and the *format_spec* is non-empty, or if either the " +"*format_spec* or the return value are not strings." +msgstr "" +"تماس با ``format(value, format_spec)`` به ``type(value).__format__(value, " +"format_spec)`` ترجمه می شود که هنگام جستجوی روش :meth:`~object.__format__` " +"مقدار، فرهنگ لغت نمونه را دور می زند. اگر جستجوی روش به :mod:`object` برسد و" +" *format_spec* خالی نباشد، یا اگر *format_spec* یا مقدار بازگشتی رشته ای " +"نباشند، یک استثنا :exc:`TypeError` ایجاد می شود." #: library/functions.rst:835 -msgid "``object().__format__(format_spec)`` raises :exc:`TypeError` if *format_spec* is not an empty string." +#, fuzzy +msgid "" +"``object().__format__(format_spec)`` raises :exc:`TypeError` if " +"*format_spec* is not an empty string." msgstr "" +"اگر *format_spec* یک رشته خالی نباشد، ``object().__format__(format_spec)`` " +":exc:`TypeError` را افزایش می دهد." #: library/functions.rst:844 -msgid "Return a new :class:`frozenset` object, optionally with elements taken from *iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :ref:`types-set` for documentation about this class." +#, fuzzy +msgid "" +"Return a new :class:`frozenset` object, optionally with elements taken from " +"*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and " +":ref:`types-set` for documentation about this class." msgstr "" +"یک شی :class:`frozenset` جدید، به صورت اختیاری با عناصر گرفته شده از " +"*iterable* برگردانید. ``frozenset`` یک کلاس داخلی است. برای مستندات مربوط " +"به این کلاس به :class:`frozenset` و :ref:`types-set` مراجعه کنید." #: library/functions.rst:848 -msgid "For other containers see the built-in :class:`set`, :class:`list`, :class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." +#, fuzzy +msgid "" +"For other containers see the built-in :class:`set`, :class:`list`, " +":class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections`" +" module." msgstr "" +"برای سایر کانتینرها به کلاس های داخلی :class:`set`، :class:`list`، " +":class:`tuple` و :class:`dict` و همچنین ماژول :mod:`collections` مراجعه " +"کنید." #: library/functions.rst:856 -msgid "Return the value of the named attribute of *object*. *name* must be a string. If the string is the name of one of the object's attributes, the result is the value of that attribute. For example, ``getattr(x, 'foobar')`` is equivalent to ``x.foobar``. If the named attribute does not exist, *default* is returned if provided, otherwise :exc:`AttributeError` is raised. *name* need not be a Python identifier (see :func:`setattr`)." -msgstr "" +#, fuzzy +msgid "" +"Return the value of the named attribute of *object*. *name* must be a " +"string. If the string is the name of one of the object's attributes, the " +"result is the value of that attribute. For example, ``getattr(x, " +"'foobar')`` is equivalent to ``x.foobar``. If the named attribute does not " +"exist, *default* is returned if provided, otherwise :exc:`AttributeError` is" +" raised. *name* need not be a Python identifier (see :func:`setattr`)." +msgstr "" +"مقدار مشخصه نامگذاری شده *object* را برگردانید. *name* باید یک رشته باشد. " +"اگر رشته نام یکی از ویژگی های شی باشد، نتیجه مقدار آن ویژگی است. به عنوان " +"مثال، ``getattr(x, 'foobar')`` معادل ``x.foobar`` است. اگر ویژگی نامگذاری " +"شده وجود نداشته باشد، در صورت ارائه *default* برگردانده می شود، در غیر این " +"صورت :exc:`AttributeError` افزایش می یابد. *name* نباید یک شناسه پایتون باشد" +" (به :func:`setattr` مراجعه کنید)." #: library/functions.rst:865 -msgid "Since :ref:`private name mangling ` happens at compilation time, one must manually mangle a private attribute's (attributes with two leading underscores) name in order to retrieve it with :func:`getattr`." +#, fuzzy +msgid "" +"Since :ref:`private name mangling ` happens at " +"compilation time, one must manually mangle a private attribute's (attributes" +" with two leading underscores) name in order to retrieve it with " +":func:`getattr`." msgstr "" +"از آنجایی که :ref:`private name mangling ` در زمان " +"کامپایل اتفاق می افتد، برای بازیابی آن با :func:`getattr`، باید نام یک ویژگی" +" خصوصی (ویژگی ها با دو زیرخط اصلی) را به صورت دستی مخدوش کرد." #: library/functions.rst:873 -msgid "Return the dictionary implementing the current module namespace. For code within functions, this is set when the function is defined and remains the same regardless of where the function is called." +#, fuzzy +msgid "" +"Return the dictionary implementing the current module namespace. For code " +"within functions, this is set when the function is defined and remains the " +"same regardless of where the function is called." msgstr "" +"فرهنگ لغت اجرای فضای نام ماژول فعلی را برگردانید. برای کد درون توابع، زمانی " +"که تابع تعریف می‌شود، تنظیم می‌شود و بدون توجه به اینکه تابع کجا فراخوانی " +"می‌شود، ثابت می‌ماند." #: library/functions.rst:880 -msgid "The arguments are an object and a string. The result is ``True`` if the string is the name of one of the object's attributes, ``False`` if not. (This is implemented by calling ``getattr(object, name)`` and seeing whether it raises an :exc:`AttributeError` or not.)" +#, fuzzy +msgid "" +"The arguments are an object and a string. The result is ``True`` if the " +"string is the name of one of the object's attributes, ``False`` if not. " +"(This is implemented by calling ``getattr(object, name)`` and seeing whether" +" it raises an :exc:`AttributeError` or not.)" msgstr "" +"آرگومان ها یک شی و یک رشته هستند. نتیجه ``True`` اگر رشته نام یکی از ویژگی " +"های شی باشد، ``False`` اگر نه. (این کار با فراخوانی ``getattr(object, " +"name)`` و دیدن اینکه آیا :exc:`AttributeError` را افزایش می دهد یا خیر اجرا " +"می شود.)" #: library/functions.rst:888 -msgid "Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys during a dictionary lookup. Numeric values that compare equal have the same hash value (even if they are of different types, as is the case for 1 and 1.0)." +#, fuzzy +msgid "" +"Return the hash value of the object (if it has one). Hash values are " +"integers. They are used to quickly compare dictionary keys during a " +"dictionary lookup. Numeric values that compare equal have the same hash " +"value (even if they are of different types, as is the case for 1 and 1.0)." msgstr "" +"مقدار هش شیء را برگردانید (اگر دارای یکی باشد). مقادیر هش اعداد صحیح هستند." +" آنها برای مقایسه سریع کلیدهای فرهنگ لغت در طول جستجوی فرهنگ لغت استفاده می" +" شوند. مقادیر عددی که با هم مقایسه می‌کنند، مقدار هش یکسانی دارند (حتی اگر " +"از انواع مختلف باشند, همانطور که در مورد 1 و 1.0 وجود دارد)." #: library/functions.rst:895 -msgid "For objects with custom :meth:`~object.__hash__` methods, note that :func:`hash` truncates the return value based on the bit width of the host machine." +#, fuzzy +msgid "" +"For objects with custom :meth:`~object.__hash__` methods, note that " +":func:`hash` truncates the return value based on the bit width of the host " +"machine." msgstr "" +"برای اشیا با متدهای سفارشی :meth:`~object.__hash__`، توجه داشته باشید که " +":func:`hash` مقدار بازگشتی را بر اساس عرض بیت دستگاه میزبان کوتاه می‌کند." #: library/functions.rst:902 -msgid "Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated." -msgstr "" +#, fuzzy +msgid "" +"Invoke the built-in help system. (This function is intended for interactive" +" use.) If no argument is given, the interactive help system starts on the " +"interpreter console. If the argument is a string, then the string is looked" +" up as the name of a module, function, class, method, keyword, or " +"documentation topic, and a help page is printed on the console. If the " +"argument is any other kind of object, a help page on the object is " +"generated." +msgstr "" +"سیستم کمک داخلی را فراخوانی کنید. (این تابع برای استفاده تعاملی در نظر " +"گرفته شده است.) اگر هیچ آرگومانی داده نشود، سیستم کمک تعاملی در کنسول مفسر " +"شروع می شود. اگر آرگومان یک رشته باشد، رشته به عنوان نام ماژول، تابع، کلاس،" +" متد، کلمه کلیدی یا موضوع مستندسازی جستجو می‌شود و یک صفحه راهنما روی کنسول " +"چاپ می‌شود. اگر آرگومان هر نوع شی دیگری باشد، یک صفحه راهنما روی شی ایجاد " +"می شود." #: library/functions.rst:909 -msgid "Note that if a slash(/) appears in the parameter list of a function when invoking :func:`help`, it means that the parameters prior to the slash are positional-only. For more info, see :ref:`the FAQ entry on positional-only parameters `." +#, fuzzy +msgid "" +"Note that if a slash(/) appears in the parameter list of a function when " +"invoking :func:`help`, it means that the parameters prior to the slash are " +"positional-only. For more info, see :ref:`the FAQ entry on positional-only " +"parameters `." msgstr "" +"توجه داشته باشید که اگر هنگام فراخوانی :func:`help` یک اسلش(/) در لیست " +"پارامترهای یک تابع ظاهر شود، به این معنی است که پارامترهای قبل از اسلش فقط " +"موقعیتی هستند. برای اطلاعات بیشتر به :ref:`the FAQ entry on positional-only " +"parameters ` مراجعه کنید." #: library/functions.rst:914 -msgid "This function is added to the built-in namespace by the :mod:`site` module." -msgstr "" +#, fuzzy +msgid "" +"This function is added to the built-in namespace by the :mod:`site` module." +msgstr "این تابع توسط ماژول :mod:`site` به فضای نام داخلی اضافه شده است." #: library/functions.rst:916 -msgid "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures for callables are now more comprehensive and consistent." +#, fuzzy +msgid "" +"Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures" +" for callables are now more comprehensive and consistent." msgstr "" +"تغییرات :mod:`pydoc` و :mod:`inspect` به این معنی است که امضاهای گزارش‌شده " +"برای تماس‌پذیرها اکنون جامع‌تر و سازگارتر هستند." #: library/functions.rst:923 -msgid "Convert an integer number to a lowercase hexadecimal string prefixed with \"0x\". If *x* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. Some examples:" +#, fuzzy +msgid "" +"Convert an integer number to a lowercase hexadecimal string prefixed with " +"\"0x\". If *x* is not a Python :class:`int` object, it has to define an " +":meth:`~object.__index__` method that returns an integer. Some examples:" msgstr "" +"یک عدد صحیح را به یک رشته هگزادسیمال با حروف کوچک با پیشوند \"0x\" تبدیل " +"کنید. اگر *x* یک شی پایتون :class:`int` نیست، باید یک متد " +":meth:`~object.__index__` تعریف کند که یک عدد صحیح برمی گرداند. چند نمونه:" #: library/functions.rst:932 -msgid "If you want to convert an integer number to an uppercase or lower hexadecimal string with prefix or not, you can use either of the following ways:" +#, fuzzy +msgid "" +"If you want to convert an integer number to an uppercase or lower " +"hexadecimal string with prefix or not, you can use either of the following " +"ways:" msgstr "" +"اگر می خواهید یک عدد صحیح را با پیشوند یا نه به یک رشته هگزادسیمال بزرگ یا " +"کوچک تبدیل کنید، می توانید از یکی از راه های زیر استفاده کنید:" #: library/functions.rst:944 -msgid "See also :func:`int` for converting a hexadecimal string to an integer using a base of 16." +#, fuzzy +msgid "" +"See also :func:`int` for converting a hexadecimal string to an integer using" +" a base of 16." msgstr "" +"همچنین :func:`int` را برای تبدیل رشته هگزا دسیمال به عدد صحیح با استفاده از " +"پایه 16 ببینید." #: library/functions.rst:949 -msgid "To obtain a hexadecimal string representation for a float, use the :meth:`float.hex` method." +#, fuzzy +msgid "" +"To obtain a hexadecimal string representation for a float, use the " +":meth:`float.hex` method." msgstr "" +"برای به دست آوردن نمایش رشته هگزادسیمال برای یک شناور، از روش " +":meth:`float.hex` استفاده کنید." #: library/functions.rst:955 -msgid "Return the \"identity\" of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same :func:`id` value." +#, fuzzy +msgid "" +"Return the \"identity\" of an object. This is an integer which is " +"guaranteed to be unique and constant for this object during its lifetime. " +"Two objects with non-overlapping lifetimes may have the same :func:`id` " +"value." msgstr "" +"\"هویت\" یک شی را برگردانید. این یک عدد صحیح است که تضمین می شود برای این " +"شی در طول عمر خود منحصر به فرد و ثابت باشد. دو شی با طول عمر غیر همپوشانی " +"ممکن است مقدار :func:`id` یکسانی داشته باشند." #: library/functions.rst:960 +#, fuzzy msgid "This is the address of the object in memory." -msgstr "" +msgstr "این آدرس شی در حافظه است." #: library/functions.rst:962 -msgid "Raises an :ref:`auditing event ` ``builtins.id`` with argument ``id``." +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``builtins.id`` with argument " +"``id``." msgstr "" +"یک :ref:`auditing event ` ``builtins.id`` را با آرگومان ``id`` " +"افزایش می دهد." #: library/functions.rst:968 -msgid "If the *prompt* argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, :exc:`EOFError` is raised. Example::" +#, fuzzy +msgid "" +"If the *prompt* argument is present, it is written to standard output " +"without a trailing newline. The function then reads a line from input, " +"converts it to a string (stripping a trailing newline), and returns that. " +"When EOF is read, :exc:`EOFError` is raised. Example::" msgstr "" +"اگر آرگومان *prompt* وجود داشته باشد، بدون خط جدید در خروجی استاندارد نوشته " +"می شود. سپس این تابع یک خط را از ورودی می‌خواند، آن را به یک رشته تبدیل " +"می‌کند (یک خط جدید دنباله‌دار را حذف می‌کند), و آن را برمی‌گرداند. وقتی EOF" +" خوانده می شود، :exc:`EOFError` بالا می رود. مثال::" #: library/functions.rst:973 -msgid ">>> s = input('--> ') \n" +#, fuzzy +msgid "" +">>> s = input('--> ') \n" "--> Monty Python's Flying Circus\n" ">>> s \n" "\"Monty Python's Flying Circus\"" msgstr "" +">>> s = ورودی ('--> ') \n" +"--> سیرک پرواز مونتی پایتون\n" +">>> س \n" +"\"سیرک پرنده مونتی پایتون\"" #: library/functions.rst:978 -msgid "If the :mod:`readline` module was loaded, then :func:`input` will use it to provide elaborate line editing and history features." +#, fuzzy +msgid "" +"If the :mod:`readline` module was loaded, then :func:`input` will use it to " +"provide elaborate line editing and history features." msgstr "" +"اگر ماژول :mod:`readline` بارگذاری شده باشد، :func:`input` از آن برای ارائه " +"ویژگی‌های ویرایش خط و تاریخچه دقیق استفاده می‌کند." -#: library/functions.rst:981 -#: library/functions.rst:983 -msgid "Raises an :ref:`auditing event ` ``builtins.input`` with argument ``prompt`` before reading input" +#: library/functions.rst:981 library/functions.rst:983 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``builtins.input`` with argument " +"``prompt`` before reading input" msgstr "" +"قبل از خواندن ورودی، یک :ref:`auditing event ` ``builtins.input`` " +"را با آرگومان ``prompt`` افزایش می دهد." -#: library/functions.rst:986 -#: library/functions.rst:988 -msgid "Raises an :ref:`auditing event ` ``builtins.input/result`` with the result after successfully reading input." +#: library/functions.rst:986 library/functions.rst:988 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``builtins.input/result`` with " +"the result after successfully reading input." msgstr "" +"پس از خواندن موفقیت آمیز ورودی، یک :ref:`auditing event ` " +"``builtins.input/result`` را با نتیجه بالا می برد." #: library/functions.rst:995 -msgid "Return an integer object constructed from a number or a string, or return ``0`` if no arguments are given." +#, fuzzy +msgid "" +"Return an integer object constructed from a number or a string, or return " +"``0`` if no arguments are given." msgstr "" +"یک شی عدد صحیح ساخته شده از یک عدد یا یک رشته را برگردانید، یا اگر آرگومان " +"داده نشد، ``0`` را برگردانید." #: library/functions.rst:1000 -msgid ">>> int(123.45)\n" +#, fuzzy +msgid "" +">>> int(123.45)\n" "123\n" ">>> int('123')\n" "123\n" @@ -1068,361 +2184,964 @@ msgid ">>> int(123.45)\n" ">>> int('01110011', base=2)\n" "115" msgstr "" +">>> int(123.45)\n" +"123\n" +">>> int('123')\n" +"123\n" +">>> int(' -12_345\\n')\n" +"-12345\n" +">>> int('FACE', 16)\n" +"64206\n" +">>> int('0xface', 0)\n" +"64206\n" +">>> int('01110011', base=2)\n" +"115" #: library/functions.rst:1015 -msgid "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x.__int__()``. If the argument defines :meth:`~object.__index__`, it returns ``x.__index__()``. If the argument defines :meth:`~object.__trunc__`, it returns ``x.__trunc__()``. For floating-point numbers, this truncates towards zero." -msgstr "" +#, fuzzy +msgid "" +"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns " +"``x.__int__()``. If the argument defines :meth:`~object.__index__`, it " +"returns ``x.__index__()``. If the argument defines " +":meth:`~object.__trunc__`, it returns ``x.__trunc__()``. For floating-point " +"numbers, this truncates towards zero." +msgstr "" +"اگر آرگومان :meth:`~object.__int__` را تعریف کند، ``int(x)`` ``x.__int__()``" +" را برمی گرداند. اگر آرگومان :meth:`~object.__index__` را تعریف کند، " +"``x.__index__()`` را برمی گرداند. اگر آرگومان :meth:`~object.__trunc__` را " +"تعریف کند، ``x.__trunc__()`` را برمی گرداند. برای اعداد ممیز شناور، این به " +"سمت صفر کوتاه می شود." #: library/functions.rst:1021 -msgid "If the argument is not a number or if *base* is given, then it must be a string, :class:`bytes`, or :class:`bytearray` instance representing an integer in radix *base*. Optionally, the string can be preceded by ``+`` or ``-`` (with no space in between), have leading zeros, be surrounded by whitespace, and have single underscores interspersed between digits." -msgstr "" +#, fuzzy +msgid "" +"If the argument is not a number or if *base* is given, then it must be a " +"string, :class:`bytes`, or :class:`bytearray` instance representing an " +"integer in radix *base*. Optionally, the string can be preceded by ``+`` or" +" ``-`` (with no space in between), have leading zeros, be surrounded by " +"whitespace, and have single underscores interspersed between digits." +msgstr "" +"اگر آرگومان یک عدد نیست یا اگر *base* داده شده باشد، باید یک رشته، " +":class:`bytes` یا نمونه :class:`bytearray` باشد که یک عدد صحیح در ریشه " +"*base* را نشان می دهد. به صورت اختیاری، رشته می تواند با ``+`` یا ``-`` " +"(بدون فاصله در میان), دارای صفرهای ابتدایی باشد، با فضای خالی احاطه شده " +"باشد، و دارای زیرخط های منفرد در میان ارقام باشد." #: library/functions.rst:1027 -msgid "A base-n integer string contains digits, each representing a value from 0 to n-1. The values 0--9 can be represented by any Unicode decimal digit. The values 10--35 can be represented by ``a`` to ``z`` (or ``A`` to ``Z``). The default *base* is 10. The allowed bases are 0 and 2--36. Base-2, -8, and -16 strings can be optionally prefixed with ``0b``/``0B``, ``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code. For base 0, the string is interpreted in a similar way to an :ref:`integer literal in code `, in that the actual base is 2, 8, 10, or 16 as determined by the prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, while ``int('010')`` and ``int('010', 8)`` are." -msgstr "" +#, fuzzy +msgid "" +"A base-n integer string contains digits, each representing a value from 0 to" +" n-1. The values 0--9 can be represented by any Unicode decimal digit. The " +"values 10--35 can be represented by ``a`` to ``z`` (or ``A`` to ``Z``). The " +"default *base* is 10. The allowed bases are 0 and 2--36. Base-2, -8, and -16" +" strings can be optionally prefixed with ``0b``/``0B``, ``0o``/``0O``, or " +"``0x``/``0X``, as with integer literals in code. For base 0, the string is " +"interpreted in a similar way to an :ref:`integer literal in code " +"`, in that the actual base is 2, 8, 10, or 16 as determined by the" +" prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not " +"legal, while ``int('010')`` and ``int('010', 8)`` are." +msgstr "" +"یک رشته اعداد صحیح مبنا-n حاوی ارقامی است که هر یک مقداری از 0 تا n-1 را " +"نشان می دهد. مقادیر 0--9 را می توان با هر رقم اعشاری یونیکد نشان داد. مقادیر" +" 10--35 را می توان با ``a`` تا ``z`` (یا ``A`` تا ``Z``) نشان داد. پیش فرض " +"*base* 10 است. پایه های مجاز 0 و 2--36 هستند. رشته های Base-2، -8، و -16 را " +"می توان به صورت اختیاری با ``0b``/``0B``، ``0o``/``0O``، یا ``0x``/``0X`` " +"پیشوند، مانند حروف صحیح در کد. برای پایه 0، رشته به روشی مشابه با " +":ref:`integer literal in code ` تفسیر می شود، به این صورت که پایه " +"واقعی 2، 8، 10 یا 16 است که توسط پیشوند تعیین می شود. پایه 0 صفرهای ابتدایی " +"را نیز مجاز نمی داند: ``int('010', 0)`` قانونی نیست، در حالی که " +"``int('010')`` و ``int('010', 8)`` قانونی هستند." #: library/functions.rst:1038 +#, fuzzy msgid "The integer type is described in :ref:`typesnumeric`." -msgstr "" +msgstr "نوع عدد صحیح در :ref:`typesnumeric` توضیح داده شده است." #: library/functions.rst:1040 -msgid "If *base* is not an instance of :class:`int` and the *base* object has a :meth:`base.__index__ ` method, that method is called to obtain an integer for the base. Previous versions used :meth:`base.__int__ ` instead of :meth:`base.__index__ `." +#, fuzzy +msgid "" +"If *base* is not an instance of :class:`int` and the *base* object has a " +":meth:`base.__index__ ` method, that method is called to " +"obtain an integer for the base. Previous versions used :meth:`base.__int__ " +"` instead of :meth:`base.__index__ `." msgstr "" +"اگر *base* نمونه ای از :class:`int` نباشد و شی *base* دارای متد " +":meth:`base.__index__ ` باشد، آن متد برای بدست آوردن یک " +"عدد صحیح برای پایه فراخوانی می شود. نسخه های قبلی به جای " +":meth:`base.__index__ ` از :meth:`base.__int__ " +"` استفاده می کردند." #: library/functions.rst:1050 +#, fuzzy msgid "The first parameter is now positional-only." -msgstr "" +msgstr "پارامتر اول اکنون فقط موقعیتی است." #: library/functions.rst:1053 -msgid "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not defined." +#, fuzzy +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " +"defined." msgstr "" +"اگر :meth:`~object.__int__` تعریف نشده باشد به :meth:`~object.__index__` " +"برمی گردد." #: library/functions.rst:1056 +#, fuzzy msgid "The delegation to :meth:`~object.__trunc__` is deprecated." -msgstr "" +msgstr "تفویض اختیار به :meth:`~object.__trunc__` منسوخ شده است." #: library/functions.rst:1059 -msgid ":class:`int` string inputs and string representations can be limited to help avoid denial of service attacks. A :exc:`ValueError` is raised when the limit is exceeded while converting a string to an :class:`int` or when converting an :class:`int` into a string would exceed the limit. See the :ref:`integer string conversion length limitation ` documentation." -msgstr "" +#, fuzzy +msgid "" +":class:`int` string inputs and string representations can be limited to help" +" avoid denial of service attacks. A :exc:`ValueError` is raised when the " +"limit is exceeded while converting a string to an :class:`int` or when " +"converting an :class:`int` into a string would exceed the limit. See the " +":ref:`integer string conversion length limitation ` " +"documentation." +msgstr "" +"ورودی های رشته :class:`int` و نمایش رشته ها می توانند برای جلوگیری از حملات " +"انکار سرویس محدود شوند. یک :exc:`ValueError` زمانی افزایش می‌یابد که در حین " +"تبدیل رشته به :class:`int` از حد مجاز فراتر رود یا زمانی که تبدیل " +":class:`int` به رشته از حد مجاز فراتر رود. به مستندات :ref:`integer string " +"conversion length limitation ` مراجعه کنید." #: library/functions.rst:1069 -msgid "Return ``True`` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or :term:`virtual `) subclass thereof. If *object* is not an object of the given type, the function always returns ``False``. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a :ref:`types-union` of multiple types, return ``True`` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a :exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised for an invalid type if an earlier check succeeds." -msgstr "" - -#: library/functions.rst:1080 -#: library/functions.rst:1094 +#, fuzzy +msgid "" +"Return ``True`` if the *object* argument is an instance of the *classinfo* " +"argument, or of a (direct, indirect, or :term:`virtual `) subclass thereof. If *object* is not an object of the given type, " +"the function always returns ``False``. If *classinfo* is a tuple of type " +"objects (or recursively, other such tuples) or a :ref:`types-union` of " +"multiple types, return ``True`` if *object* is an instance of any of the " +"types. If *classinfo* is not a type or tuple of types and such tuples, a " +":exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised for" +" an invalid type if an earlier check succeeds." +msgstr "" +"اگر آرگومان *object* نمونه ای از آرگومان *classinfo* یا زیر کلاس (مستقیم, " +"غیر مستقیم یا :term:`virtual `) آن باشد، ``True`` را " +"برگردانید. اگر *object* یک شی از نوع داده شده نباشد، تابع همیشه ``False`` " +"را برمی گرداند. اگر *classinfo* چند شیء از نوع (یا به صورت بازگشتی, تاپل های" +" دیگر) یا یک :ref:`types-union` از چندین نوع است، اگر *object* نمونه ای از " +"هر یک از انواع است، ``True`` را برگردانید. اگر *classinfo* یک نوع یا چند " +"تایی از انواع و چند تاپل نیست، یک استثنا :exc:`TypeError` مطرح می شود. در " +"صورت موفقیت آمیز بودن بررسی قبلی، :exc:`TypeError` ممکن است برای نوع نامعتبر" +" افزایش یابد." + +#: library/functions.rst:1080 library/functions.rst:1094 +#, fuzzy msgid "*classinfo* can be a :ref:`types-union`." -msgstr "" +msgstr "*classinfo* می تواند :ref:`types-union` باشد." #: library/functions.rst:1086 -msgid "Return ``True`` if *class* is a subclass (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a subclass of itself. *classinfo* may be a tuple of class objects (or recursively, other such tuples) or a :ref:`types-union`, in which case return ``True`` if *class* is a subclass of any entry in *classinfo*. In any other case, a :exc:`TypeError` exception is raised." -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if *class* is a subclass (direct, indirect, or " +":term:`virtual `) of *classinfo*. A class is " +"considered a subclass of itself. *classinfo* may be a tuple of class objects" +" (or recursively, other such tuples) or a :ref:`types-union`, in which case " +"return ``True`` if *class* is a subclass of any entry in *classinfo*. In " +"any other case, a :exc:`TypeError` exception is raised." +msgstr "" +"اگر *class* یک زیر کلاس (مستقیم, غیر مستقیم یا :term:`virtual `) از *classinfo* است، ``True`` را برگردانید. یک کلاس یک زیر کلاس از" +" خودش در نظر گرفته می شود. *classinfo* ممکن است مجموعه ای از اشیاء کلاس (یا " +"به صورت بازگشتی, تاپل های دیگر) یا یک :ref:`types-union` باشد، در این صورت " +"اگر *class* زیر کلاس هر ورودی در *classinfo* باشد، ``True`` را برگردانید. " +"در هر مورد دیگر، یک استثناء :exc:`TypeError` مطرح می شود." #: library/functions.rst:1101 -msgid "Return an :term:`iterator` object. The first argument is interpreted very differently depending on the presence of the second argument. Without a second argument, *object* must be a collection object which supports the :term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must support the sequence protocol (the :meth:`~object.__getitem__` method with integer arguments starting at ``0``). If it does not support either of those protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, is given, then *object* must be a callable object. The iterator created in this case will call *object* with no arguments for each call to its :meth:`~iterator.__next__` method; if the value returned is equal to *sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be returned." -msgstr "" +#, fuzzy +msgid "" +"Return an :term:`iterator` object. The first argument is interpreted very " +"differently depending on the presence of the second argument. Without a " +"second argument, *object* must be a collection object which supports the " +":term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must " +"support the sequence protocol (the :meth:`~object.__getitem__` method with " +"integer arguments starting at ``0``). If it does not support either of " +"those protocols, :exc:`TypeError` is raised. If the second argument, " +"*sentinel*, is given, then *object* must be a callable object. The iterator" +" created in this case will call *object* with no arguments for each call to " +"its :meth:`~iterator.__next__` method; if the value returned is equal to " +"*sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be" +" returned." +msgstr "" +"یک شی :term:`iterator` را برگردانید. استدلال اول بسته به وجود استدلال دوم " +"بسیار متفاوت تفسیر می شود. بدون آرگومان دوم، *object* باید یک شی مجموعه ای " +"باشد که از پروتکل :term:`iterable` (روش :meth:`~object.__iter__`) پشتیبانی " +"می کند، یا باید از پروتکل توالی پشتیبانی کند (روش " +":meth:`~object.__getitem__` با آرگومان های عدد صحیح که از ``0`` شروع می " +"شود). اگر هیچ یک از این پروتکل ها را پشتیبانی نکند، :exc:`TypeError` بالا " +"می رود. اگر آرگومان دوم، *sentinel* داده شود، *object* باید یک شی قابل " +"فراخوان باشد. تکرار کننده ایجاد شده در این مورد، *object* را بدون هیچ " +"آرگومانی برای هر فراخوانی متد :meth:`~iterator.__next__` فراخوانی می کند. " +"اگر مقدار بازگشتی برابر با *sentinel* باشد، :exc:`StopIteration` افزایش می " +"یابد، در غیر این صورت مقدار برگردانده می شود." #: library/functions.rst:1115 +#, fuzzy msgid "See also :ref:`typeiter`." -msgstr "" +msgstr "همچنین به :ref:`typeiter` مراجعه کنید." #: library/functions.rst:1117 -msgid "One useful application of the second form of :func:`iter` is to build a block-reader. For example, reading fixed-width blocks from a binary database file until the end of file is reached::" +#, fuzzy +msgid "" +"One useful application of the second form of :func:`iter` is to build a " +"block-reader. For example, reading fixed-width blocks from a binary database" +" file until the end of file is reached::" msgstr "" +"یکی از کاربردهای مفید فرم دوم :func:`iter` ساخت یک بلوک خوان است. به عنوان " +"مثال، خواندن بلوک های با عرض ثابت از یک فایل پایگاه داده باینری تا پایان " +"فایل:" #: library/functions.rst:1121 -msgid "from functools import partial\n" +#, fuzzy +msgid "" +"from functools import partial\n" "with open('mydata.db', 'rb') as f:\n" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" msgstr "" +"from functools import partial\n" +"with open('mydata.db', 'rb') as f:\n" +" for block in iter(partial(f.read, 64), b''):\n" +" process_block(block)" #: library/functions.rst:1129 -msgid "Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set)." +#, fuzzy +msgid "" +"Return the length (the number of items) of an object. The argument may be a" +" sequence (such as a string, bytes, tuple, list, or range) or a collection " +"(such as a dictionary, set, or frozen set)." msgstr "" +"طول (تعداد موارد) یک شی را برگردانید. آرگومان ممکن است یک دنباله (مانند یک " +"رشته, بایت, تاپل, لیست یا محدوده) یا یک مجموعه (مانند یک فرهنگ لغت, مجموعه, " +"یا مجموعه ثابت) باشد." #: library/functions.rst:1135 -msgid "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys.maxsize`, such as :class:`range(2 ** 100) `." +#, fuzzy +msgid "" +"``len`` raises :exc:`OverflowError` on lengths larger than " +":data:`sys.maxsize`, such as :class:`range(2 ** 100) `." msgstr "" +"``len`` :exc:`OverflowError` را در طول های بزرگتر از :data:`sys.maxsize` " +"مانند :class:`range(2 ** 100) ` افزایش می دهد." #: library/functions.rst:1144 -msgid "Rather than being a function, :class:`list` is actually a mutable sequence type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." +#, fuzzy +msgid "" +"Rather than being a function, :class:`list` is actually a mutable sequence " +"type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." msgstr "" +":class:`list` به جای اینکه یک تابع باشد، در واقع یک نوع توالی قابل تغییر " +"است، همانطور که در :ref:`typesseq-list` و :ref:`typesseq` مستند شده است." #: library/functions.rst:1150 -msgid "Return a mapping object representing the current local symbol table, with variable names as the keys, and their currently bound references as the values." +#, fuzzy +msgid "" +"Return a mapping object representing the current local symbol table, with " +"variable names as the keys, and their currently bound references as the " +"values." msgstr "" +"یک شی نگاشت نشان دهنده جدول نماد محلی فعلی، با نام متغیرها به عنوان کلید، و " +"ارجاعات محدود فعلی آنها به عنوان مقادیر، برگردانید." #: library/functions.rst:1154 -msgid "At module scope, as well as when using :func:`exec` or :func:`eval` with a single namespace, this function returns the same namespace as :func:`globals`." +#, fuzzy +msgid "" +"At module scope, as well as when using :func:`exec` or :func:`eval` with a " +"single namespace, this function returns the same namespace as " +":func:`globals`." msgstr "" +"در محدوده ماژول، و همچنین هنگام استفاده از :func:`exec` یا :func:`eval` با " +"یک فضای نام واحد، این تابع همان فضای نام :func:`globals` را برمی گرداند." #: library/functions.rst:1158 -msgid "At class scope, it returns the namespace that will be passed to the metaclass constructor." +#, fuzzy +msgid "" +"At class scope, it returns the namespace that will be passed to the " +"metaclass constructor." msgstr "" +"در محدوده کلاس، فضای نامی را که به سازنده متاکلاس ارسال می شود، برمی گرداند." #: library/functions.rst:1161 -msgid "When using ``exec()`` or ``eval()`` with separate local and global arguments, it returns the local namespace passed in to the function call." +#, fuzzy +msgid "" +"When using ``exec()`` or ``eval()`` with separate local and global " +"arguments, it returns the local namespace passed in to the function call." msgstr "" +"هنگام استفاده از ``exec()`` یا ``eval()`` با آرگومان های محلی و سراسری " +"جداگانه، فضای نام محلی ارسال شده به فراخوانی تابع را برمی گرداند." #: library/functions.rst:1164 -msgid "In all of the above cases, each call to ``locals()`` in a given frame of execution will return the *same* mapping object. Changes made through the mapping object returned from ``locals()`` will be visible as assigned, reassigned, or deleted local variables, and assigning, reassigning, or deleting local variables will immediately affect the contents of the returned mapping object." -msgstr "" +#, fuzzy +msgid "" +"In all of the above cases, each call to ``locals()`` in a given frame of " +"execution will return the *same* mapping object. Changes made through the " +"mapping object returned from ``locals()`` will be visible as assigned, " +"reassigned, or deleted local variables, and assigning, reassigning, or " +"deleting local variables will immediately affect the contents of the " +"returned mapping object." +msgstr "" +"در تمام موارد فوق، هر فراخوانی به ``locals()`` در یک فریم اجرای معین، شی " +"نگاشت *same* را برمی گرداند. تغییرات ایجاد شده از طریق شی نگاشت بازگشتی از " +"``locals()`` به عنوان متغیرهای محلی اختصاص داده شده، تخصیص مجدد یا حذف شده " +"قابل مشاهده خواهد بود و اختصاص، تخصیص مجدد یا حذف متغیرهای محلی بلافاصله بر " +"محتوای شی نگاشت برگشتی تأثیر می گذارد." #: library/functions.rst:1171 -msgid "In an :term:`optimized scope` (including functions, generators, and coroutines), each call to ``locals()`` instead returns a fresh dictionary containing the current bindings of the function's local variables and any nonlocal cell references. In this case, name binding changes made via the returned dict are *not* written back to the corresponding local variables or nonlocal cell references, and assigning, reassigning, or deleting local variables and nonlocal cell references does *not* affect the contents of previously returned dictionaries." -msgstr "" +#, fuzzy +msgid "" +"In an :term:`optimized scope` (including functions, generators, and " +"coroutines), each call to ``locals()`` instead returns a fresh dictionary " +"containing the current bindings of the function's local variables and any " +"nonlocal cell references. In this case, name binding changes made via the " +"returned dict are *not* written back to the corresponding local variables or" +" nonlocal cell references, and assigning, reassigning, or deleting local " +"variables and nonlocal cell references does *not* affect the contents of " +"previously returned dictionaries." +msgstr "" +"در یک :term:`optimized scope` (شامل توابع, ژنراتورها و برنامه‌های مشترک), هر" +" فراخوانی به ``locals()`` یک فرهنگ لغت جدید حاوی پیوندهای فعلی متغیرهای محلی" +" تابع و هر مرجع سلول غیرمحلی را برمی‌گرداند. در این مورد، تغییرات پیوند نام " +"که از طریق دیکت برگشتی انجام می‌شود به صورت *not* به متغیرهای محلی متناظر یا" +" مراجع سلول غیرمحلی نوشته می‌شود و تخصیص، تخصیص مجدد یا حذف متغیرهای محلی و " +"مراجع سلول غیرمحلی، *not* بر محتویات دیکشنری‌های قبلی برگردانده شده تأثیر " +"می‌گذارد." #: library/functions.rst:1180 -msgid "Calling ``locals()`` as part of a comprehension in a function, generator, or coroutine is equivalent to calling it in the containing scope, except that the comprehension's initialised iteration variables will be included. In other scopes, it behaves as if the comprehension were running as a nested function." +#, fuzzy +msgid "" +"Calling ``locals()`` as part of a comprehension in a function, generator, or" +" coroutine is equivalent to calling it in the containing scope, except that " +"the comprehension's initialised iteration variables will be included. In " +"other scopes, it behaves as if the comprehension were running as a nested " +"function." msgstr "" +"فراخوانی ``locals()`` به عنوان بخشی از درک مطلب در یک تابع، مولد، یا کوروتین" +" معادل فراخوانی آن در محدوده حاوی است، با این تفاوت که متغیرهای تکرار اولیه " +"درک مطلب شامل خواهند شد. در حوزه های دیگر، به گونه ای رفتار می کند که گویی " +"درک مطلب به عنوان یک تابع تودرتو اجرا می شود." #: library/functions.rst:1186 -msgid "Calling ``locals()`` as part of a generator expression is equivalent to calling it in a nested generator function." +#, fuzzy +msgid "" +"Calling ``locals()`` as part of a generator expression is equivalent to " +"calling it in a nested generator function." msgstr "" +"فراخوانی ``locals()`` به عنوان بخشی از عبارت مولد معادل فراخوانی آن در یک " +"تابع ژنراتور تو در تو است." #: library/functions.rst:1189 -msgid "The behaviour of ``locals()`` in a comprehension has been updated as described in :pep:`709`." +#, fuzzy +msgid "" +"The behaviour of ``locals()`` in a comprehension has been updated as " +"described in :pep:`709`." msgstr "" +"رفتار ``locals()`` در درک مطلب همانطور که در :pep:`709` توضیح داده شده است " +"به روز شده است." #: library/functions.rst:1193 -msgid "As part of :pep:`667`, the semantics of mutating the mapping objects returned from this function are now defined. The behavior in :term:`optimized scopes ` is now as described above. Aside from being defined, the behaviour in other scopes remains unchanged from previous versions." +#, fuzzy +msgid "" +"As part of :pep:`667`, the semantics of mutating the mapping objects " +"returned from this function are now defined. The behavior in " +":term:`optimized scopes ` is now as described above. Aside " +"from being defined, the behaviour in other scopes remains unchanged from " +"previous versions." msgstr "" +"به عنوان بخشی از :pep:`667`، معنای جهش اشیاء نگاشت بازگشتی از این تابع اکنون" +" تعریف شده است. رفتار در :term:`optimized scopes ` اکنون " +"همانطور که در بالا توضیح داده شد است. جدا از تعریف، رفتار در سایر حوزه ها " +"نسبت به نسخه های قبلی بدون تغییر باقی می ماند." #: library/functions.rst:1203 -msgid "Return an iterator that applies *function* to every item of *iterable*, yielding the results. If additional *iterables* arguments are passed, *function* must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted. For cases where the function inputs are already arranged into argument tuples, see :func:`itertools.starmap`\\." -msgstr "" +#, fuzzy +msgid "" +"Return an iterator that applies *function* to every item of *iterable*, " +"yielding the results. If additional *iterables* arguments are passed, " +"*function* must take that many arguments and is applied to the items from " +"all iterables in parallel. With multiple iterables, the iterator stops when" +" the shortest iterable is exhausted. For cases where the function inputs " +"are already arranged into argument tuples, see :func:`itertools.starmap`\\." +msgstr "" +"یک تکرار کننده که *function* را برای هر مورد از *iterable* اعمال می کند، " +"برگردانید و نتایج را به دست می دهد. اگر آرگومان های اضافی *iterables* ارسال" +" شوند، *function* باید این تعداد آرگومان را بگیرد و به صورت موازی روی آیتم " +"های همه تکرارپذیرها اعمال شود. با تکرارهای متعدد، زمانی که کوتاه ترین تکرار" +" تمام شود، تکرار کننده متوقف می شود. برای مواردی که ورودی‌های تابع قبلاً در" +" چند آرگومان مرتب شده‌اند، به :func:`itertools.starmap`\\ مراجعه کنید." #: library/functions.rst:1215 -msgid "Return the largest item in an iterable or the largest of two or more arguments." +#, fuzzy +msgid "" +"Return the largest item in an iterable or the largest of two or more " +"arguments." msgstr "" +"بزرگترین مورد در یک تکرارپذیر یا بزرگترین مورد از دو یا چند آرگومان را " +"برگردانید." #: library/functions.rst:1218 -msgid "If one positional argument is provided, it should be an :term:`iterable`. The largest item in the iterable is returned. If two or more positional arguments are provided, the largest of the positional arguments is returned." +#, fuzzy +msgid "" +"If one positional argument is provided, it should be an :term:`iterable`. " +"The largest item in the iterable is returned. If two or more positional " +"arguments are provided, the largest of the positional arguments is returned." msgstr "" +"اگر یک آرگومان موقعیتی ارائه شود، باید یک :term:`iterable` باشد. بزرگترین " +"مورد در تکرار پذیر برگردانده می شود. اگر دو یا چند آرگومان موقعیتی ارائه " +"شود، بزرگترین آرگومان موقعیتی برگردانده می شود." -#: library/functions.rst:1223 -#: library/functions.rst:1261 -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 "" +#: library/functions.rst:1223 library/functions.rst:1261 +#, fuzzy +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 "" +"دو آرگومان اختیاری فقط برای کلمه کلیدی وجود دارد. آرگومان *key* یک تابع " +"ترتیب یک آرگومان مانند آنچه برای :meth:`list.sort` استفاده می شود را مشخص می" +" کند. آرگومان *default* یک شی را مشخص می کند که در صورت خالی بودن تکرارپذیر " +"ارائه شده، باید برگردد. اگر تکرارپذیر خالی باشد و *default* ارائه نشده باشد،" +" یک :exc:`ValueError` بلند می شود." #: library/functions.rst:1229 -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)``." +#, fuzzy +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)`` سازگار است." -#: library/functions.rst:1234 -#: library/functions.rst:1272 +#: library/functions.rst:1234 library/functions.rst:1272 +#, fuzzy msgid "Added the *default* keyword-only parameter." -msgstr "" +msgstr "پارامتر فقط کلمه کلیدی *default* اضافه شد." -#: library/functions.rst:1237 -#: library/functions.rst:1275 +#: library/functions.rst:1237 library/functions.rst:1275 +#, fuzzy msgid "The *key* can be ``None``." -msgstr "" +msgstr "*key* می تواند ``None`` باشد." #: library/functions.rst:1245 -msgid "Return a \"memory view\" object created from the given argument. See :ref:`typememoryview` for more information." +#, fuzzy +msgid "" +"Return a \"memory view\" object created from the given argument. See " +":ref:`typememoryview` for more information." msgstr "" +"یک شی \"نمای حافظه\" ایجاد شده از آرگومان داده شده را برگردانید. برای " +"اطلاعات بیشتر به :ref:`typememoryview` مراجعه کنید." #: library/functions.rst:1253 -msgid "Return the smallest item in an iterable or the smallest of two or more arguments." +#, fuzzy +msgid "" +"Return the smallest item in an iterable or the smallest of two or more " +"arguments." msgstr "" +"کوچکترین مورد در یک تکرارپذیر یا کوچکترین یک از دو یا چند آرگومان را " +"برگردانید." #: library/functions.rst:1256 -msgid "If one positional argument is provided, it should be an :term:`iterable`. The smallest item in the iterable is returned. If two or more positional arguments are provided, the smallest of the positional arguments is returned." +#, fuzzy +msgid "" +"If one positional argument is provided, it should be an :term:`iterable`. " +"The smallest item in the iterable is returned. If two or more positional " +"arguments are provided, the smallest of the positional arguments is " +"returned." msgstr "" +"اگر یک آرگومان موقعیتی ارائه شود، باید یک :term:`iterable` باشد. کوچکترین " +"مورد در تکرار پذیر برگردانده می شود. اگر دو یا چند آرگومان موقعیتی ارائه " +"شود، کوچکترین آرگومان های موقعیتی برگردانده می شود." #: library/functions.rst:1267 -msgid "If multiple items are minimal, the function returns the first one encountered. This is consistent with other sort-stability preserving tools such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1, iterable, key=keyfunc)``." +#, fuzzy +msgid "" +"If multiple items are minimal, the function returns the first one " +"encountered. This is consistent with other sort-stability preserving tools " +"such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1, " +"iterable, key=keyfunc)``." msgstr "" +"اگر چندین آیتم حداقل باشند، تابع اولین موردی را که با آن مواجه شده است برمی " +"گرداند. این با سایر ابزارهای حفظ ثبات مرتب سازی مانند ``sorted(iterable, " +"key=keyfunc)[0]`` و ``heapq.nsmallest(1, iterable, key=keyfunc)`` سازگار " +"است." #: library/functions.rst:1282 -msgid "Retrieve the next item from the :term:`iterator` by calling its :meth:`~iterator.__next__` method. If *default* is given, it is returned if the iterator is exhausted, otherwise :exc:`StopIteration` is raised." +#, fuzzy +msgid "" +"Retrieve the next item from the :term:`iterator` by calling its " +":meth:`~iterator.__next__` method. If *default* is given, it is returned if" +" the iterator is exhausted, otherwise :exc:`StopIteration` is raised." msgstr "" +"با فراخوانی روش :meth:`~iterator.__next__` مورد بعدی را از :term:`iterator` " +"بازیابی کنید. اگر *default* داده شود، اگر تکرار کننده تمام شده باشد، " +"برگردانده می شود، در غیر این صورت :exc:`StopIteration` افزایش می یابد." #: library/functions.rst:1289 -msgid "This is the ultimate base class of all other classes. It has methods that are common to all instances of Python classes. When the constructor is called, it returns a new featureless object. The constructor does not accept any arguments." +#, fuzzy +msgid "" +"This is the ultimate base class of all other classes. It has methods that " +"are common to all instances of Python classes. When the constructor is " +"called, it returns a new featureless object. The constructor does not accept" +" any arguments." msgstr "" +"این کلاس پایه نهایی تمام کلاس‌های دیگر است. متدهایی دارد که در تمام " +"نمونه‌های کلاس‌های پایتون مشترک است. هنگامی که سازنده فراخوانی می شود، یک " +"شیء بدون ویژگی جدید را برمی گرداند. سازنده هیچ استدلالی را نمی پذیرد." #: library/functions.rst:1296 -msgid ":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, so you can't assign arbitrary attributes to an instance of :class:`object`." +#, fuzzy +msgid "" +":class:`object` instances do *not* have :attr:`~object.__dict__` attributes," +" so you can't assign arbitrary attributes to an instance of :class:`object`." msgstr "" +"نمونه های :class:`object` *not* دارای ویژگی های :attr:`~object.__dict__` " +"هستند، بنابراین نمی توانید ویژگی های دلخواه را به نمونه ای از " +":class:`object` اختصاص دهید." #: library/functions.rst:1303 -msgid "Convert an integer number to an octal string prefixed with \"0o\". The result is a valid Python expression. If *x* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. For example:" +#, fuzzy +msgid "" +"Convert an integer number to an octal string prefixed with \"0o\". The " +"result is a valid Python expression. If *x* is not a Python :class:`int` " +"object, it has to define an :meth:`~object.__index__` method that returns an" +" integer. For example:" msgstr "" +"یک عدد صحیح را به یک رشته هشتی با پیشوند \"0o\" تبدیل کنید. نتیجه یک عبارت " +"پایتون معتبر است. اگر *x* یک شی پایتون :class:`int` نیست، باید یک متد " +":meth:`~object.__index__` تعریف کند که یک عدد صحیح برمی گرداند. به عنوان " +"مثال:" #: library/functions.rst:1313 -msgid "If you want to convert an integer number to an octal string either with the prefix \"0o\" or not, you can use either of the following ways." +#, fuzzy +msgid "" +"If you want to convert an integer number to an octal string either with the " +"prefix \"0o\" or not, you can use either of the following ways." msgstr "" +"اگر می خواهید یک عدد صحیح را با پیشوند \"0o\" یا نه به رشته هشتی تبدیل کنید،" +" می توانید از یکی از راه های زیر استفاده کنید." #: library/functions.rst:1330 -msgid "Open *file* and return a corresponding :term:`file object`. If the file cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more examples of how to use this function." +#, fuzzy +msgid "" +"Open *file* and return a corresponding :term:`file object`. If the file " +"cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more" +" examples of how to use this function." msgstr "" +"*file* را باز کنید و :term:`file object` مربوطه را برگردانید. اگر فایل باز " +"نمی شود، یک :exc:`OSError` بالا می رود. برای مثال های بیشتر در مورد نحوه " +"استفاده از این تابع، به :ref:`tut-files` مراجعه کنید." #: library/functions.rst:1334 -msgid "*file* is a :term:`path-like object` giving the pathname (absolute or relative to the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it is closed when the returned I/O object is closed unless *closefd* is set to ``False``.)" -msgstr "" +#, fuzzy +msgid "" +"*file* is a :term:`path-like object` giving the pathname (absolute or " +"relative to the current working directory) of the file to be opened or an " +"integer file descriptor of the file to be wrapped. (If a file descriptor is" +" given, it is closed when the returned I/O object is closed unless *closefd*" +" is set to ``False``.)" +msgstr "" +"*file* یک :term:`path-like object` است که نام مسیر (مطلق یا نسبت به " +"دایرکتوری کاری فعلی) فایلی که باید باز شود یا یک توصیفگر فایل صحیح فایلی که " +"قرار است پیچیده شود را می دهد. (اگر یک توصیفگر فایل داده شود, زمانی که شی " +"I/O برگشتی بسته شود بسته می شود, مگر اینکه *closefd* روی ``False`` تنظیم " +"شود.)" #: library/functions.rst:1340 -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 "" +#, fuzzy +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'`` برای الحاق (که در سیستم‌های یونیکس *all* به این " +"معنی است که *all* بدون توجه به موقعیت جستجوی فعلی, پیوست به انتهای فایل " +"می‌نویسد). در حالت متنی، اگر *encoding* مشخص نشده باشد، رمزگذاری مورد " +"استفاده وابسته به پلتفرم است: :func:`locale.getencoding` برای دریافت کدگذاری" +" محلی فعلی فراخوانی می شود. (برای خواندن و نوشتن بایت های خام از حالت باینری" +" استفاده کنید و *encoding* را نامشخص بگذارید.) حالت های موجود عبارتند از:" #: library/functions.rst:1357 +#, fuzzy msgid "Character" -msgstr "" +msgstr "شخصیت" #: library/functions.rst:1357 +#, fuzzy msgid "Meaning" -msgstr "" +msgstr "معنی" #: library/functions.rst:1359 +#, fuzzy msgid "``'r'``" -msgstr "" +msgstr "``'r'``" #: library/functions.rst:1359 +#, fuzzy msgid "open for reading (default)" -msgstr "" +msgstr "باز برای خواندن (پیش فرض)" #: library/functions.rst:1360 +#, fuzzy msgid "``'w'``" -msgstr "" +msgstr "``'w'``" #: library/functions.rst:1360 +#, fuzzy msgid "open for writing, truncating the file first" -msgstr "" +msgstr "برای نوشتن باز کنید، ابتدا فایل را کوتاه کنید" #: library/functions.rst:1361 +#, fuzzy msgid "``'x'``" -msgstr "" +msgstr "``'x'``" #: library/functions.rst:1361 +#, fuzzy msgid "open for exclusive creation, failing if the file already exists" msgstr "" +"برای ایجاد انحصاری باز است، اگر فایل از قبل وجود داشته باشد، ناموفق است" #: library/functions.rst:1362 +#, fuzzy msgid "``'a'``" -msgstr "" +msgstr "``'a'``" #: library/functions.rst:1362 +#, fuzzy msgid "open for writing, appending to the end of file if it exists" -msgstr "" +msgstr "برای نوشتن باز است و در صورت وجود به انتهای فایل اضافه می شود" #: library/functions.rst:1363 +#, fuzzy msgid "``'b'``" -msgstr "" +msgstr "``'b'``" -#: library/functions.rst:1363 -#: library/functions.rst:1507 +#: library/functions.rst:1363 library/functions.rst:1507 +#, fuzzy msgid "binary mode" -msgstr "" +msgstr "حالت باینری" #: library/functions.rst:1364 +#, fuzzy msgid "``'t'``" -msgstr "" +msgstr "``'t'``" #: library/functions.rst:1364 +#, fuzzy msgid "text mode (default)" -msgstr "" +msgstr "حالت متن (پیش‌فرض)" #: library/functions.rst:1365 +#, fuzzy msgid "``'+'``" -msgstr "" +msgstr "``'+'``" #: library/functions.rst:1365 +#, fuzzy msgid "open for updating (reading and writing)" -msgstr "" +msgstr "باز برای به روز رسانی (خواندن و نوشتن)" #: library/functions.rst:1368 -msgid "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and ``'r+b'`` open the file with no truncation." +#, fuzzy +msgid "" +"The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " +"Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and" +" ``'r+b'`` open the file with no truncation." msgstr "" +"حالت پیش فرض ``'r'`` (باز برای خواندن متن, مترادف ``'rt'``) است. حالت های " +"``'w+'`` و ``'w+b'`` فایل را باز و کوتاه می کنند. حالت های ``'r+'`` و " +"``'r+b'`` فایل را بدون برش باز می کنند." #: library/functions.rst:1372 -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 "" +#, fuzzy +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` ذکر شد، پایتون بین I/O باینری و متنی تمایز " +"قائل می شود. فایل هایی که در حالت باینری باز می شوند (از جمله ``'b'`` در " +"آرگومان *mode*) بدون هیچ گونه رمزگشایی، محتویات را به عنوان اشیاء " +":class:`bytes` برمی گرداند. در حالت متنی (پیش‌فرض, یا زمانی که ``'t'`` در " +"آرگومان *mode* گنجانده می‌شود), محتویات فایل به‌عنوان :class:`str` برگردانده" +" می‌شود، بایت‌ها ابتدا با استفاده از یک رمزگذاری وابسته به پلتفرم رمزگشایی " +"شده‌اند یا در صورت ارائه، با استفاده از *encoding* مشخص‌شده رمزگشایی " +"شده‌اند." #: library/functions.rst:1382 -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." +#, fuzzy +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 "" +"پایتون به مفهوم فایل های متنی سیستم عامل اساسی وابسته نیست. تمام پردازش ها " +"توسط خود پایتون انجام می شود و بنابراین مستقل از پلتفرم است." #: library/functions.rst:1386 -msgid "*buffering* is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable when writing in text mode), and an integer > 1 to indicate the size in bytes of a fixed-size chunk buffer. Note that specifying a buffer size this way applies for binary buffered I/O, but ``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another buffering. To disable buffering in ``TextIOWrapper``, consider using the ``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. When no *buffering* argument is given, the default buffering policy works as follows:" -msgstr "" +#, fuzzy +msgid "" +"*buffering* is an optional integer used to set the buffering policy. Pass 0" +" to switch buffering off (only allowed in binary mode), 1 to select line " +"buffering (only usable when writing in text mode), and an integer > 1 to " +"indicate the size in bytes of a fixed-size chunk buffer. Note that " +"specifying a buffer size this way applies for binary buffered I/O, but " +"``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another" +" buffering. To disable buffering in ``TextIOWrapper``, consider using the " +"``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. When no " +"*buffering* argument is given, the default buffering policy works as " +"follows:" +msgstr "" +"*buffering* یک عدد صحیح اختیاری است که برای تنظیم خط مشی بافر استفاده می " +"شود. 0 را برای خاموش کردن بافر (فقط در حالت باینری مجاز است), 1 برای انتخاب" +" بافر خط (فقط هنگام نوشتن در حالت متنی قابل استفاده است) و یک عدد صحیح > 1 " +"برای نشان دادن اندازه یک بافر تکه با اندازه ثابت بر حسب بایت. توجه داشته " +"باشید که تعیین اندازه بافر از این طریق برای I/O بافر باینری اعمال می‌شود، " +"اما ``TextIOWrapper`` (یعنی فایل‌هایی که با ``mode='r+'`` باز می‌شوند) بافر " +"دیگری دارند. برای غیرفعال کردن بافر در ``TextIOWrapper``، از پرچم " +"``write_through`` برای :func:`io.TextIOWrapper.reconfigure` استفاده کنید. " +"هنگامی که هیچ آرگومان *buffering* داده نمی شود، سیاست بافر پیش فرض به صورت " +"زیر عمل می کند:" #: library/functions.rst:1396 -msgid "Binary files are buffered in fixed-size chunks; the size of the buffer is chosen using a heuristic trying to determine the underlying device's \"block size\" and falling back on :const:`io.DEFAULT_BUFFER_SIZE`. On many systems, the buffer will typically be 4096 or 8192 bytes long." +#, fuzzy +msgid "" +"Binary files are buffered in fixed-size chunks; the size of the buffer is " +"chosen using a heuristic trying to determine the underlying device's \"block" +" size\" and falling back on :const:`io.DEFAULT_BUFFER_SIZE`. On many " +"systems, the buffer will typically be 4096 or 8192 bytes long." msgstr "" +"فایل های باینری در تکه هایی با اندازه ثابت بافر می شوند. اندازه بافر با " +"استفاده از یک روش اکتشافی برای تعیین \"اندازه بلوک\" دستگاه زیربنایی و " +"بازگشت به :const:`io.DEFAULT_BUFFER_SIZE` انتخاب می شود. در بسیاری از سیستم" +" ها، بافر معمولاً 4096 یا 8192 بایت طول خواهد داشت." #: library/functions.rst:1401 -msgid "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` returns ``True``) use line buffering. Other text files use the policy described above for binary files." +#, fuzzy +msgid "" +"\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " +"returns ``True``) use line buffering. Other text files use the policy " +"described above for binary files." msgstr "" +"فایل های متنی \"تعاملی\" (فایل هایی که :meth:`~io.IOBase.isatty` برای آنها " +"``True`` برمی گرداند) از بافر خط استفاده می کنند. سایر فایل های متنی از خط " +"مشی توضیح داده شده در بالا برای فایل های باینری استفاده می کنند." #: library/functions.rst:1405 -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 "" +#, fuzzy +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:`text " +"encoding` پشتیبانی شده توسط پایتون قابل استفاده است. ماژول :mod:`codecs` را " +"برای لیست کدگذاری های پشتیبانی شده ببینید." #: library/functions.rst:1411 -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 "" +#, fuzzy +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` ثبت شده باشد نیز معتبر " +"است. نام های استاندارد عبارتند از:" #: library/functions.rst:1419 -msgid "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding error. The default value of ``None`` has the same effect." +#, fuzzy +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`` نیز همین اثر را دارد." #: library/functions.rst:1423 -msgid "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to data loss." +#, fuzzy +msgid "" +"``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to" +" data loss." msgstr "" +"``'ignore'`` خطاها را نادیده می گیرد. توجه داشته باشید که نادیده گرفتن " +"خطاهای رمزگذاری می تواند منجر به از دست رفتن اطلاعات شود." #: library/functions.rst:1426 -msgid "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted where there is malformed data." +#, fuzzy +msgid "" +"``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " +"where there is malformed data." msgstr "" +"``'replace'`` باعث می شود که یک نشانگر جایگزین (مانند ``'?'``) در جایی که " +"داده های نادرست وجود دارد درج شود." #: library/functions.rst:1429 -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 "" +#, fuzzy +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`` هنگام نوشتن داده استفاده می شود، این واحدهای کد جایگزین " +"دوباره به همان بایت ها تبدیل می شوند. این برای پردازش فایل ها در یک " +"رمزگذاری ناشناخته مفید است." #: library/functions.rst:1436 -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};`." +#, fuzzy +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};`." #: library/functions.rst:1440 -msgid "``'backslashreplace'`` replaces malformed data by Python's backslashed escape sequences." +#, fuzzy +msgid "" +"``'backslashreplace'`` replaces malformed data by Python's backslashed " +"escape sequences." msgstr "" +"``'backslashreplace'`` داده‌های بدشکل را با توالی‌های فرار بک اسلش شده " +"پایتون جایگزین می‌کند." #: library/functions.rst:1443 -msgid "``'namereplace'`` (also only supported when writing) replaces unsupported characters with ``\\N{...}`` escape sequences." +#, fuzzy +msgid "" +"``'namereplace'`` (also only supported when writing) replaces unsupported " +"characters with ``\\N{...}`` escape sequences." msgstr "" +"``'namereplace'`` (همچنین فقط هنگام نوشتن پشتیبانی می شود) نویسه های " +"پشتیبانی نشده را با دنباله های فرار ``\\N{...}`` جایگزین می کند." #: library/functions.rst:1451 -msgid "*newline* determines how to parse newline characters from the stream. It can be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" +#, fuzzy +msgid "" +"*newline* determines how to parse newline characters from the stream. It can" +" be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " +"follows:" msgstr "" +"*newline* نحوه تجزیه کاراکترهای خط جدید از جریان را تعیین می کند. این می " +"تواند ``None``، ``''``، ``'\\n'``، ``'\\r'`` و ``'\\r\\n'`` باشد. به صورت " +"زیر عمل می کند:" #: library/functions.rst:1455 -msgid "When reading input from the stream, if *newline* is ``None``, universal newlines mode is enabled. Lines in the input can end in ``'\\n'``, ``'\\r'``, or ``'\\r\\n'``, and these are translated into ``'\\n'`` before being returned to the caller. If it is ``''``, universal newlines mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated." -msgstr "" +#, fuzzy +msgid "" +"When reading input from the stream, if *newline* is ``None``, universal " +"newlines mode is enabled. Lines in the input can end in ``'\\n'``, " +"``'\\r'``, or ``'\\r\\n'``, and these are translated into ``'\\n'`` before " +"being returned to the caller. If it is ``''``, universal newlines mode is " +"enabled, but line endings are returned to the caller untranslated. If it " +"has any of the other legal values, input lines are only terminated by the " +"given string, and the line ending is returned to the caller untranslated." +msgstr "" +"هنگام خواندن ورودی از جریان، اگر *newline* ``None`` باشد، حالت خطوط جدید " +"جهانی فعال است. خطوط در ورودی می توانند به ``'\\n'``، ``'\\r'`` یا " +"``'\\r\\n'`` ختم شوند و این خطوط قبل از بازگرداندن به تماس گیرنده به " +"``'\\n'`` ترجمه می شوند. اگر ``''`` باشد، حالت خطوط جدید جهانی فعال است، " +"اما انتهای خط بدون ترجمه به تماس‌گیرنده برگردانده می‌شود. اگر هر یک از " +"مقادیر قانونی دیگر را داشته باشد، خطوط ورودی فقط با رشته داده شده خاتمه " +"می‌یابند و پایان خط بدون ترجمه به تماس‌گیرنده بازگردانده می‌شود." #: library/functions.rst:1463 -msgid "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` characters written are translated to the system default line separator, :data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation takes place. If *newline* is any of the other legal values, any ``'\\n'`` characters written are translated to the given string." -msgstr "" +#, fuzzy +msgid "" +"When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " +"characters written are translated to the system default line separator, " +":data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation " +"takes place. If *newline* is any of the other legal values, any ``'\\n'`` " +"characters written are translated to the given string." +msgstr "" +"هنگام نوشتن خروجی در جریان، اگر *newline* ``None`` باشد، هر کاراکتر " +"``'\\n'`` نوشته شده به جداکننده خط پیش‌فرض سیستم، :data:`os.linesep` ترجمه " +"می‌شود. اگر *newline* ``''`` یا ``'\\n'`` باشد، هیچ ترجمه ای انجام نمی شود." +" اگر *newline* هر یک از مقادیر قانونی دیگر باشد، هر کاراکتر ``'\\n'`` نوشته" +" شده به رشته داده شده ترجمه می شود." #: library/functions.rst:1469 -msgid "If *closefd* is ``False`` and a file descriptor rather than a filename was given, the underlying file descriptor will be kept open when the file is closed. If a filename is given *closefd* must be ``True`` (the default); otherwise, an error will be raised." +#, fuzzy +msgid "" +"If *closefd* is ``False`` and a file descriptor rather than a filename was " +"given, the underlying file descriptor will be kept open when the file is " +"closed. If a filename is given *closefd* must be ``True`` (the default); " +"otherwise, an error will be raised." msgstr "" +"اگر *closefd* ``False`` باشد و به جای نام فایل، توصیف‌گر فایل داده شده باشد،" +" وقتی فایل بسته شود، توصیف‌گر فایل زیرین باز نگه داشته می‌شود. اگر نام " +"فایلی داده شود *closefd* باید ``True`` (پیش فرض) باشد. در غیر این صورت یک " +"خطا مطرح می شود." #: library/functions.rst:1474 -msgid "A custom opener can be used by passing a callable as *opener*. The underlying file descriptor for the file object is then obtained by calling *opener* with (*file*, *flags*). *opener* must return an open file descriptor (passing :mod:`os.open` as *opener* results in functionality similar to passing ``None``)." -msgstr "" +#, fuzzy +msgid "" +"A custom opener can be used by passing a callable as *opener*. The " +"underlying file descriptor for the file object is then obtained by calling " +"*opener* with (*file*, *flags*). *opener* must return an open file " +"descriptor (passing :mod:`os.open` as *opener* results in functionality " +"similar to passing ``None``)." +msgstr "" +"یک بازکننده سفارشی را می توان با عبور از یک قابل فراخوانی به عنوان *opener* " +"استفاده کرد. سپس با فراخوانی *opener* با (*file*, *flags*) توصیفگر فایل " +"زیربنایی برای شی فایل به دست می آید. *opener* باید یک توصیفگر فایل باز " +"برگرداند (گذراندن :mod:`os.open` به عنوان *opener* عملکردی شبیه به پاس کردن " +"``None`` دارد)." #: library/functions.rst:1480 +#, fuzzy msgid "The newly created file is :ref:`non-inheritable `." -msgstr "" +msgstr "فایل جدید ایجاد شده :ref:`non-inheritable ` است." #: library/functions.rst:1482 -msgid "The following example uses the :ref:`dir_fd ` parameter of the :func:`os.open` function to open a file relative to a given directory::" +#, fuzzy +msgid "" +"The following example uses the :ref:`dir_fd ` parameter of the " +":func:`os.open` function to open a file relative to a given directory::" msgstr "" +"مثال زیر از پارامتر :ref:`dir_fd ` تابع :func:`os.open` برای باز " +"کردن یک فایل نسبت به دایرکتوری معین استفاده می کند:" #: library/functions.rst:1485 -msgid ">>> import os\n" +#, fuzzy +msgid "" +">>> import os\n" ">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" ">>> def opener(path, flags):\n" "... return os.open(path, flags, dir_fd=dir_fd)\n" @@ -1432,132 +3151,321 @@ msgid ">>> import os\n" "...\n" ">>> os.close(dir_fd) # don't leak a file descriptor" msgstr "" +">>> import os\n" +">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" +">>> def opener(path, flags):\n" +"... return os.open(path, flags, dir_fd=dir_fd)\n" +"...\n" +">>> with open('spamspam.txt', 'w', opener=opener) as f:\n" +"... print('This will be written to somedir/spamspam.txt', file=f)\n" +"...\n" +">>> os.close(dir_fd) # don't leak a file descriptor" #: library/functions.rst:1495 -msgid "The type of :term:`file object` returned by the :func:`open` function depends on the mode. When :func:`open` is used to open a file in a text mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of :class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used to open a file in a binary mode with buffering, the returned class is a subclass of :class:`io.BufferedIOBase`. The exact class varies: in read binary mode, it returns an :class:`io.BufferedReader`; in write binary and append binary modes, it returns an :class:`io.BufferedWriter`, and in read/write mode, it returns an :class:`io.BufferedRandom`. When buffering is disabled, the raw stream, a subclass of :class:`io.RawIOBase`, :class:`io.FileIO`, is returned." -msgstr "" +#, fuzzy +msgid "" +"The type of :term:`file object` returned by the :func:`open` function " +"depends on the mode. When :func:`open` is used to open a file in a text " +"mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of " +":class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used " +"to open a file in a binary mode with buffering, the returned class is a " +"subclass of :class:`io.BufferedIOBase`. The exact class varies: in read " +"binary mode, it returns an :class:`io.BufferedReader`; in write binary and " +"append binary modes, it returns an :class:`io.BufferedWriter`, and in " +"read/write mode, it returns an :class:`io.BufferedRandom`. When buffering " +"is disabled, the raw stream, a subclass of :class:`io.RawIOBase`, " +":class:`io.FileIO`, is returned." +msgstr "" +"نوع :term:`file object` برگردانده شده توسط تابع :func:`open` به حالت بستگی " +"دارد. هنگامی که از :func:`open` برای باز کردن یک فایل در حالت متنی " +"(``'w'``, ``'r'``, ``'wt'``, ``'rt'``, و غیره) استفاده می شود، زیر کلاس " +":class:`io.TextIOBase` (مخصوصا :class:`io.TextIOWrapper`) را برمی گرداند. " +"وقتی برای باز کردن یک فایل در حالت باینری با بافر استفاده می شود، کلاس " +"برگشتی زیر کلاس :class:`io.BufferedIOBase` است. کلاس دقیق متفاوت است: در " +"حالت خواندن باینری، یک :class:`io.BufferedReader` برمی گرداند. در حالت نوشتن" +" باینری و اضافه کردن، یک :class:`io.BufferedWriter` و در حالت خواندن/نوشتن، " +"یک :class:`io.BufferedRandom` برمی‌گرداند. هنگامی که بافر غیرفعال است، " +"جریان خام، یک زیر کلاس از :class:`io.RawIOBase`، :class:`io.FileIO`، " +"برگردانده می شود." #: library/functions.rst:1516 -msgid "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` (where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`, and :mod:`shutil`." +#, fuzzy +msgid "" +"See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " +"(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, " +":mod:`tempfile`, and :mod:`shutil`." msgstr "" +"همچنین به ماژول های مدیریت فایل مانند :mod:`fileinput`، :mod:`io` (جایی که " +":func:`open` اعلام شده است)، :mod:`os`، :mod:`os.path`، :mod:`tempfile` و " +":mod:`shutil` مراجعه کنید." #: library/functions.rst:1520 -msgid "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, ``mode``, ``flags``." +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``open`` with arguments ``path``," +" ``mode``, ``flags``." msgstr "" +"یک :ref:`auditing event ` ``open`` را با آرگومان های ``path``، " +"``mode``، ``flags`` افزایش می دهد." #: library/functions.rst:1522 -msgid "The ``mode`` and ``flags`` arguments may have been modified or inferred from the original call." +#, fuzzy +msgid "" +"The ``mode`` and ``flags`` arguments may have been modified or inferred from" +" the original call." msgstr "" +"آرگومان‌های ``mode`` و ``flags`` ممکن است از فراخوان اصلی تغییر یافته یا " +"استنتاج شده باشند." #: library/functions.rst:1527 +#, fuzzy msgid "The *opener* parameter was added." -msgstr "" +msgstr "پارامتر *opener* اضافه شد." #: library/functions.rst:1528 +#, fuzzy msgid "The ``'x'`` mode was added." -msgstr "" +msgstr "حالت ``'x'`` اضافه شد." #: library/functions.rst:1529 -msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." -msgstr "" +#, fuzzy +msgid "" +":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." +msgstr ":exc:`IOError` قبلاً مطرح می شد، اکنون نام مستعار :exc:`OSError` است." #: library/functions.rst:1530 -msgid ":exc:`FileExistsError` is now raised if the file opened in exclusive creation mode (``'x'``) already exists." +#, fuzzy +msgid "" +":exc:`FileExistsError` is now raised if the file opened in exclusive " +"creation mode (``'x'``) already exists." msgstr "" +"اگر فایل باز شده در حالت ایجاد انحصاری (``'x'``) از قبل وجود داشته باشد، " +"اکنون :exc:`FileExistsError` افزایش می یابد." #: library/functions.rst:1535 +#, fuzzy msgid "The file is now non-inheritable." -msgstr "" +msgstr "فایل در حال حاضر غیر قابل ارث است." #: library/functions.rst:1539 -msgid "If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." +#, fuzzy +msgid "" +"If the system call is interrupted and the signal handler does not raise an " +"exception, the function now retries the system call instead of raising an " +":exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" +"اگر تماس سیستم قطع شود و کنترل کننده سیگنال استثنایی را مطرح نکند، تابع " +"اکنون به جای افزایش استثنای :exc:`InterruptedError`، فراخوانی سیستم را " +"مجدداً انجام می دهد (برای دلیل منطقی به :pep:`475` مراجعه کنید)." #: library/functions.rst:1542 +#, fuzzy msgid "The ``'namereplace'`` error handler was added." -msgstr "" +msgstr "کنترل کننده خطای ``'namereplace'`` اضافه شد." #: library/functions.rst:1546 +#, fuzzy msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" +"پشتیبانی برای پذیرش اشیاء در حال اجرای :class:`os.PathLike` اضافه شده است." #: library/functions.rst:1547 -msgid "On Windows, opening a console buffer may return a subclass of :class:`io.RawIOBase` other than :class:`io.FileIO`." +#, fuzzy +msgid "" +"On Windows, opening a console buffer may return a subclass of " +":class:`io.RawIOBase` other than :class:`io.FileIO`." msgstr "" +"در ویندوز، باز کردن بافر کنسول ممکن است زیر کلاس :class:`io.RawIOBase` غیر " +"از :class:`io.FileIO` را بازگرداند." #: library/functions.rst:1550 +#, fuzzy msgid "The ``'U'`` mode has been removed." -msgstr "" +msgstr "حالت ``'U'`` حذف شده است." #: library/functions.rst:1555 -msgid "Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. For example, ``ord('a')`` returns the integer ``97`` and ``ord('€')`` (Euro sign) returns ``8364``. This is the inverse of :func:`chr`." +#, fuzzy +msgid "" +"Given a string representing one Unicode character, return an integer " +"representing the Unicode code point of that character. For example, " +"``ord('a')`` returns the integer ``97`` and ``ord('€')`` (Euro sign) returns" +" ``8364``. This is the inverse of :func:`chr`." msgstr "" +"با توجه به رشته ای که یک کاراکتر یونیکد را نشان می دهد، یک عدد صحیح نشان " +"دهنده نقطه کد یونیکد آن کاراکتر را برگردانید. برای مثال، ``ord('a')`` عدد " +"صحیح ``97`` و ``ord('€')`` (نشانه یورو) ``8364`` را برمی گرداند. این برعکس " +":func:`chr` است." #: library/functions.rst:1563 -msgid "Return *base* to the power *exp*; if *mod* is present, return *base* to the power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the power operator: ``base**exp``." +#, fuzzy +msgid "" +"Return *base* to the power *exp*; if *mod* is present, return *base* to the " +"power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) %" +" mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the" +" power operator: ``base**exp``." msgstr "" +"*base* را به قدرت *exp* برگردانید. اگر *mod* وجود دارد، *base* را به توان " +"*exp*، مدول *mod* برگردانید (محاسبه شده کارآمدتر از ``pow(base, exp) % " +"mod``). فرم دو استدلالی ``pow(base, exp)`` معادل استفاده از عملگر قدرت است: " +"``base**exp``." #: library/functions.rst:1568 -msgid "The arguments must have numeric types. With mixed operand types, the coercion rules for binary arithmetic operators apply. For :class:`int` operands, the result has the same type as the operands (after coercion) unless the second argument is negative; in that case, all arguments are converted to float and a float result is delivered. For example, ``pow(10, 2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative base of type :class:`int` or :class:`float` and a non-integral exponent, a complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value close to ``3j``. Whereas, for a negative base of type :class:`int` or :class:`float` with an integral exponent, a float result is delivered. For example, ``pow(-9, 2.0)`` returns ``81.0``." -msgstr "" +#, fuzzy +msgid "" +"The arguments must have numeric types. With mixed operand types, the " +"coercion rules for binary arithmetic operators apply. For :class:`int` " +"operands, the result has the same type as the operands (after coercion) " +"unless the second argument is negative; in that case, all arguments are " +"converted to float and a float result is delivered. For example, ``pow(10, " +"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " +"base of type :class:`int` or :class:`float` and a non-integral exponent, a " +"complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " +"close to ``3j``. Whereas, for a negative base of type :class:`int` or " +":class:`float` with an integral exponent, a float result is delivered. For " +"example, ``pow(-9, 2.0)`` returns ``81.0``." +msgstr "" +"آرگومان ها باید دارای انواع عددی باشند. با انواع عملوند مختلط، قوانین " +"اجباری برای عملگرهای حسابی باینری اعمال می شود. برای عملوندهای " +":class:`int`، نتیجه همان نوع عملوندها است (بعد از اجبار) مگر اینکه آرگومان " +"دوم منفی باشد. در آن صورت، همه آرگومان ها به float تبدیل می شوند و یک نتیجه " +"float تحویل داده می شود. برای مثال، ``pow(10, 2)`` ``100`` را برمی گرداند، " +"اما ``pow(10, -2)`` ``0.01`` را برمی گرداند. برای یک پایه منفی از نوع " +":class:`int` یا :class:`float` و یک توان غیرانتگرال، یک نتیجه پیچیده ارائه " +"می شود. برای مثال، ``pow(-9, 0.5)`` مقداری نزدیک به ``3j`` برمی‌گرداند. در " +"حالی که، برای یک پایه منفی از نوع :class:`int` یا :class:`float` با یک توان " +"انتگرال، یک نتیجه شناور ارائه می شود. به عنوان مثال، ``pow(-9, 2.0)`` " +"``81.0`` را برمی گرداند." #: library/functions.rst:1580 -msgid "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must also be of integer type and *mod* must be nonzero. If *mod* is present and *exp* is negative, *base* must be relatively prime to *mod*. In that case, ``pow(inv_base, -exp, mod)`` is returned, where *inv_base* is an inverse to *base* modulo *mod*." -msgstr "" +#, fuzzy +msgid "" +"For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " +"also be of integer type and *mod* must be nonzero. If *mod* is present and " +"*exp* is negative, *base* must be relatively prime to *mod*. In that case, " +"``pow(inv_base, -exp, mod)`` is returned, where *inv_base* is an inverse to " +"*base* modulo *mod*." +msgstr "" +"برای عملوندهای :class:`int` *base* و *exp*، اگر *mod* وجود داشته باشد، *mod*" +" نیز باید از نوع صحیح باشد و *mod* باید غیر صفر باشد. اگر *mod* وجود داشته " +"باشد و *exp* منفی باشد، *base* باید نسبتاً اول به *mod* باشد. در آن صورت، " +"``pow(inv_base, -exp, mod)`` برگردانده می شود، که در آن *inv_base* معکوس " +"مدول *base* *mod* است." #: library/functions.rst:1586 +#, fuzzy msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" -msgstr "" +msgstr "در اینجا مثالی از محاسبه معکوس برای مدول ``38`` ``97`` آورده شده است:" #: library/functions.rst:1588 -msgid ">>> pow(38, -1, mod=97)\n" +#, fuzzy +msgid "" +">>> pow(38, -1, mod=97)\n" "23\n" ">>> 23 * 38 % 97 == 1\n" "True" msgstr "" +">>> pow(38, -1, mod=97)\n" +"23\n" +">>> 23 * 38 % 97 == 1\n" +"True" #: library/functions.rst:1593 -msgid "For :class:`int` operands, the three-argument form of ``pow`` now allows the second argument to be negative, permitting computation of modular inverses." +#, fuzzy +msgid "" +"For :class:`int` operands, the three-argument form of ``pow`` now allows the" +" second argument to be negative, permitting computation of modular inverses." msgstr "" +"برای عملوندهای :class:`int`، فرم سه آرگومان ``pow`` اکنون اجازه می‌دهد " +"آرگومان دوم منفی باشد و امکان محاسبه معکوس‌های مدولار را فراهم می‌کند." #: library/functions.rst:1598 -msgid "Allow keyword arguments. Formerly, only positional arguments were supported." +#, fuzzy +msgid "" +"Allow keyword arguments. Formerly, only positional arguments were " +"supported." msgstr "" +"آرگومان های کلمه کلیدی را مجاز کنید. قبلاً فقط استدلال های موضعی پشتیبانی " +"می شد." #: library/functions.rst:1605 -msgid "Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments." +#, fuzzy +msgid "" +"Print *objects* to the text stream *file*, separated by *sep* and followed " +"by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " +"keyword arguments." msgstr "" +"*objects* را در جریان متنی *file* چاپ کنید که با *sep* جدا شده و به دنبال آن" +" *end* است. *sep*، *end*، *file*، و *flush*، در صورت وجود، باید به عنوان " +"آرگومان های کلمه کلیدی ارائه شوند." #: library/functions.rst:1609 -msgid "All non-keyword arguments are converted to strings like :func:`str` does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be ``None``, which means to use the default values. If no *objects* are given, :func:`print` will just write *end*." -msgstr "" +#, fuzzy +msgid "" +"All non-keyword arguments are converted to strings like :func:`str` does and" +" written to the stream, separated by *sep* and followed by *end*. Both " +"*sep* and *end* must be strings; they can also be ``None``, which means to " +"use the default values. If no *objects* are given, :func:`print` will just " +"write *end*." +msgstr "" +"همه آرگومان‌های غیرکلیدی به رشته‌هایی مانند :func:`str` تبدیل می‌شوند و در " +"جریان نوشته می‌شوند، با *sep* از هم جدا می‌شوند و به دنبال آن *end* می‌شوند." +" هر دو *sep* و *end* باید رشته باشند. آنها همچنین می توانند ``None`` باشند " +"که به معنای استفاده از مقادیر پیش فرض است. اگر *objects* داده نشود، " +":func:`print` فقط *end* را می نویسد." #: library/functions.rst:1615 -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." +#, fuzzy +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(...)`` استفاده کنید." #: library/functions.rst:1620 -msgid "Output buffering is usually determined by *file*. However, if *flush* is true, the stream is forcibly flushed." +#, fuzzy +msgid "" +"Output buffering is usually determined by *file*. However, if *flush* is " +"true, the stream is forcibly flushed." msgstr "" +"بافر خروجی معمولاً توسط *file* تعیین می شود. با این حال، اگر *flush* درست " +"باشد، جریان به اجبار فلاش می شود." #: library/functions.rst:1624 +#, fuzzy msgid "Added the *flush* keyword argument." -msgstr "" +msgstr "آرگومان کلمه کلیدی *flush* اضافه شد." #: library/functions.rst:1630 +#, fuzzy msgid "Return a property attribute." -msgstr "" +msgstr "یک ویژگی ویژگی را برگردانید." #: library/functions.rst:1632 -msgid "*fget* is a function for getting an attribute value. *fset* is a function for setting an attribute value. *fdel* is a function for deleting an attribute value. And *doc* creates a docstring for the attribute." +#, fuzzy +msgid "" +"*fget* is a function for getting an attribute value. *fset* is a function " +"for setting an attribute value. *fdel* is a function for deleting an " +"attribute value. And *doc* creates a docstring for the attribute." msgstr "" +"*fget* تابعی برای دریافت مقدار مشخصه است. *fset* تابعی برای تنظیم مقدار " +"مشخصه است. *fdel* تابعی برای حذف یک مقدار مشخصه است. و *doc* یک Docstring " +"برای ویژگی ایجاد می کند." #: library/functions.rst:1636 +#, fuzzy msgid "A typical use is to define a managed attribute ``x``::" -msgstr "" +msgstr "یک استفاده معمولی برای تعریف یک ویژگی مدیریت شده ``x`` است::" #: library/functions.rst:1638 -msgid "class C:\n" +#, fuzzy +msgid "" +"class C:\n" " def __init__(self):\n" " self._x = None\n" "\n" @@ -1572,17 +3480,47 @@ msgid "class C:\n" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" msgstr "" +"class C:\n" +" def __init__(self):\n" +" self._x = None\n" +"\n" +" def getx(self):\n" +" return self._x\n" +"\n" +" def setx(self, value):\n" +" self._x = value\n" +"\n" +" def delx(self):\n" +" del self._x\n" +"\n" +" x = property(getx, setx, delx, \"I'm the 'x' property.\")" #: library/functions.rst:1653 -msgid "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = value`` will invoke the setter, and ``del c.x`` the deleter." +#, fuzzy +msgid "" +"If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " +"value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" +"اگر *c* نمونه ای از *C* باشد، ``c.x`` گیرنده، ``c.x = value`` تنظیم کننده و " +"``del c.x`` حذف کننده را فراخوانی می کند." #: library/functions.rst:1656 -msgid "If given, *doc* will be the docstring of the property attribute. Otherwise, the property will copy *fget*'s docstring (if it exists). This makes it possible to create read-only properties easily using :func:`property` as a :term:`decorator`::" +#, fuzzy +msgid "" +"If given, *doc* will be the docstring of the property attribute. Otherwise, " +"the property will copy *fget*'s docstring (if it exists). This makes it " +"possible to create read-only properties easily using :func:`property` as a " +":term:`decorator`::" msgstr "" +"اگر داده شود، *doc* مدارک ویژگی ویژگی خواهد بود. در غیر این صورت، این ویژگی " +"رشته مستند *fget* را کپی می کند (در صورت وجود). این امکان ایجاد ویژگی های " +"فقط خواندنی را با استفاده از :func:`property` به عنوان :term:`decorator` به " +"راحتی امکان پذیر می کند:" #: library/functions.rst:1660 -msgid "class Parrot:\n" +#, fuzzy +msgid "" +"class Parrot:\n" " def __init__(self):\n" " self._voltage = 100000\n" "\n" @@ -1591,17 +3529,43 @@ msgid "class Parrot:\n" " \"\"\"Get the current voltage.\"\"\"\n" " return self._voltage" msgstr "" +"class Parrot:\n" +" def __init__(self):\n" +" self._voltage = 100000\n" +"\n" +" @property\n" +" def voltage(self):\n" +" \"\"\"Get the current voltage.\"\"\"\n" +" return self._voltage" #: library/functions.rst:1669 -msgid "The ``@property`` decorator turns the :meth:`!voltage` method into a \"getter\" for a read-only attribute with the same name, and it sets the docstring for *voltage* to \"Get the current voltage.\"" +#, fuzzy +msgid "" +"The ``@property`` decorator turns the :meth:`!voltage` method into a " +"\"getter\" for a read-only attribute with the same name, and it sets the " +"docstring for *voltage* to \"Get the current voltage.\"" msgstr "" +"دکوراتور ``@property`` روش :meth:`!voltage` را به یک \"گیرنده\" برای یک " +"ویژگی فقط خواندنی با همین نام تبدیل می کند و رشته docstring را برای " +"*voltage* روی \"Get the current voltage\" تنظیم می کند." #: library/functions.rst:1677 -msgid "A property object has ``getter``, ``setter``, and ``deleter`` methods usable as decorators that create a copy of the property with the corresponding accessor function set to the decorated function. This is best explained with an example:" +#, fuzzy +msgid "" +"A property object has ``getter``, ``setter``, and ``deleter`` methods usable" +" as decorators that create a copy of the property with the corresponding " +"accessor function set to the decorated function. This is best explained " +"with an example:" msgstr "" +"یک شیء دارای متدهای ``getter``، ``setter``، و ``deleter`` است که می‌توانند " +"به‌عنوان دکوراتور استفاده شوند که یک کپی از ویژگی را با تابع دسترسی مربوطه " +"به تابع تزئین شده ایجاد می‌کنند. این به بهترین شکل با یک مثال توضیح داده می" +" شود:" #: library/functions.rst:1682 -msgid "class C:\n" +#, fuzzy +msgid "" +"class C:\n" " def __init__(self):\n" " self._x = None\n" "\n" @@ -1618,37 +3582,94 @@ msgid "class C:\n" " def x(self):\n" " del self._x" msgstr "" +"class C:\n" +" def __init__(self):\n" +" self._x = None\n" +"\n" +" @property\n" +" def x(self):\n" +" \"\"\"I'm the 'x' property.\"\"\"\n" +" return self._x\n" +"\n" +" @x.setter\n" +" def x(self, value):\n" +" self._x = value\n" +"\n" +" @x.deleter\n" +" def x(self):\n" +" del self._x" #: library/functions.rst:1701 -msgid "This code is exactly equivalent to the first example. Be sure to give the additional functions the same name as the original property (``x`` in this case.)" +#, fuzzy +msgid "" +"This code is exactly equivalent to the first example. Be sure to give the " +"additional functions the same name as the original property (``x`` in this " +"case.)" msgstr "" +"این کد دقیقاً معادل مثال اول است. مطمئن شوید که نام توابع اضافی را با ویژگی" +" اصلی (در این مورد ``x``) قرار دهید." #: library/functions.rst:1705 -msgid "The returned property object also has the attributes ``fget``, ``fset``, and ``fdel`` corresponding to the constructor arguments." +#, fuzzy +msgid "" +"The returned property object also has the attributes ``fget``, ``fset``, and" +" ``fdel`` corresponding to the constructor arguments." msgstr "" +"شیء ویژگی برگردانده شده نیز دارای ویژگی های ``fget``، ``fset`` و ``fdel`` " +"مربوط به آرگومان های سازنده است." #: library/functions.rst:1708 +#, fuzzy msgid "The docstrings of property objects are now writeable." -msgstr "" +msgstr "رشته های اسناد اشیاء ویژگی اکنون قابل نوشتن هستند." #: library/functions.rst:1713 -msgid "Attribute holding the name of the property. The name of the property can be changed at runtime." -msgstr "" +#, fuzzy +msgid "" +"Attribute holding the name of the property. The name of the property can be " +"changed at runtime." +msgstr "صفت نگهدارنده نام ملک. نام ملک را می توان در زمان اجرا تغییر داد." #: library/functions.rst:1724 -msgid "Rather than being a function, :class:`range` is actually an immutable sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." +#, fuzzy +msgid "" +"Rather than being a function, :class:`range` is actually an immutable " +"sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" +":class:`range` به جای اینکه یک تابع باشد، در واقع یک نوع دنباله تغییر ناپذیر" +" است، همانطور که در :ref:`typesseq-range` و :ref:`typesseq` مستند شده است." #: library/functions.rst:1730 -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 "" +#, fuzzy +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` را " +"افزایش می دهد." #: library/functions.rst:1741 +#, fuzzy msgid "This class has a custom representation that can be evaluated::" -msgstr "" +msgstr "این کلاس یک نمایش سفارشی دارد که می توان آن را ارزیابی کرد:" #: library/functions.rst:1743 -msgid "class Person:\n" +#, fuzzy +msgid "" +"class Person:\n" " def __init__(self, name, age):\n" " self.name = name\n" " self.age = age\n" @@ -1656,365 +3677,952 @@ msgid "class Person:\n" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" msgstr "" +"class Person:\n" +" def __init__(self, name, age):\n" +" self.name = name\n" +" self.age = age\n" +"\n" +" def __repr__(self):\n" +" return f\"Person('{self.name}', {self.age})\"" #: library/functions.rst:1754 -msgid "Return a reverse :term:`iterator`. *seq* 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``)." +#, fuzzy +msgid "" +"Return a reverse :term:`iterator`. *seq* 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:`iterator` معکوس را برگردانید. *seq* باید شیئی باشد که دارای متد " +":meth:`~object.__reversed__` باشد یا از پروتکل توالی پشتیبانی کند (روش " +":meth:`~object.__len__` و روش :meth:`~object.__getitem__` با آرگومانهای عدد " +"صحیح که از ``0`` شروع می شوند)." #: library/functions.rst:1762 -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." +#, fuzzy +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`` باشد، نزدیکترین عدد صحیح را به ورودی خود برمی گرداند." #: library/functions.rst:1766 -msgid "For the built-in types supporting :func:`round`, values are rounded to the closest multiple of 10 to the power minus *ndigits*; if two multiples are equally close, rounding is done toward the even choice (so, for example, both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is ``2``). Any integer value is valid for *ndigits* (positive, zero, or negative). The return value is an integer if *ndigits* is omitted or ``None``. Otherwise, the return value has the same type as *number*." -msgstr "" +#, fuzzy +msgid "" +"For the built-in types supporting :func:`round`, values are rounded to the " +"closest multiple of 10 to the power minus *ndigits*; if two multiples are " +"equally close, rounding is done toward the even choice (so, for example, " +"both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is " +"``2``). Any integer value is valid for *ndigits* (positive, zero, or " +"negative). The return value is an integer if *ndigits* is omitted or " +"``None``. Otherwise, the return value has the same type as *number*." +msgstr "" +"برای انواع داخلی که از :func:`round` پشتیبانی می کنند، مقادیر به نزدیکترین " +"مضرب 10 به توان منهای *ndigits* گرد می شوند. اگر دو مضرب به یک اندازه نزدیک " +"باشند، گرد کردن به سمت گزینه زوج انجام می شود (به عنوان مثال, هر دو " +"``round(0.5)`` و ``round(-0.5)`` ``0`` هستند و ``round(1.5)`` ``2`` هستند)." +" هر مقدار صحیح برای *ndigits* معتبر است (مثبت, صفر یا منفی). مقدار برگشتی " +"یک عدد صحیح است اگر *ndigits* حذف شود یا ``None``. در غیر این صورت، مقدار " +"بازگشتی همان نوع *number* است." #: library/functions.rst:1775 -msgid "For a general Python object ``number``, ``round`` delegates to ``number.__round__``." +#, fuzzy +msgid "" +"For a general Python object ``number``, ``round`` delegates to " +"``number.__round__``." msgstr "" +"برای یک شیء عمومی پایتون ``number``، ``round`` به ``number.__round__`` " +"واگذار می شود." #: library/functions.rst:1780 -msgid "The behavior of :func:`round` for floats can be surprising: for example, ``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is not a bug: it's a result of the fact that most decimal fractions can't be represented exactly as a float. See :ref:`tut-fp-issues` for more information." -msgstr "" +#, fuzzy +msgid "" +"The behavior of :func:`round` for floats can be surprising: for example, " +"``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is" +" not a bug: it's a result of the fact that most decimal fractions can't be " +"represented exactly as a float. See :ref:`tut-fp-issues` for more " +"information." +msgstr "" +"رفتار :func:`round` برای شناورها می تواند تعجب آور باشد: به عنوان مثال، " +"``round(2.675, 2)`` به جای ``2.68`` مورد انتظار، ``2.67`` را می دهد. این یک " +"اشکال نیست: نتیجه این واقعیت است که اکثر کسرهای اعشاری نمی توانند دقیقاً به " +"عنوان یک شناور نمایش داده شوند. برای اطلاعات بیشتر به :ref:`tut-fp-issues` " +"مراجعه کنید." #: library/functions.rst:1792 -msgid "Return a new :class:`set` object, optionally with elements taken from *iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-set` for documentation about this class." +#, fuzzy +msgid "" +"Return a new :class:`set` object, optionally with elements taken from " +"*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" +"set` for documentation about this class." msgstr "" +"یک شی :class:`set` جدید، به صورت اختیاری با عناصر گرفته شده از *iterable* " +"برگردانید. ``set`` یک کلاس داخلی است. برای مستندات مربوط به این کلاس به " +":class:`set` و :ref:`types-set` مراجعه کنید." #: library/functions.rst:1796 -msgid "For other containers see the built-in :class:`frozenset`, :class:`list`, :class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." +#, fuzzy +msgid "" +"For other containers see the built-in :class:`frozenset`, :class:`list`, " +":class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections`" +" module." msgstr "" +"برای سایر کانتینرها به کلاس های داخلی :class:`frozenset`، :class:`list`، " +":class:`tuple` و :class:`dict` و همچنین ماژول :mod:`collections` مراجعه " +"کنید." #: library/functions.rst:1803 -msgid "This is the counterpart of :func:`getattr`. The arguments are an object, a string, and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it. For example, ``setattr(x, 'foobar', 123)`` is equivalent to ``x.foobar = 123``." +#, fuzzy +msgid "" +"This is the counterpart of :func:`getattr`. The arguments are an object, a " +"string, and an arbitrary value. The string may name an existing attribute " +"or a new attribute. The function assigns the value to the attribute, " +"provided the object allows it. For example, ``setattr(x, 'foobar', 123)`` " +"is equivalent to ``x.foobar = 123``." msgstr "" +"این همتای :func:`getattr` است. آرگومان ها یک شی، یک رشته و یک مقدار دلخواه " +"هستند. رشته ممکن است یک ویژگی موجود یا یک ویژگی جدید را نامگذاری کند. تابع" +" مقدار را به ویژگی اختصاص می دهد، مشروط بر اینکه شی اجازه دهد. به عنوان " +"مثال، ``setattr(x, 'foobar', 123)`` معادل ``x.foobar = 123`` است." #: library/functions.rst:1809 -msgid "*name* need not be a Python identifier as defined in :ref:`identifiers` unless the object chooses to enforce that, for example in a custom :meth:`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute whose name is not an identifier will not be accessible using the dot notation, but is accessible through :func:`getattr` etc.." -msgstr "" +#, fuzzy +msgid "" +"*name* need not be a Python identifier as defined in :ref:`identifiers` " +"unless the object chooses to enforce that, for example in a custom " +":meth:`~object.__getattribute__` or via :attr:`~object.__slots__`. An " +"attribute whose name is not an identifier will not be accessible using the " +"dot notation, but is accessible through :func:`getattr` etc.." +msgstr "" +"*name* لازم نیست یک شناسه پایتون همانطور که در :ref:`identifiers` تعریف شده " +"است باشد، مگر اینکه شیء بخواهد آن را اعمال کند، برای مثال در یک " +":meth:`~object.__getattribute__` سفارشی یا از طریق " +":attr:`~object.__slots__`. مشخصه ای که نام آن شناسه نیست با استفاده از علامت" +" نقطه قابل دسترسی نخواهد بود، اما از طریق :func:`getattr` و غیره قابل دسترسی" +" است." #: library/functions.rst:1817 -msgid "Since :ref:`private name mangling ` happens at compilation time, one must manually mangle a private attribute's (attributes with two leading underscores) name in order to set it with :func:`setattr`." +#, fuzzy +msgid "" +"Since :ref:`private name mangling ` happens at " +"compilation time, one must manually mangle a private attribute's (attributes" +" with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" +"از آنجایی که :ref:`private name mangling ` در زمان " +"کامپایل اتفاق می افتد، باید به صورت دستی نام یک ویژگی خصوصی (ویژگی ها با دو " +"خط زیر خط اصلی) را به منظور تنظیم آن با :func:`setattr` تغییر دهید." #: library/functions.rst:1826 -msgid "Return a :term:`slice` object representing the set of indices specified by ``range(start, stop, step)``. The *start* and *step* arguments default to ``None``." +#, fuzzy +msgid "" +"Return a :term:`slice` object representing the set of indices specified by " +"``range(start, stop, step)``. The *start* and *step* arguments default to " +"``None``." msgstr "" +"یک شی :term:`slice` که مجموعه ای از شاخص های مشخص شده توسط ``range(start, " +"stop, step)`` را نشان می دهد، برگردانید. آرگومان های *start* و *step* به " +"طور پیش فرض ``None`` هستند." #: library/functions.rst:1834 -msgid "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, and :attr:`!step` which merely return the argument values (or their default). They have no other explicit functionality; however, they are used by NumPy and other third-party packages." +#, fuzzy +msgid "" +"Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " +"and :attr:`!step` which merely return the argument values (or their " +"default). They have no other explicit functionality; however, they are used" +" by NumPy and other third-party packages." msgstr "" +"اشیاء Slice دارای ویژگی های داده فقط خواندنی :attr:`!start`، :attr:`!stop` و" +" :attr:`!step` هستند که صرفاً مقادیر آرگومان (یا پیش فرض آنها) را برمی " +"گرداند. آنها هیچ عملکرد صریح دیگری ندارند. با این حال، آنها توسط NumPy و " +"سایر بسته های شخص ثالث استفاده می شوند." #: library/functions.rst:1839 -msgid "Slice objects are also generated when extended indexing syntax is used. For example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:`itertools.islice` for an alternate version that returns an :term:`iterator`." +#, fuzzy +msgid "" +"Slice objects are also generated when extended indexing syntax is used. For" +" example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See " +":func:`itertools.islice` for an alternate version that returns an " +":term:`iterator`." msgstr "" +"هنگامی که از نحو نمایه سازی توسعه یافته استفاده می شود، اشیاء برش نیز تولید " +"می شوند. به عنوان مثال: ``a[start:stop:step]`` یا ``a[start:stop, i]``. " +"برای نسخه جایگزینی که :term:`iterator` را برمی گرداند به " +":func:`itertools.islice` مراجعه کنید." #: library/functions.rst:1844 -msgid "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:`~slice.stop`, and :attr:`~slice.step` are hashable)." +#, fuzzy +msgid "" +"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, " +":attr:`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" +"اشیاء Slice اکنون :term:`hashable` هستند (به شرطی که :attr:`~slice.start`, " +":attr:`~slice.stop` و :attr:`~slice.step` قابل هش باشند)." #: library/functions.rst:1850 +#, fuzzy msgid "Return a new sorted list from the items in *iterable*." -msgstr "" +msgstr "یک لیست مرتب شده جدید از موارد موجود در *iterable* برگردانید." #: library/functions.rst:1852 -msgid "Has two optional arguments which must be specified as keyword arguments." +#, fuzzy +msgid "" +"Has two optional arguments which must be specified as keyword arguments." msgstr "" +"دارای دو آرگومان اختیاری است که باید به عنوان آرگومان کلمه کلیدی مشخص شوند." #: library/functions.rst:1854 -msgid "*key* specifies a function of one argument that is used to extract a comparison key from each element in *iterable* (for example, ``key=str.lower``). The default value is ``None`` (compare the elements directly)." +#, fuzzy +msgid "" +"*key* specifies a function of one argument that is used to extract a " +"comparison key from each element in *iterable* (for example, " +"``key=str.lower``). The default value is ``None`` (compare the elements " +"directly)." msgstr "" +"*key* تابعی از یک آرگومان را مشخص می کند که برای استخراج یک کلید مقایسه از " +"هر عنصر در *iterable* (مثلا ``key=str.lower``) استفاده می شود. مقدار پیش " +"فرض ``None`` است (عناصر را مستقیماً مقایسه کنید)." #: library/functions.rst:1858 -msgid "*reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed." +#, fuzzy +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the list elements " +"are sorted as if each comparison were reversed." msgstr "" +"*reverse* یک مقدار بولی است. اگر روی ``True`` تنظیم شود، عناصر لیست طوری " +"مرتب می شوند که گویی هر مقایسه معکوس شده است." #: library/functions.rst:1861 -msgid "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a *key* function." +#, fuzzy +msgid "" +"Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a" +" *key* function." msgstr "" +"از :func:`functools.cmp_to_key` برای تبدیل تابع قدیمی *cmp* به تابع *key* " +"استفاده کنید." #: library/functions.rst:1864 -msgid "The built-in :func:`sorted` function is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade)." +#, fuzzy +msgid "" +"The built-in :func:`sorted` function is guaranteed to be stable. A sort is " +"stable if it guarantees not to change the relative order of elements that " +"compare equal --- this is helpful for sorting in multiple passes (for " +"example, sort by department, then by salary grade)." msgstr "" +"عملکرد داخلی :func:`sorted` تضمین شده است که پایدار است. مرتب‌سازی پایدار " +"است اگر تضمین کند که ترتیب نسبی عناصری که با هم مقایسه می‌شوند تغییر نمی‌کند" +" --- این برای مرتب‌سازی در چند پاس مفید است (مثلاً مرتب‌سازی بر اساس بخش, " +"سپس بر اساس درجه حقوق)." #: library/functions.rst:1869 -msgid "The sort algorithm uses only ``<`` comparisons between items. While defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` recommends that all six :ref:`rich comparisons ` be implemented. This will help avoid bugs when using the same data with other ordering tools such as :func:`max` that rely on a different underlying method. Implementing all six comparisons also helps avoid confusion for mixed type comparisons which can call reflected the :meth:`~object.__gt__` method." -msgstr "" +#, fuzzy +msgid "" +"The sort algorithm uses only ``<`` comparisons between items. While " +"defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8`" +" recommends that all six :ref:`rich comparisons ` be " +"implemented. This will help avoid bugs when using the same data with other " +"ordering tools such as :func:`max` that rely on a different underlying " +"method. Implementing all six comparisons also helps avoid confusion for " +"mixed type comparisons which can call reflected the :meth:`~object.__gt__` " +"method." +msgstr "" +"الگوریتم مرتب سازی فقط از مقایسه ``<`` بین موارد استفاده می کند. در حالی که" +" تعریف یک روش :meth:`~object.__lt__` برای مرتب سازی کافی است، :PEP:`8` توصیه" +" می کند که هر شش :ref:`rich comparisons ` پیاده سازی شود. این " +"به جلوگیری از اشکالات هنگام استفاده از داده های مشابه با سایر ابزارهای سفارش" +" مانند :func:`max` کمک می کند که به روش اساسی متفاوتی متکی هستند. اجرای هر " +"شش مقایسه همچنین به جلوگیری از سردرگمی برای مقایسه‌های نوع مختلط کمک می‌کند " +"که می‌تواند روش :meth:`~object.__gt__` را منعکس کند." #: library/functions.rst:1878 -msgid "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." +#, fuzzy +msgid "" +"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" +"برای نمونه‌های مرتب‌سازی و یک آموزش مختصر مرتب‌سازی، به :ref:`sortinghowto` " +"مراجعه کنید." #: library/functions.rst:1882 +#, fuzzy msgid "Transform a method into a static method." -msgstr "" +msgstr "تبدیل یک روش به روش ایستا" #: library/functions.rst:1884 -msgid "A static method does not receive an implicit first argument. To declare a static method, use this idiom::" +#, fuzzy +msgid "" +"A static method does not receive an implicit first argument. To declare a " +"static method, use this idiom::" msgstr "" +"یک روش استاتیک یک آرگومان اولیه ضمنی را دریافت نمی کند. برای اعلام یک متد " +"استاتیک، از این اصطلاح استفاده کنید:" #: library/functions.rst:1887 -msgid "class C:\n" +#, fuzzy +msgid "" +"class C:\n" " @staticmethod\n" " def f(arg1, arg2, argN): ..." msgstr "" +"class C:\n" +" @staticmethod\n" +" def f(arg1, arg2, argN): ..." #: library/functions.rst:1891 -msgid "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:`function` for details." +#, fuzzy +msgid "" +"The ``@staticmethod`` form is a function :term:`decorator` -- see " +":ref:`function` for details." msgstr "" +"فرم ``@staticmethod`` یک تابع :term:`decorator` است -- برای جزئیات به " +":ref:`function` مراجعه کنید." #: library/functions.rst:1894 -msgid "A static method can be called either on the class (such as ``C.f()``) or on an instance (such as ``C().f()``). Moreover, the static method :term:`descriptor` is also callable, so it can be used in the class definition (such as ``f()``)." +#, fuzzy +msgid "" +"A static method can be called either on the class (such as ``C.f()``) or on " +"an instance (such as ``C().f()``). Moreover, the static method " +":term:`descriptor` is also callable, so it can be used in the class " +"definition (such as ``f()``)." msgstr "" +"یک متد استاتیک را می توان بر روی کلاس (مانند ``C.f()``) یا بر روی یک نمونه " +"(مانند ``C().f()``) فراخوانی کرد. علاوه بر این، روش استاتیک " +":term:`descriptor` نیز قابل فراخوانی است، بنابراین می توان از آن در تعریف " +"کلاس (مانند ``f()``) استفاده کرد." #: library/functions.rst:1899 -msgid "Static methods in Python are similar to those found in Java or C++. Also, see :func:`classmethod` for a variant that is useful for creating alternate class constructors." +#, fuzzy +msgid "" +"Static methods in Python are similar to those found in Java or C++. Also, " +"see :func:`classmethod` for a variant that is useful for creating alternate " +"class constructors." msgstr "" +"روش‌های استاتیک در پایتون شبیه به روش‌های موجود در جاوا یا سی پلاس پلاس است." +" همچنین، :func:`classmethod` را برای گونه‌ای که برای ایجاد سازنده‌های کلاس " +"جایگزین مفید است، ببینید." #: library/functions.rst:1903 -msgid "Like all decorators, it is also possible to call ``staticmethod`` as a regular function and do something with its result. This is needed in some cases where you need a reference to a function from a class body and you want to avoid the automatic transformation to instance method. For these cases, use this idiom::" +#, fuzzy +msgid "" +"Like all decorators, it is also possible to call ``staticmethod`` as a " +"regular function and do something with its result. This is needed in some " +"cases where you need a reference to a function from a class body and you " +"want to avoid the automatic transformation to instance method. For these " +"cases, use this idiom::" msgstr "" +"مانند تمام دکوراتورها، می توان ``staticmethod`` را به عنوان یک عملکرد معمولی" +" فراخوانی کرد و با نتیجه آن کاری انجام داد. این در برخی موارد مورد نیاز است" +" که در آن به یک تابع از بدنه کلاس نیاز دارید و می خواهید از تبدیل خودکار به " +"روش نمونه اجتناب کنید. برای این موارد از این اصطلاح استفاده کنید::" #: library/functions.rst:1909 -msgid "def regular_function():\n" +#, fuzzy +msgid "" +"def regular_function():\n" " ...\n" "\n" "class C:\n" " method = staticmethod(regular_function)" msgstr "" +"def regular_function():\n" +" ...\n" +"\n" +"class C:\n" +" method = staticmethod(regular_function)" #: library/functions.rst:1915 +#, fuzzy msgid "For more information on static methods, see :ref:`types`." msgstr "" +"برای اطلاعات بیشتر در مورد روش های استاتیک، به :ref:`types` مراجعه کنید." #: library/functions.rst:1917 -msgid "Static methods now inherit the method attributes (:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new ``__wrapped__`` attribute, and are now callable as regular functions." -msgstr "" +#, fuzzy +msgid "" +"Static methods now inherit the method attributes " +"(:attr:`~function.__module__`, :attr:`~function.__name__`, " +":attr:`~function.__qualname__`, :attr:`~function.__doc__` and " +":attr:`~function.__annotations__`), have a new ``__wrapped__`` attribute, " +"and are now callable as regular functions." +msgstr "" +"روش‌های استاتیک اکنون ویژگی‌های متد (:attr:`~function.__module__`, " +":attr:`~function.__name__`, :attr:`~function.__qualname__`, " +":attr:`~function.__doc__` و :attr:`~function.__annotations__`) را به ارث " +"می‌برند، یک ویژگی ``__wrapped__`` جدید دارند و اکنون به عنوان توابع معمولی " +"قابل فراخوانی هستند." #: library/functions.rst:1933 -msgid "Return a :class:`str` version of *object*. See :func:`str` for details." +#, fuzzy +msgid "" +"Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" +"یک نسخه :class:`str` از *object* را برگردانید. برای جزئیات بیشتر به " +":func:`str` مراجعه کنید." #: library/functions.rst:1935 -msgid "``str`` is the built-in string :term:`class`. For general information about strings, see :ref:`textseq`." +#, fuzzy +msgid "" +"``str`` is the built-in string :term:`class`. For general information about" +" strings, see :ref:`textseq`." msgstr "" +"``str`` رشته داخلی :term:`class` است. برای اطلاعات کلی در مورد رشته ها، به " +":ref:`textseq` مراجعه کنید." #: library/functions.rst:1941 -msgid "Sums *start* and the items of an *iterable* from left to right and returns the total. The *iterable*'s items are normally numbers, and the start value is not allowed to be a string." +#, fuzzy +msgid "" +"Sums *start* and the items of an *iterable* from left to right and returns " +"the total. The *iterable*'s items are normally numbers, and the start value" +" is not allowed to be a string." msgstr "" +"*start* و موارد یک *iterable* را از چپ به راست جمع می کند و کل را برمی " +"گرداند. موارد *iterable* معمولاً اعداد هستند و مقدار شروع مجاز نیست که یک " +"رشته باشد." #: library/functions.rst:1945 -msgid "For some use cases, there are good alternatives to :func:`sum`. The preferred, fast way to concatenate a sequence of strings is by calling ``''.join(sequence)``. To add floating-point values with extended precision, see :func:`math.fsum`\\. To concatenate a series of iterables, consider using :func:`itertools.chain`." -msgstr "" +#, fuzzy +msgid "" +"For some use cases, there are good alternatives to :func:`sum`. The " +"preferred, fast way to concatenate a sequence of strings is by calling " +"``''.join(sequence)``. To add floating-point values with extended " +"precision, see :func:`math.fsum`\\. To concatenate a series of iterables, " +"consider using :func:`itertools.chain`." +msgstr "" +"برای برخی موارد استفاده، جایگزین های خوبی برای :func:`sum` وجود دارد. راه " +"سریع و ترجیحی برای الحاق یک دنباله از رشته ها، فراخوانی " +"``''.join(sequence)`` است. برای افزودن مقادیر ممیز شناور با دقت بیشتر، به " +":func:`math.fsum`\\ مراجعه کنید. برای الحاق یک سری تکرارپذیر، از " +":func:`itertools.chain` استفاده کنید." #: library/functions.rst:1951 +#, fuzzy msgid "The *start* parameter can be specified as a keyword argument." -msgstr "" +msgstr "پارامتر *start* را می توان به عنوان آرگومان کلمه کلیدی تعیین کرد." #: library/functions.rst:1954 -msgid "Summation of floats switched to an algorithm that gives higher accuracy and better commutativity on most builds." +#, fuzzy +msgid "" +"Summation of floats switched to an algorithm that gives higher accuracy and " +"better commutativity on most builds." msgstr "" +"مجموع شناورها به الگوریتمی تبدیل شده است که دقت بالاتر و جابجایی بهتری را در" +" اکثر ساخت‌ها ارائه می‌دهد." #: library/functions.rst:1961 -msgid "Return a proxy object that delegates method calls to a parent or sibling class of *type*. This is useful for accessing inherited methods that have been overridden in a class." +#, fuzzy +msgid "" +"Return a proxy object that delegates method calls to a parent or sibling " +"class of *type*. This is useful for accessing inherited methods that have " +"been overridden in a class." msgstr "" +"یک شیء پراکسی را که فراخوانی های متد را به کلاس والد یا خواهر و برادر *type*" +" واگذار می کند، برگردانید. این برای دسترسی به متدهای ارثی که در یک کلاس رد " +"شده اند مفید است." #: library/functions.rst:1965 -msgid "The *object_or_type* determines the :term:`method resolution order` to be searched. The search starts from the class right after the *type*." +#, fuzzy +msgid "" +"The *object_or_type* determines the :term:`method resolution order` to be " +"searched. The search starts from the class right after the *type*." msgstr "" +"*object_or_type* :term:`method resolution order` مورد جستجو را تعیین می کند." +" جستجو از کلاس درست بعد از *type* شروع می شود." #: library/functions.rst:1969 -msgid "For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C -> A -> object`` and the value of *type* is ``B``, then :func:`super` searches ``C -> A -> object``." +#, fuzzy +msgid "" +"For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C " +"-> A -> object`` and the value of *type* is ``B``, then :func:`super` " +"searches ``C -> A -> object``." msgstr "" +"به عنوان مثال، اگر :attr:`~type.__mro__` از *object_or_type* ``D -> B -> C " +"-> A -> object`` و مقدار *type* ``B`` باشد، :func:`super` ``C -> A -> " +"object`` را جستجو می کند." #: library/functions.rst:1973 -msgid "The :attr:`~type.__mro__` attribute of the class corresponding to *object_or_type* lists the method resolution search order used by both :func:`getattr` and :func:`super`. The attribute is dynamic and can change whenever the inheritance hierarchy is updated." +#, fuzzy +msgid "" +"The :attr:`~type.__mro__` attribute of the class corresponding to " +"*object_or_type* lists the method resolution search order used by both " +":func:`getattr` and :func:`super`. The attribute is dynamic and can change " +"whenever the inheritance hierarchy is updated." msgstr "" +"ویژگی :attr:`~type.__mro__` کلاس مربوط به *object_or_type* ترتیب جستجوی وضوح" +" روش مورد استفاده توسط :func:`getattr` و :func:`super` را فهرست می کند. " +"ویژگی پویا است و هر زمان که سلسله مراتب وراثت به روز شود می تواند تغییر کند." #: library/functions.rst:1978 -msgid "If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, ``issubclass(type2, type)`` must be true (this is useful for classmethods)." +#, fuzzy +msgid "" +"If the second argument is omitted, the super object returned is unbound. If" +" the second argument is an object, ``isinstance(obj, type)`` must be true. " +"If the second argument is a type, ``issubclass(type2, type)`` must be true " +"(this is useful for classmethods)." msgstr "" +"اگر آرگومان دوم حذف شود، شی فوق العاده بازگردانده شده بدون محدودیت است. اگر" +" آرگومان دوم یک شی باشد، ``isinstance(obj, type)`` باید درست باشد. اگر " +"آرگومان دوم یک نوع باشد، ``issubclass(type2, type)`` باید درست باشد (این " +"برای متدهای کلاس مفید است)." #: library/functions.rst:1983 -msgid "When called directly within an ordinary method of a class, both arguments may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will be the enclosing class, and *obj* will be the first argument of the immediately enclosing function (typically ``self``). (This means that zero-argument :func:`!super` will not work as expected within nested functions, including generator expressions, which implicitly create nested functions.)" -msgstr "" +#, fuzzy +msgid "" +"When called directly within an ordinary method of a class, both arguments " +"may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will" +" be the enclosing class, and *obj* will be the first argument of the " +"immediately enclosing function (typically ``self``). (This means that zero-" +"argument :func:`!super` will not work as expected within nested functions, " +"including generator expressions, which implicitly create nested functions.)" +msgstr "" +"هنگامی که مستقیماً در یک متد معمولی یک کلاس فراخوانی می شود، هر دو آرگومان " +"ممکن است حذف شوند (\"Argument Zero-Argument :func:`!super`\"). در این حالت، " +"*type* کلاس احاطه کننده و *obj* اولین آرگومان تابع محصور کننده فوری (معمولاً" +" ``self``) خواهد بود. (این بدان معناست که :func:`!super` با آرگومان صفر در " +"توابع تو در تو, از جمله عبارات مولد, که به طور ضمنی توابع تودرتو ایجاد می " +"کنند, مطابق انتظار عمل نمی کند.)" #: library/functions.rst:1990 -msgid "There are two typical use cases for *super*. In a class hierarchy with single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use closely parallels the use of *super* in other programming languages." +#, fuzzy +msgid "" +"There are two typical use cases for *super*. In a class hierarchy with " +"single inheritance, *super* can be used to refer to parent classes without " +"naming them explicitly, thus making the code more maintainable. This use " +"closely parallels the use of *super* in other programming languages." msgstr "" +"دو مورد استفاده معمولی برای *super* وجود دارد. در یک سلسله مراتب کلاس با " +"وراثت تک، *super* می تواند برای ارجاع به کلاس های والد بدون نامگذاری صریح " +"استفاده شود، بنابراین کد قابل نگهداری تر می شود. این استفاده با استفاده از " +"*super* در سایر زبان های برنامه نویسی مشابه است." #: library/functions.rst:1995 -msgid "The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes it possible to implement \"diamond diagrams\" where multiple base classes implement the same method. Good design dictates that such implementations have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts to changes in the class hierarchy, and because that order can include sibling classes that are unknown prior to runtime)." -msgstr "" +#, fuzzy +msgid "" +"The second use case is to support cooperative multiple inheritance in a " +"dynamic execution environment. This use case is unique to Python and is not" +" found in statically compiled languages or languages that only support " +"single inheritance. This makes it possible to implement \"diamond " +"diagrams\" where multiple base classes implement the same method. Good " +"design dictates that such implementations have the same calling signature in" +" every case (because the order of calls is determined at runtime, because " +"that order adapts to changes in the class hierarchy, and because that order " +"can include sibling classes that are unknown prior to runtime)." +msgstr "" +"دومین مورد استفاده، پشتیبانی از وراثت چندگانه تعاونی در یک محیط اجرای پویا " +"است. این مورد استفاده مختص پایتون است و در زبان‌های کامپایل‌شده یا " +"زبان‌هایی که فقط از وراثت تک پشتیبانی می‌کنند، یافت نمی‌شود. این امکان " +"پیاده سازی \"نمودارهای الماس\" را فراهم می کند که در آن چندین کلاس پایه یک " +"روش را اجرا می کنند. طراحی خوب حکم می‌کند که چنین پیاده‌سازی‌هایی دارای " +"امضای فراخوانی یکسانی در هر مورد باشند (زیرا ترتیب تماس‌ها در زمان اجرا " +"تعیین می‌شود, زیرا این ترتیب با تغییرات سلسله مراتب کلاس سازگار می‌شود, و " +"چون این ترتیب می‌تواند شامل کلاس‌های خواهر و برادری باشد که قبل از اجرا " +"ناشناخته هستند)." #: library/functions.rst:2005 +#, fuzzy msgid "For both use cases, a typical superclass call looks like this::" -msgstr "" +msgstr "برای هر دو مورد استفاده، یک فراخوانی معمولی سوپرکلاس به صورت زیر است:" #: library/functions.rst:2007 -msgid "class C(B):\n" +#, fuzzy +msgid "" +"class C(B):\n" " def method(self, arg):\n" " super().method(arg) # This does the same thing as:\n" " # super(C, self).method(arg)" msgstr "" +"class C(B):\n" +" def method(self, arg):\n" +" super().method(arg) # This does the same thing as:\n" +" # super(C, self).method(arg)" #: library/functions.rst:2012 -msgid "In addition to method lookups, :func:`super` also works for attribute lookups. One possible use case for this is calling :term:`descriptors ` in a parent or sibling class." +#, fuzzy +msgid "" +"In addition to method lookups, :func:`super` also works for attribute " +"lookups. One possible use case for this is calling :term:`descriptors " +"` in a parent or sibling class." msgstr "" +"علاوه بر جستجوی روش، :func:`super` برای جستجوی ویژگی ها نیز کار می کند. یکی" +" از موارد استفاده ممکن برای این، فراخوانی :term:`descriptors ` " +"در کلاس والدین یا خواهر و برادر است." #: library/functions.rst:2016 -msgid "Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`~object.__getattribute__` method for searching classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``." -msgstr "" +#, fuzzy +msgid "" +"Note that :func:`super` is implemented as part of the binding process for " +"explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " +"does so by implementing its own :meth:`~object.__getattribute__` method for " +"searching classes in a predictable order that supports cooperative multiple " +"inheritance. Accordingly, :func:`super` is undefined for implicit lookups " +"using statements or operators such as ``super()[name]``." +msgstr "" +"توجه داشته باشید که :func:`super` به عنوان بخشی از فرآیند binding برای " +"جستجوی مشخصه های نقطه گذاری صریح مانند ``super().__getitem__(name)`` پیاده " +"سازی می شود. این کار را با پیاده‌سازی روش :meth:`~object.__getattribute__` " +"خود برای جستجوی کلاس‌ها با ترتیبی قابل پیش‌بینی انجام می‌دهد که از وراثت " +"چندگانه تعاونی پشتیبانی می‌کند. بر این اساس، :func:`super` برای جستجوهای " +"ضمنی با استفاده از عبارات یا عملگرهایی مانند ``super()[name]`` تعریف نشده " +"است." #: library/functions.rst:2024 -msgid "Also note that, aside from the zero argument form, :func:`super` is not limited to use inside methods. The two argument form specifies the arguments exactly and makes the appropriate references. The zero argument form only works inside a class definition, as the compiler fills in the necessary details to correctly retrieve the class being defined, as well as accessing the current instance for ordinary methods." -msgstr "" +#, fuzzy +msgid "" +"Also note that, aside from the zero argument form, :func:`super` is not " +"limited to use inside methods. The two argument form specifies the " +"arguments exactly and makes the appropriate references. The zero argument " +"form only works inside a class definition, as the compiler fills in the " +"necessary details to correctly retrieve the class being defined, as well as " +"accessing the current instance for ordinary methods." +msgstr "" +"همچنین توجه داشته باشید که به غیر از فرم آرگومان صفر، :func:`super` محدود به" +" استفاده از متدهای داخلی نیست. فرم دو آرگومان آرگومان ها را دقیقا مشخص می " +"کند و ارجاعات مناسب را ایجاد می کند. فرم آرگومان صفر فقط در داخل تعریف کلاس" +" کار می کند، زیرا کامپایلر جزئیات لازم را برای بازیابی صحیح کلاس تعریف شده و" +" همچنین دسترسی به نمونه فعلی برای متدهای معمولی پر می کند." #: library/functions.rst:2031 -msgid "For practical suggestions on how to design cooperative classes using :func:`super`, see `guide to using super() `_." +#, fuzzy +msgid "" +"For practical suggestions on how to design cooperative classes using " +":func:`super`, see `guide to using super() " +"`_." msgstr "" +"برای پیشنهادات عملی در مورد نحوه طراحی کلاس های تعاونی با استفاده از " +":func:`super`، به `guide to using super() " +"`_ " +"مراجعه کنید." #: library/functions.rst:2041 -msgid "Rather than being a function, :class:`tuple` is actually an immutable sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." +#, fuzzy +msgid "" +"Rather than being a function, :class:`tuple` is actually an immutable " +"sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" +":class:`tuple` به جای اینکه یک تابع باشد، در واقع یک نوع دنباله تغییر ناپذیر" +" است، همانطور که در :ref:`typesseq-tuple` و :ref:`typesseq` مستند شده است." #: library/functions.rst:2050 -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__`." +#, fuzzy +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* را برگردانید. مقدار بازگشتی یک شی نوع و عموماً " +"همان شیء است که توسط :attr:`object.__class__` برگردانده شده است." #: library/functions.rst:2054 -msgid "The :func:`isinstance` built-in function is recommended for testing the type of an object, because it takes subclasses into account." +#, fuzzy +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` برای آزمایش نوع یک شی توصیه می شود، زیرا زیر " +"کلاس ها را در نظر می گیرد." #: library/functions.rst:2057 -msgid "With three arguments, return a new type object. This is essentially a dynamic form of the :keyword:`class` statement. The *name* string is the class name and becomes the :attr:`~type.__name__` attribute. The *bases* tuple contains the base classes and becomes the :attr:`~type.__bases__` attribute; if empty, :class:`object`, the ultimate base of all classes, is added. The *dict* dictionary contains attribute and method definitions for the class body; it may be copied or wrapped before becoming the :attr:`~type.__dict__` attribute. The following two statements create identical :class:`!type` objects:" -msgstr "" +#, fuzzy +msgid "" +"With three arguments, return a new type object. This is essentially a " +"dynamic form of the :keyword:`class` statement. The *name* string is the " +"class name and becomes the :attr:`~type.__name__` attribute. The *bases* " +"tuple contains the base classes and becomes the :attr:`~type.__bases__` " +"attribute; if empty, :class:`object`, the ultimate base of all classes, is " +"added. The *dict* dictionary contains attribute and method definitions for " +"the class body; it may be copied or wrapped before becoming the " +":attr:`~type.__dict__` attribute. The following two statements create " +"identical :class:`!type` objects:" +msgstr "" +"با سه آرگومان، یک شی از نوع جدید برگردانید. این در اصل یک شکل پویا از دستور" +" :keyword:`class` است. رشته *name* نام کلاس است و به ویژگی " +":attr:`~type.__name__` تبدیل می شود. تاپل *bases* شامل کلاس های پایه است و " +"به ویژگی :attr:`~type.__bases__` تبدیل می شود. اگر خالی باشد، " +":class:`object`، پایه نهایی همه کلاس ها، اضافه می شود. فرهنگ لغت *dict* " +"شامل تعاریف ویژگی و متد برای بدنه کلاس است. ممکن است قبل از تبدیل شدن به " +"ویژگی :attr:`~type.__dict__` کپی یا بسته بندی شود. دو عبارت زیر اشیاء " +":class:`!type` یکسان ایجاد می کنند:" #: library/functions.rst:2072 +#, fuzzy msgid "See also:" -msgstr "" +msgstr "همچنین ببینید:" #: library/functions.rst:2074 -msgid ":ref:`Documentation on attributes and methods on classes `." +#, fuzzy +msgid "" +":ref:`Documentation on attributes and methods on classes `." msgstr "" +":ref:`Documentation on attributes and methods on classes `." #: library/functions.rst:2075 +#, fuzzy msgid ":ref:`bltin-type-objects`" -msgstr "" +msgstr ":ref:`bltin-type-objects`" #: library/functions.rst:2077 -msgid "Keyword arguments provided to the three argument form are passed to the appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) in the same way that keywords in a class definition (besides *metaclass*) would." +#, fuzzy +msgid "" +"Keyword arguments provided to the three argument form are passed to the " +"appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " +"in the same way that keywords in a class definition (besides *metaclass*) " +"would." msgstr "" +"آرگومان های کلیدواژه ارائه شده به فرم سه آرگومان به ماشین های متاکلاس مناسب " +"(معمولاً :meth:`~object.__init_subclass__`) به همان روشی که کلمات کلیدی در " +"تعریف کلاس (علاوه بر *metaclass*) ارائه می شوند، ارسال می شود." #: library/functions.rst:2082 +#, fuzzy msgid "See also :ref:`class-customization`." -msgstr "" +msgstr "همچنین به :ref:`class-customization` مراجعه کنید." #: library/functions.rst:2084 -msgid "Subclasses of :class:`!type` which don't override ``type.__new__`` may no longer use the one-argument form to get the type of an object." +#, fuzzy +msgid "" +"Subclasses of :class:`!type` which don't override ``type.__new__`` may no " +"longer use the one-argument form to get the type of an object." msgstr "" +"زیر کلاس‌های :class:`!type` که ``type.__new__`` را لغو نمی‌کنند، دیگر " +"نمی‌توانند از فرم تک آرگومان برای دریافت نوع یک شی استفاده کنند." #: library/functions.rst:2091 -msgid "Return the :attr:`~object.__dict__` attribute for a module, class, instance, or any other object with a :attr:`!__dict__` attribute." +#, fuzzy +msgid "" +"Return the :attr:`~object.__dict__` attribute for a module, class, instance," +" or any other object with a :attr:`!__dict__` attribute." msgstr "" +"ویژگی :attr:`~object.__dict__` را برای یک ماژول، کلاس، نمونه یا هر شی دیگری " +"با ویژگی :attr:`!__dict__` برگردانید." #: library/functions.rst:2094 -msgid "Objects such as modules and instances have an updateable :attr:`~object.__dict__` attribute; however, other objects may have write restrictions on their :attr:`!__dict__` attributes (for example, classes use a :class:`types.MappingProxyType` to prevent direct dictionary updates)." +#, fuzzy +msgid "" +"Objects such as modules and instances have an updateable " +":attr:`~object.__dict__` attribute; however, other objects may have write " +"restrictions on their :attr:`!__dict__` attributes (for example, classes use" +" a :class:`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" +"اشیایی مانند ماژول ها و نمونه ها دارای ویژگی :attr:`~object.__dict__` قابل " +"به روز رسانی هستند. با این حال، اشیاء دیگر ممکن است محدودیت های نوشتن در " +"ویژگی های :attr:`!__dict__` خود داشته باشند (به عنوان مثال, کلاس ها از " +":class:`types.MappingProxyType` برای جلوگیری از به روز رسانی مستقیم فرهنگ " +"لغت استفاده می کنند)." #: library/functions.rst:2099 +#, fuzzy msgid "Without an argument, :func:`vars` acts like :func:`locals`." -msgstr "" +msgstr "بدون استدلال، :func:`vars` مانند :func:`locals` عمل می کند." #: library/functions.rst:2101 -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)." +#, fuzzy +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 "" +"یک استثنا :exc:`TypeError` در صورتی مطرح می شود که یک شی مشخص شده باشد اما " +"ویژگی :attr:`~object.__dict__` نداشته باشد (به عنوان مثال, اگر کلاس آن ویژگی" +" :attr:`~object.__slots__` را تعریف کند)." #: library/functions.rst:2107 -msgid "The result of calling this function without an argument has been updated as described for the :func:`locals` builtin." +#, fuzzy +msgid "" +"The result of calling this function without an argument has been updated as " +"described for the :func:`locals` builtin." msgstr "" +"نتیجه فراخوانی این تابع بدون آرگومان همانطور که برای داخلی :func:`locals` " +"توضیح داده شد به روز شده است." #: library/functions.rst:2113 -msgid "Iterate over several iterables in parallel, producing tuples with an item from each one." +#, fuzzy +msgid "" +"Iterate over several iterables in parallel, producing tuples with an item " +"from each one." msgstr "" +"بر روی چندین تکرار به صورت موازی تکرار کنید، تاپل هایی با یک آیتم از هر یک " +"تولید کنید." #: library/functions.rst:2116 +#, fuzzy msgid "Example::" -msgstr "" +msgstr "مثال::" #: library/functions.rst:2118 -msgid ">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" +#, fuzzy +msgid "" +">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" "... print(item)\n" "...\n" "(1, 'sugar')\n" "(2, 'spice')\n" "(3, 'everything nice')" msgstr "" +">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" +"... print(item)\n" +"...\n" +"(1, 'sugar')\n" +"(2, 'spice')\n" +"(3, 'everything nice')" #: library/functions.rst:2125 -msgid "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th tuple contains the *i*-th element from each of the argument iterables." +#, fuzzy +msgid "" +"More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " +"tuple contains the *i*-th element from each of the argument iterables." msgstr "" +"به طور رسمی تر: :func:`zip` یک تکرار از تاپل ها را برمی گرداند، که در آن " +"تاپل *i*-امین عنصر *i*-امین هر یک از تکرارپذیرهای آرگومان است." #: library/functions.rst:2128 -msgid "Another way to think of :func:`zip` is that it turns rows into columns, and columns into rows. This is similar to `transposing a matrix `_." +#, fuzzy +msgid "" +"Another way to think of :func:`zip` is that it turns rows into columns, and " +"columns into rows. This is similar to `transposing a matrix " +"`_." msgstr "" +"راه دیگری برای فکر کردن به :func:`zip` این است که ردیف ها را به ستون و ستون " +"ها را به ردیف تبدیل می کند. این شبیه به `transposing a matrix " +"`_ است." #: library/functions.rst:2132 -msgid ":func:`zip` is lazy: The elements won't be processed until the iterable is iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:`list`." +#, fuzzy +msgid "" +":func:`zip` is lazy: The elements won't be processed until the iterable is " +"iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a " +":class:`list`." msgstr "" +":func:`zip` تنبل است: عناصر پردازش نمی شوند تا زمانی که تکرار شونده روی آن " +"تکرار شود، به عنوان مثال. توسط یک حلقه :keyword:`!for` یا با پیچیدن در یک " +":class:`list`." #: library/functions.rst:2136 -msgid "One thing to consider is that the iterables passed to :func:`zip` could have different lengths; sometimes by design, and sometimes because of a bug in the code that prepared these iterables. Python offers three different approaches to dealing with this issue:" +#, fuzzy +msgid "" +"One thing to consider is that the iterables passed to :func:`zip` could have" +" different lengths; sometimes by design, and sometimes because of a bug in " +"the code that prepared these iterables. Python offers three different " +"approaches to dealing with this issue:" msgstr "" +"نکته ای که باید در نظر گرفت این است که تکرارهای ارسال شده به :func:`zip` می " +"توانند طول های متفاوتی داشته باشند. گاهی بر اساس طراحی، و گاهی به دلیل وجود " +"اشکال در کدی که این تکرارپذیرها را آماده کرده است. پایتون سه رویکرد مختلف " +"برای مقابله با این موضوع ارائه می دهد:" #: library/functions.rst:2141 -msgid "By default, :func:`zip` stops when the shortest iterable is exhausted. It will ignore the remaining items in the longer iterables, cutting off the result to the length of the shortest iterable::" +#, fuzzy +msgid "" +"By default, :func:`zip` stops when the shortest iterable is exhausted. It " +"will ignore the remaining items in the longer iterables, cutting off the " +"result to the length of the shortest iterable::" msgstr "" +"به‌طور پیش‌فرض، :func:`zip` زمانی متوقف می‌شود که کوتاه‌ترین قابل تکرار تمام" +" شود. موارد باقیمانده در تکرارپذیرهای طولانی‌تر را نادیده می‌گیرد و نتیجه را" +" به طول کوتاه‌ترین تکرارپذیر کاهش می‌دهد::" #: library/functions.rst:2145 -msgid ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" +#, fuzzy +msgid "" +">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" msgstr "" +">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" +"[(0, 'fee'), (1, 'fi'), (2, 'fo')]" #: library/functions.rst:2148 -msgid ":func:`zip` is often used in cases where the iterables are assumed to be of equal length. In such cases, it's recommended to use the ``strict=True`` option. Its output is the same as regular :func:`zip`::" +#, fuzzy +msgid "" +":func:`zip` is often used in cases where the iterables are assumed to be of " +"equal length. In such cases, it's recommended to use the ``strict=True`` " +"option. Its output is the same as regular :func:`zip`::" msgstr "" +":func:`zip` اغلب در مواردی استفاده می شود که طول تکرارپذیرها برابر فرض می " +"شود. در چنین مواردی، توصیه می شود از گزینه ``strict=True`` استفاده کنید. " +"خروجی آن مانند :func:`zip` معمولی است::" #: library/functions.rst:2152 -msgid ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" +#, fuzzy +msgid "" +">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" msgstr "" +">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" +"[('a', 1), ('b', 2), ('c', 3)]" #: library/functions.rst:2155 -msgid "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable is exhausted before the others:" +#, fuzzy +msgid "" +"Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " +"is exhausted before the others:" msgstr "" +"برخلاف رفتار پیش‌فرض، اگر یک تکرار قبل از بقیه تمام شود، یک " +":exc:`ValueError` را افزایش می‌دهد:" #: library/functions.rst:2173 -msgid "Without the ``strict=True`` argument, any bug that results in iterables of different lengths will be silenced, possibly manifesting as a hard-to-find bug in another part of the program." +#, fuzzy +msgid "" +"Without the ``strict=True`` argument, any bug that results in iterables of " +"different lengths will be silenced, possibly manifesting as a hard-to-find " +"bug in another part of the program." msgstr "" +"بدون آرگومان ``strict=True``، هر اشکالی که منجر به تکرارپذیری با طول های " +"مختلف شود، خاموش می شود و احتمالاً به عنوان یک اشکال به سختی یافتن در قسمت " +"دیگری از برنامه ظاهر می شود." #: library/functions.rst:2177 -msgid "Shorter iterables can be padded with a constant value to make all the iterables have the same length. This is done by :func:`itertools.zip_longest`." +#, fuzzy +msgid "" +"Shorter iterables can be padded with a constant value to make all the " +"iterables have the same length. This is done by " +":func:`itertools.zip_longest`." msgstr "" +"تکرارهای کوتاه‌تر را می‌توان با یک مقدار ثابت اضافه کرد تا طول همه تکرار " +"شونده‌ها یکسان باشد. این کار توسط :func:`itertools.zip_longest` انجام می " +"شود." #: library/functions.rst:2181 -msgid "Edge cases: With a single iterable argument, :func:`zip` returns an iterator of 1-tuples. With no arguments, it returns an empty iterator." +#, fuzzy +msgid "" +"Edge cases: With a single iterable argument, :func:`zip` returns an iterator" +" of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" +"موارد لبه: با یک آرگومان تکرارپذیر، :func:`zip` تکرار کننده 1-tuples را برمی" +" گرداند. بدون هیچ آرگومان، یک تکرار کننده خالی برمی گرداند." #: library/functions.rst:2184 +#, fuzzy msgid "Tips and tricks:" -msgstr "" +msgstr "نکات و ترفندها:" #: library/functions.rst:2186 -msgid "The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a data series into n-length groups using ``zip(*[iter(s)]*n, strict=True)``. This repeats the *same* iterator ``n`` times so that each output tuple has the result of ``n`` calls to the iterator. This has the effect of dividing the input into n-length chunks." -msgstr "" +#, fuzzy +msgid "" +"The left-to-right evaluation order of the iterables is guaranteed. This " +"makes possible an idiom for clustering a data series into n-length groups " +"using ``zip(*[iter(s)]*n, strict=True)``. This repeats the *same* iterator " +"``n`` times so that each output tuple has the result of ``n`` calls to the " +"iterator. This has the effect of dividing the input into n-length chunks." +msgstr "" +"ترتیب ارزیابی از چپ به راست تکرارپذیرها تضمین شده است. این یک اصطلاح را برای" +" خوشه‌بندی یک سری داده در گروه‌های طول n با استفاده از ``zip(*[iter(s)]*n, " +"strict=True)`` ممکن می‌سازد. این کار تکرار *same* ``n`` را بارها تکرار می " +"کند تا هر تاپل خروجی نتیجه فراخوانی ``n`` را به تکرار کننده داشته باشد. این " +"اثر تقسیم ورودی به تکه های n طول دارد." #: library/functions.rst:2192 -msgid ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a list::" +#, fuzzy +msgid "" +":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " +"list::" msgstr "" +":func:`zip` در ارتباط با اپراتور ``*`` می تواند برای باز کردن یک لیست " +"استفاده شود::" #: library/functions.rst:2195 -msgid ">>> x = [1, 2, 3]\n" +#, fuzzy +msgid "" +">>> x = [1, 2, 3]\n" ">>> y = [4, 5, 6]\n" ">>> list(zip(x, y))\n" "[(1, 4), (2, 5), (3, 6)]\n" @@ -2022,193 +4630,330 @@ msgid ">>> x = [1, 2, 3]\n" ">>> x == list(x2) and y == list(y2)\n" "True" msgstr "" +">>> x = [1, 2, 3]\n" +">>> y = [4, 5, 6]\n" +">>> list(zip(x, y))\n" +"[(1, 4), (2, 5), (3, 6)]\n" +">>> x2, y2 = zip(*zip(x, y))\n" +">>> x == list(x2) and y == list(y2)\n" +"True" #: library/functions.rst:2203 +#, fuzzy msgid "Added the ``strict`` argument." -msgstr "" +msgstr "آرگومان ``strict`` اضافه شد." #: library/functions.rst:2215 -msgid "This is an advanced function that is not needed in everyday Python programming, unlike :func:`importlib.import_module`." +#, fuzzy +msgid "" +"This is an advanced function that is not needed in everyday Python " +"programming, unlike :func:`importlib.import_module`." msgstr "" +"این یک تابع پیشرفته است که برخلاف :func:`importlib.import_module` در برنامه " +"نویسی روزمره پایتون مورد نیاز نیست." #: library/functions.rst:2218 -msgid "This function is invoked by the :keyword:`import` statement. It can be replaced (by importing the :mod:`builtins` module and assigning to ``builtins.__import__``) in order to change semantics of the :keyword:`!import` statement, but doing so is **strongly** discouraged as it is usually simpler to use import hooks (see :pep:`302`) to attain the same goals and does not cause issues with code which assumes the default import implementation is in use. Direct use of :func:`__import__` is also discouraged in favor of :func:`importlib.import_module`." -msgstr "" +#, fuzzy +msgid "" +"This function is invoked by the :keyword:`import` statement. It can be " +"replaced (by importing the :mod:`builtins` module and assigning to " +"``builtins.__import__``) in order to change semantics of the " +":keyword:`!import` statement, but doing so is **strongly** discouraged as it" +" is usually simpler to use import hooks (see :pep:`302`) to attain the same " +"goals and does not cause issues with code which assumes the default import " +"implementation is in use. Direct use of :func:`__import__` is also " +"discouraged in favor of :func:`importlib.import_module`." +msgstr "" +"این تابع توسط دستور :keyword:`import` فراخوانی می شود. می توان آن را " +"جایگزین کرد (با وارد کردن ماژول :mod:`builtins` و تخصیص به " +"``builtins.__import__``) به منظور تغییر معنایی دستور :keyword:`!import`، اما" +" انجام این کار **strongly** منع می شود زیرا معمولاً استفاده از قلاب های " +"واردات ساده تر است (به :pep:`302` مراجعه کنید) برای دستیابی به اهداف مشابه و" +" باعث ایجاد مشکلاتی در پیاده سازی پیش فرض نمی شود. استفاده مستقیم از " +":func:`__import__` نیز به نفع :func:`importlib.import_module` منع شده است." #: library/functions.rst:2227 -msgid "The function imports the module *name*, potentially using the given *globals* and *locals* to determine how to interpret the name in a package context. The *fromlist* gives the names of objects or submodules that should be imported from the module given by *name*. The standard implementation does not use its *locals* argument at all and uses its *globals* only to determine the package context of the :keyword:`import` statement." -msgstr "" +#, fuzzy +msgid "" +"The function imports the module *name*, potentially using the given " +"*globals* and *locals* to determine how to interpret the name in a package " +"context. The *fromlist* gives the names of objects or submodules that should" +" be imported from the module given by *name*. The standard implementation " +"does not use its *locals* argument at all and uses its *globals* only to " +"determine the package context of the :keyword:`import` statement." +msgstr "" +"این تابع، ماژول *name* را وارد می کند، به طور بالقوه از *globals* و *locals*" +" داده شده برای تعیین نحوه تفسیر نام در زمینه بسته استفاده می کند. *fromlist*" +" نام اشیا یا زیر ماژول هایی را می دهد که باید از ماژول ارائه شده توسط *name*" +" وارد شوند. پیاده سازی استاندارد به هیچ وجه از آرگومان *locals* خود استفاده" +" نمی کند و از *globals* خود فقط برای تعیین بافت بسته دستور :keyword:`import`" +" استفاده می کند." #: library/functions.rst:2234 -msgid "*level* specifies whether to use absolute or relative imports. ``0`` (the default) means only perform absolute imports. Positive values for *level* indicate the number of parent directories to search relative to the directory of the module calling :func:`__import__` (see :pep:`328` for the details)." +#, fuzzy +msgid "" +"*level* specifies whether to use absolute or relative imports. ``0`` (the " +"default) means only perform absolute imports. Positive values for *level* " +"indicate the number of parent directories to search relative to the " +"directory of the module calling :func:`__import__` (see :pep:`328` for the " +"details)." msgstr "" +"*level* مشخص می کند که آیا از واردات مطلق یا نسبی استفاده شود. ``0`` " +"(پیش‌فرض) به این معنی است که فقط واردات مطلق را انجام دهید. مقادیر مثبت " +"*level* تعداد دایرکتوری‌های والد را نشان می‌دهد که نسبت به دایرکتوری ماژول " +"فراخوانی :func:`__import__` هستند (برای جزئیات به :pep:`328` مراجعه کنید)." #: library/functions.rst:2240 -msgid "When the *name* variable is of the form ``package.module``, normally, the top-level package (the name up till the first dot) is returned, *not* the module named by *name*. However, when a non-empty *fromlist* argument is given, the module named by *name* is returned." +#, fuzzy +msgid "" +"When the *name* variable is of the form ``package.module``, normally, the " +"top-level package (the name up till the first dot) is returned, *not* the " +"module named by *name*. However, when a non-empty *fromlist* argument is " +"given, the module named by *name* is returned." msgstr "" +"هنگامی که متغیر *name* به شکل ``package.module`` باشد، معمولاً بسته سطح بالا" +" (نام تا اولین نقطه) برگردانده می شود، ماژول *not* که توسط *name* نامگذاری " +"شده است. با این حال، هنگامی که یک آرگومان غیر خالی *fromlist* داده می شود، " +"ماژول نام گذاری شده توسط *name* برگردانده می شود." #: library/functions.rst:2245 -msgid "For example, the statement ``import spam`` results in bytecode resembling the following code::" +#, fuzzy +msgid "" +"For example, the statement ``import spam`` results in bytecode resembling " +"the following code::" msgstr "" +"به عنوان مثال، عبارت ``import spam`` منجر به بایت کد مشابه کد زیر می شود:" #: library/functions.rst:2248 +#, fuzzy msgid "spam = __import__('spam', globals(), locals(), [], 0)" -msgstr "" +msgstr "spam = __import__('spam', globals(), locals(), [], 0)" #: library/functions.rst:2250 +#, fuzzy msgid "The statement ``import spam.ham`` results in this call::" -msgstr "" +msgstr "عبارت ``import spam.ham`` در این فراخوانی نتیجه می گیرد:" #: library/functions.rst:2252 +#, fuzzy msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" -msgstr "" +msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" #: library/functions.rst:2254 -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." +#, fuzzy +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` به یک نام محدود می" +" شود." #: library/functions.rst:2257 -msgid "On the other hand, the statement ``from spam.ham import eggs, sausage as saus`` results in ::" +#, fuzzy +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`` به صورت " +"زیر است:" #: library/functions.rst:2260 -msgid "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" +#, fuzzy +msgid "" +"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" "eggs = _temp.eggs\n" "saus = _temp.sausage" msgstr "" +"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" +"eggs = _temp.eggs\n" +"saus = _temp.sausage" #: library/functions.rst:2264 -msgid "Here, the ``spam.ham`` module is returned from :func:`__import__`. From this object, the names to import are retrieved and assigned to their respective names." +#, fuzzy +msgid "" +"Here, the ``spam.ham`` module is returned from :func:`__import__`. From " +"this object, the names to import are retrieved and assigned to their " +"respective names." msgstr "" +"در اینجا، ماژول ``spam.ham`` از :func:`__import__` برگردانده می شود. از این" +" شی، نام‌هایی که وارد می‌شوند بازیابی می‌شوند و به نام‌های مربوطه تخصیص " +"می‌یابند." #: library/functions.rst:2268 -msgid "If you simply want to import a module (potentially within a package) by name, use :func:`importlib.import_module`." +#, fuzzy +msgid "" +"If you simply want to import a module (potentially within a package) by " +"name, use :func:`importlib.import_module`." msgstr "" +"اگر به سادگی می خواهید یک ماژول (به طور بالقوه در یک بسته) را با نام وارد " +"کنید، از :func:`importlib.import_module` استفاده کنید." #: library/functions.rst:2271 -msgid "Negative values for *level* are no longer supported (which also changes the default value to 0)." +#, fuzzy +msgid "" +"Negative values for *level* are no longer supported (which also changes the " +"default value to 0)." msgstr "" +"مقادیر منفی برای *level* دیگر پشتیبانی نمی شود (که همچنین مقدار پیش فرض را " +"به 0 تغییر می دهد)." #: library/functions.rst:2275 -msgid "When the command line options :option:`-E` or :option:`-I` are being used, the environment variable :envvar:`PYTHONCASEOK` is now ignored." +#, fuzzy +msgid "" +"When the command line options :option:`-E` or :option:`-I` are being used, " +"the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" +"هنگامی که از گزینه های خط فرمان :option:`-E` یا :option:`-I` استفاده می شود،" +" متغیر محیطی :envvar:`PYTHONCASEOK` اکنون نادیده گرفته می شود." #: library/functions.rst:2280 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: library/functions.rst:2281 -msgid "Note that the parser only accepts the Unix-style end of line convention. If you are reading the code from a file, make sure to use newline conversion mode to convert Windows or Mac-style newlines." +#, fuzzy +msgid "" +"Note that the parser only accepts the Unix-style end of line convention. If " +"you are reading the code from a file, make sure to use newline conversion " +"mode to convert Windows or Mac-style newlines." msgstr "" +"توجه داشته باشید که تجزیه کننده فقط قرارداد پایان خط به سبک یونیکس را می " +"پذیرد. اگر در حال خواندن کد از یک فایل هستید، مطمئن شوید که از حالت تبدیل خط" +" جدید برای تبدیل خطوط جدید به سبک ویندوز یا مک استفاده کنید." #: library/functions.rst:154 +#, fuzzy msgid "Boolean" -msgstr "" +msgstr "بولی" -#: library/functions.rst:154 -#: library/functions.rst:2048 +#: library/functions.rst:154 library/functions.rst:2048 +#, fuzzy msgid "type" -msgstr "" +msgstr "نوع" #: library/functions.rst:648 +#, fuzzy msgid "built-in function" -msgstr "" +msgstr "عملکرد داخلی" #: library/functions.rst:648 +#, fuzzy msgid "exec" -msgstr "" +msgstr "اجرایی" #: library/functions.rst:746 +#, fuzzy msgid "NaN" -msgstr "" +msgstr "NaN" #: library/functions.rst:746 +#, fuzzy msgid "Infinity" -msgstr "" +msgstr "بی نهایت" #: library/functions.rst:814 +#, fuzzy msgid "__format__" -msgstr "" +msgstr "__format__" -#: library/functions.rst:814 -#: library/functions.rst:1925 +#: library/functions.rst:814 library/functions.rst:1925 +#, fuzzy msgid "string" -msgstr "" +msgstr "رشته" #: library/functions.rst:814 +#, fuzzy msgid "format() (built-in function)" -msgstr "" +msgstr "format() (تابع داخلی)" #: library/functions.rst:1325 +#, fuzzy msgid "file object" -msgstr "" +msgstr "شی فایل" -#: library/functions.rst:1325 -#: library/functions.rst:1446 +#: library/functions.rst:1325 library/functions.rst:1446 +#, fuzzy msgid "open() built-in function" -msgstr "" +msgstr "تابع داخلی open()." #: library/functions.rst:1353 +#, fuzzy msgid "file" -msgstr "" +msgstr "فایل" #: library/functions.rst:1353 +#, fuzzy msgid "modes" -msgstr "" +msgstr "حالت ها" #: library/functions.rst:1446 +#, fuzzy msgid "universal newlines" -msgstr "" +msgstr "خطوط جدید جهانی" #: library/functions.rst:1507 +#, fuzzy msgid "line-buffered I/O" -msgstr "" +msgstr "ورودی/خروجی بافر خطی" #: library/functions.rst:1507 +#, fuzzy msgid "unbuffered I/O" -msgstr "" +msgstr "ورودی/خروجی بافر نشده" #: library/functions.rst:1507 +#, fuzzy msgid "buffer size, I/O" -msgstr "" +msgstr "اندازه بافر، ورودی/خروجی" #: library/functions.rst:1507 +#, fuzzy msgid "I/O control" -msgstr "" +msgstr "کنترل I/O" #: library/functions.rst:1507 +#, fuzzy msgid "buffering" -msgstr "" +msgstr "بافر کردن" #: library/functions.rst:1507 +#, fuzzy msgid "text mode" -msgstr "" +msgstr "حالت متنی" -#: library/functions.rst:1507 -#: library/functions.rst:2209 +#: library/functions.rst:1507 library/functions.rst:2209 +#, fuzzy msgid "module" -msgstr "" +msgstr "ماژول" #: library/functions.rst:1507 +#, fuzzy msgid "sys" -msgstr "" +msgstr "سیستم" #: library/functions.rst:1925 +#, fuzzy msgid "str() (built-in function)" -msgstr "" +msgstr "str() (تابع داخلی)" #: library/functions.rst:2048 +#, fuzzy msgid "object" -msgstr "" +msgstr "شی" #: library/functions.rst:2209 +#, fuzzy msgid "statement" -msgstr "" +msgstr "بیانیه" #: library/functions.rst:2209 +#, fuzzy msgid "import" -msgstr "" +msgstr "واردات" #: library/functions.rst:2209 +#, fuzzy msgid "builtins" -msgstr "" +msgstr "سازه ها" diff --git a/library/stdtypes.po b/library/stdtypes.po index 2d7e920f..a6f32f34 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -17,693 +17,1080 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/stdtypes.rst:8 +#, fuzzy msgid "Built-in Types" -msgstr "" +msgstr "انواع داخلی" #: library/stdtypes.rst:10 -msgid "The following sections describe the standard types that are built into the interpreter." +#, fuzzy +msgid "" +"The following sections describe the standard types that are built into the " +"interpreter." msgstr "" +"بخش های زیر انواع استانداردی را که در مفسر تعبیه شده اند توضیح می دهد." #: library/stdtypes.rst:15 -msgid "The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions." +#, fuzzy +msgid "" +"The principal built-in types are numerics, sequences, mappings, classes, " +"instances and exceptions." msgstr "" +"انواع اصلی داخلی عبارتند از اعداد، دنباله ها، نگاشت ها، کلاس ها، نمونه ها و " +"استثناها." #: library/stdtypes.rst:18 -msgid "Some collection classes are mutable. The methods that add, subtract, or rearrange their members in place, and don't return a specific item, never return the collection instance itself but ``None``." +#, fuzzy +msgid "" +"Some collection classes are mutable. The methods that add, subtract, or " +"rearrange their members in place, and don't return a specific item, never " +"return the collection instance itself but ``None``." msgstr "" +"برخی از کلاس های مجموعه قابل تغییر هستند. متدهایی که اعضای خود را در جای " +"خود اضافه، تفریق یا بازآرایی می کنند، و آیتم خاصی را بر نمی گرداند، هرگز خود" +" نمونه مجموعه را باز نمی گرداند، جز ``None``." #: library/stdtypes.rst:22 -msgid "Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and converted to a string (with the :func:`repr` function or the slightly different :func:`str` function). The latter function is implicitly used when an object is written by the :func:`print` function." -msgstr "" +#, fuzzy +msgid "" +"Some operations are supported by several object types; in particular, " +"practically all objects can be compared for equality, tested for truth " +"value, and converted to a string (with the :func:`repr` function or the " +"slightly different :func:`str` function). The latter function is implicitly" +" used when an object is written by the :func:`print` function." +msgstr "" +"برخی از عملیات توسط چندین نوع شی پشتیبانی می شوند. به طور خاص، عملاً همه " +"اشیا را می توان برای برابری مقایسه کرد، برای مقدار صدق آزمایش کرد و به یک " +"رشته (با تابع :func:`repr` یا تابع :func:`str` کمی متفاوت) تبدیل کرد. تابع " +"دوم به طور ضمنی زمانی استفاده می شود که یک شی توسط تابع :func:`print` نوشته " +"شود." #: library/stdtypes.rst:32 +#, fuzzy msgid "Truth Value Testing" -msgstr "" +msgstr "تست ارزش حقیقت" #: library/stdtypes.rst:41 -msgid "Any object can be tested for truth value, for use in an :keyword:`if` or :keyword:`while` condition or as operand of the Boolean operations below." +#, fuzzy +msgid "" +"Any object can be tested for truth value, for use in an :keyword:`if` or " +":keyword:`while` condition or as operand of the Boolean operations below." msgstr "" +"هر شی را می توان برای مقدار صدق، برای استفاده در شرایط :keyword:`if` یا " +":keyword:`while` یا به عنوان عملوند عملیات بولی زیر آزمایش کرد." #: library/stdtypes.rst:46 -msgid "By default, an object is considered true unless its class defines either a :meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object.__len__` method that returns zero, when called with the object. [1]_ Here are most of the built-in objects considered false:" +#, fuzzy +msgid "" +"By default, an object is considered true unless its class defines either a " +":meth:`~object.__bool__` method that returns ``False`` or a " +":meth:`~object.__len__` method that returns zero, when called with the " +"object. [1]_ Here are most of the built-in objects considered false:" msgstr "" +"به طور پیش‌فرض، یک شیء درست در نظر گرفته می‌شود، مگر اینکه کلاس آن متد " +":meth:`~object.__bool__` را تعریف کند که ``False`` را برمی‌گرداند یا متد " +":meth:`~object.__len__` را که صفر را برمی‌گرداند، در صورت فراخوانی با شی. " +"[1]_ در اینجا بیشتر اشیاء داخلی نادرست در نظر گرفته می شوند:" #: library/stdtypes.rst:56 +#, fuzzy msgid "constants defined to be false: ``None`` and ``False``" -msgstr "" +msgstr "ثابت های نادرست تعریف شده: ``None`` و ``False``" #: library/stdtypes.rst:58 -msgid "zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, ``Fraction(0, 1)``" +#, fuzzy +msgid "" +"zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, " +"``Fraction(0, 1)``" msgstr "" +"صفر از هر نوع عددی: ``0``، ``0.0``، ``0j``، ``Decimal(0)``، ``Fraction(0, " +"1)``" #: library/stdtypes.rst:61 -msgid "empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, ``range(0)``" +#, fuzzy +msgid "" +"empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, " +"``range(0)``" msgstr "" +"دنباله ها و مجموعه های خالی: ``''``، ``()``، ``[]``، ``{}``، ``set()``، " +"``range(0)``" #: library/stdtypes.rst:70 -msgid "Operations and built-in functions that have a Boolean result always return ``0`` or ``False`` for false and ``1`` or ``True`` for true, unless otherwise stated. (Important exception: the Boolean operations ``or`` and ``and`` always return one of their operands.)" +#, fuzzy +msgid "" +"Operations and built-in functions that have a Boolean result always return " +"``0`` or ``False`` for false and ``1`` or ``True`` for true, unless " +"otherwise stated. (Important exception: the Boolean operations ``or`` and " +"``and`` always return one of their operands.)" msgstr "" +"عملیات و توابع داخلی که دارای نتیجه Boolean هستند همیشه ``0`` یا ``False`` " +"را برای false و ``1`` یا ``True`` را برای true برمی‌گردانند، مگر اینکه خلاف " +"آن ذکر شده باشد. (استثنای مهم: عملیات بولی ``or`` و ``and`` همیشه یکی از " +"عملوندهای خود را برمی گرداند.)" #: library/stdtypes.rst:79 -msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -msgstr "" +#, fuzzy +msgid "" +"Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" +msgstr "عملیات بولی --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" #: library/stdtypes.rst:83 +#, fuzzy msgid "These are the Boolean operations, ordered by ascending priority:" -msgstr "" +msgstr "اینها عملیات بولی هستند که بر اساس اولویت صعودی مرتب شده اند:" -#: library/stdtypes.rst:86 -#: library/stdtypes.rst:144 -#: library/stdtypes.rst:276 -#: library/stdtypes.rst:366 -#: library/stdtypes.rst:416 -#: library/stdtypes.rst:965 +#: library/stdtypes.rst:86 library/stdtypes.rst:144 library/stdtypes.rst:276 +#: library/stdtypes.rst:366 library/stdtypes.rst:416 library/stdtypes.rst:965 #: library/stdtypes.rst:1170 +#, fuzzy msgid "Operation" -msgstr "" +msgstr "عملیات" -#: library/stdtypes.rst:86 -#: library/stdtypes.rst:276 -#: library/stdtypes.rst:366 -#: library/stdtypes.rst:416 -#: library/stdtypes.rst:965 -#: library/stdtypes.rst:1170 +#: library/stdtypes.rst:86 library/stdtypes.rst:276 library/stdtypes.rst:366 +#: library/stdtypes.rst:416 library/stdtypes.rst:965 library/stdtypes.rst:1170 +#, fuzzy msgid "Result" -msgstr "" +msgstr "نتیجه" -#: library/stdtypes.rst:86 -#: library/stdtypes.rst:276 -#: library/stdtypes.rst:416 -#: library/stdtypes.rst:965 -#: library/stdtypes.rst:1170 -#: library/stdtypes.rst:2432 -#: library/stdtypes.rst:3651 +#: library/stdtypes.rst:86 library/stdtypes.rst:276 library/stdtypes.rst:416 +#: library/stdtypes.rst:965 library/stdtypes.rst:1170 +#: library/stdtypes.rst:2432 library/stdtypes.rst:3651 +#, fuzzy msgid "Notes" -msgstr "" +msgstr "یادداشت ها" #: library/stdtypes.rst:88 +#, fuzzy msgid "``x or y``" -msgstr "" +msgstr "``x or y``" #: library/stdtypes.rst:88 +#, fuzzy msgid "if *x* is true, then *x*, else *y*" -msgstr "" +msgstr "اگر *x* درست باشد، *x*، در غیر این صورت *y*" -#: library/stdtypes.rst:88 -#: library/stdtypes.rst:967 -#: library/stdtypes.rst:970 -#: library/stdtypes.rst:1181 -#: library/stdtypes.rst:2438 +#: library/stdtypes.rst:88 library/stdtypes.rst:967 library/stdtypes.rst:970 +#: library/stdtypes.rst:1181 library/stdtypes.rst:2438 #: library/stdtypes.rst:3657 +#, fuzzy msgid "\\(1)" -msgstr "" +msgstr "\\ (1)" #: library/stdtypes.rst:91 +#, fuzzy msgid "``x and y``" -msgstr "" +msgstr "``x and y``" #: library/stdtypes.rst:91 +#, fuzzy msgid "if *x* is false, then *x*, else *y*" -msgstr "" +msgstr "اگر *x* نادرست است، *x*، در غیر این صورت *y*" -#: library/stdtypes.rst:91 -#: library/stdtypes.rst:289 -#: library/stdtypes.rst:309 -#: library/stdtypes.rst:1209 -#: library/stdtypes.rst:2442 -#: library/stdtypes.rst:2444 -#: library/stdtypes.rst:3661 +#: library/stdtypes.rst:91 library/stdtypes.rst:289 library/stdtypes.rst:309 +#: library/stdtypes.rst:1209 library/stdtypes.rst:2442 +#: library/stdtypes.rst:2444 library/stdtypes.rst:3661 #: library/stdtypes.rst:3663 +#, fuzzy msgid "\\(2)" -msgstr "" +msgstr "\\ (2)" #: library/stdtypes.rst:94 +#, fuzzy msgid "``not x``" -msgstr "" +msgstr "``not x``" #: library/stdtypes.rst:94 +#, fuzzy msgid "if *x* is false, then ``True``, else ``False``" -msgstr "" +msgstr "اگر *x* نادرست است، ``True``، در غیر این صورت ``False``" -#: library/stdtypes.rst:94 -#: library/stdtypes.rst:979 -#: library/stdtypes.rst:1212 -#: library/stdtypes.rst:2446 -#: library/stdtypes.rst:2448 -#: library/stdtypes.rst:2450 -#: library/stdtypes.rst:2452 -#: library/stdtypes.rst:3665 -#: library/stdtypes.rst:3667 -#: library/stdtypes.rst:3669 -#: library/stdtypes.rst:3671 +#: library/stdtypes.rst:94 library/stdtypes.rst:979 library/stdtypes.rst:1212 +#: library/stdtypes.rst:2446 library/stdtypes.rst:2448 +#: library/stdtypes.rst:2450 library/stdtypes.rst:2452 +#: library/stdtypes.rst:3665 library/stdtypes.rst:3667 +#: library/stdtypes.rst:3669 library/stdtypes.rst:3671 +#, fuzzy msgid "\\(3)" -msgstr "" +msgstr "\\ (3)" -#: library/stdtypes.rst:103 -#: library/stdtypes.rst:320 -#: library/stdtypes.rst:434 -#: library/stdtypes.rst:1016 -#: library/stdtypes.rst:1221 -#: library/stdtypes.rst:2478 -#: library/stdtypes.rst:3701 +#: library/stdtypes.rst:103 library/stdtypes.rst:320 library/stdtypes.rst:434 +#: library/stdtypes.rst:1016 library/stdtypes.rst:1221 +#: library/stdtypes.rst:2478 library/stdtypes.rst:3701 +#, fuzzy msgid "Notes:" -msgstr "" +msgstr "یادداشت ها:" #: library/stdtypes.rst:106 -msgid "This is a short-circuit operator, so it only evaluates the second argument if the first one is false." +#, fuzzy +msgid "" +"This is a short-circuit operator, so it only evaluates the second argument " +"if the first one is false." msgstr "" +"این یک اپراتور اتصال کوتاه است، بنابراین تنها اگر آرگومان اول نادرست باشد، " +"آرگومان دوم را ارزیابی می کند." #: library/stdtypes.rst:110 -msgid "This is a short-circuit operator, so it only evaluates the second argument if the first one is true." +#, fuzzy +msgid "" +"This is a short-circuit operator, so it only evaluates the second argument " +"if the first one is true." msgstr "" +"این یک عملگر اتصال کوتاه است، بنابراین تنها اگر آرگومان اول درست باشد، " +"آرگومان دوم را ارزیابی می کند." #: library/stdtypes.rst:114 -msgid "``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." +#, fuzzy +msgid "" +"``not`` has a lower priority than non-Boolean operators, so ``not a == b`` " +"is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." msgstr "" +"``not`` اولویت کمتری نسبت به عملگرهای غیر بولی دارد، بنابراین ``not a == b``" +" به عنوان ``not (a == b)`` تفسیر می شود و ``a == not b`` یک خطای نحوی است." #: library/stdtypes.rst:121 +#, fuzzy msgid "Comparisons" -msgstr "" +msgstr "مقایسه ها" #: library/stdtypes.rst:135 -msgid "There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained arbitrarily; for example, ``x < y <= z`` is equivalent to ``x < y and y <= z``, except that *y* is evaluated only once (but in both cases *z* is not evaluated at all when ``x < y`` is found to be false)." -msgstr "" +#, fuzzy +msgid "" +"There are eight comparison operations in Python. They all have the same " +"priority (which is higher than that of the Boolean operations). Comparisons" +" can be chained arbitrarily; for example, ``x < y <= z`` is equivalent to " +"``x < y and y <= z``, except that *y* is evaluated only once (but in both " +"cases *z* is not evaluated at all when ``x < y`` is found to be false)." +msgstr "" +"هشت عمل مقایسه در پایتون وجود دارد. همه آنها اولویت یکسانی دارند (که بالاتر" +" از اولویت عملیات بولی است). مقایسه ها را می توان به صورت خودسرانه زنجیره " +"ای کرد. به عنوان مثال، ``x < y <= z`` معادل ``x < y and y <= z`` است، با این" +" تفاوت که *y* فقط یک بار ارزیابی می شود (اما در هر دو مورد, زمانی که ``x < " +"y`` نادرست است, *z* اصلا ارزیابی نمی شود)." #: library/stdtypes.rst:141 +#, fuzzy msgid "This table summarizes the comparison operations:" -msgstr "" +msgstr "این جدول عملیات مقایسه را خلاصه می کند:" -#: library/stdtypes.rst:144 -#: library/stdtypes.rst:2409 -#: library/stdtypes.rst:2432 -#: library/stdtypes.rst:3628 +#: library/stdtypes.rst:144 library/stdtypes.rst:2409 +#: library/stdtypes.rst:2432 library/stdtypes.rst:3628 #: library/stdtypes.rst:3651 +#, fuzzy msgid "Meaning" -msgstr "" +msgstr "معنی" #: library/stdtypes.rst:146 +#, fuzzy msgid "``<``" -msgstr "" +msgstr "``<``" #: library/stdtypes.rst:146 +#, fuzzy msgid "strictly less than" -msgstr "" +msgstr "به شدت کمتر از" #: library/stdtypes.rst:148 +#, fuzzy msgid "``<=``" -msgstr "" +msgstr "``<=``" #: library/stdtypes.rst:148 +#, fuzzy msgid "less than or equal" -msgstr "" +msgstr "کمتر یا مساوی" #: library/stdtypes.rst:150 +#, fuzzy msgid "``>``" -msgstr "" +msgstr "``>``" #: library/stdtypes.rst:150 +#, fuzzy msgid "strictly greater than" -msgstr "" +msgstr "به شدت بیشتر از" #: library/stdtypes.rst:152 +#, fuzzy msgid "``>=``" -msgstr "" +msgstr "``>=``" #: library/stdtypes.rst:152 +#, fuzzy msgid "greater than or equal" -msgstr "" +msgstr "بزرگتر یا مساوی" #: library/stdtypes.rst:154 +#, fuzzy msgid "``==``" -msgstr "" +msgstr "``==``" #: library/stdtypes.rst:154 +#, fuzzy msgid "equal" -msgstr "" +msgstr "برابر" #: library/stdtypes.rst:156 +#, fuzzy msgid "``!=``" -msgstr "" +msgstr "``!=``" #: library/stdtypes.rst:156 +#, fuzzy msgid "not equal" -msgstr "" +msgstr "not equal" #: library/stdtypes.rst:158 +#, fuzzy msgid "``is``" -msgstr "" +msgstr "``is``" #: library/stdtypes.rst:158 +#, fuzzy msgid "object identity" -msgstr "" +msgstr "هویت شی" #: library/stdtypes.rst:160 +#, fuzzy msgid "``is not``" -msgstr "" +msgstr "``is not``" #: library/stdtypes.rst:160 +#, fuzzy msgid "negated object identity" -msgstr "" +msgstr "هویت شی نفی" #: library/stdtypes.rst:167 -msgid "Objects of different types, except different numeric types, never compare equal. The ``==`` operator is always defined but for some object types (for example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where they make sense; for example, they raise a :exc:`TypeError` exception when one of the arguments is a complex number." -msgstr "" +#, fuzzy +msgid "" +"Objects of different types, except different numeric types, never compare " +"equal. The ``==`` operator is always defined but for some object types (for " +"example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, " +"``>`` and ``>=`` operators are only defined where they make sense; for " +"example, they raise a :exc:`TypeError` exception when one of the arguments " +"is a complex number." +msgstr "" +"اشیاء از انواع مختلف، به جز انواع عددی مختلف، هرگز برابر نیستند. عملگر " +"``==`` همیشه تعریف شده است اما برای برخی از انواع شی (به عنوان مثال, اشیاء " +"کلاس) معادل :keyword:`is` است. اپراتورهای ``<``، ``<=``، ``>`` و ``>=`` فقط " +"در جایی تعریف می شوند که منطقی باشند. به عنوان مثال، زمانی که یکی از آرگومان" +" ها یک عدد مختلط باشد، یک استثنا :exc:`TypeError` را مطرح می کنند." #: library/stdtypes.rst:181 -msgid "Non-identical instances of a class normally compare as non-equal unless the class defines the :meth:`~object.__eq__` method." +#, fuzzy +msgid "" +"Non-identical instances of a class normally compare as non-equal unless the " +"class defines the :meth:`~object.__eq__` method." msgstr "" +"نمونه های غیر یکسان یک کلاس معمولاً به عنوان غیر برابر مقایسه می شوند مگر " +"اینکه کلاس متد :meth:`~object.__eq__` را تعریف کند." #: library/stdtypes.rst:184 -msgid "Instances of a class cannot be ordered with respect to other instances of the same class, or other types of object, unless the class defines enough of the methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` and :meth:`~object.__eq__` are sufficient, if you want the conventional meanings of the comparison operators)." -msgstr "" +#, fuzzy +msgid "" +"Instances of a class cannot be ordered with respect to other instances of " +"the same class, or other types of object, unless the class defines enough of" +" the methods :meth:`~object.__lt__`, :meth:`~object.__le__`, " +":meth:`~object.__gt__`, and :meth:`~object.__ge__` (in general, " +":meth:`~object.__lt__` and :meth:`~object.__eq__` are sufficient, if you " +"want the conventional meanings of the comparison operators)." +msgstr "" +"نمونه‌های یک کلاس را نمی‌توان با توجه به نمونه‌های دیگر همان کلاس یا سایر " +"انواع شی مرتب کرد، مگر اینکه کلاس به اندازه کافی متدهای " +":meth:`~object.__lt__`، :meth:`~object.__le__`، :meth:`~object.__gt__` و " +":meth:`~object.__ge__` را تعریف کند (به طور کلی, :meth:`~object.__lt__` و " +":meth:`~object.__eq__`, اگر معانی متعارف عملگرها را بخواهید, کافی هستند)." #: library/stdtypes.rst:191 -msgid "The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be customized; also they can be applied to any two objects and never raise an exception." +#, fuzzy +msgid "" +"The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be " +"customized; also they can be applied to any two objects and never raise an " +"exception." msgstr "" +"رفتار اپراتورهای :keyword:`is` و :keyword:`is not` قابل تنظیم نیست. همچنین " +"آنها را می توان برای هر دو شی اعمال کرد و هرگز استثناء ایجاد نمی کند." #: library/stdtypes.rst:199 -msgid "Two more operations with the same syntactic priority, :keyword:`in` and :keyword:`not in`, are supported by types that are :term:`iterable` or implement the :meth:`~object.__contains__` method." +#, fuzzy +msgid "" +"Two more operations with the same syntactic priority, :keyword:`in` and " +":keyword:`not in`, are supported by types that are :term:`iterable` or " +"implement the :meth:`~object.__contains__` method." msgstr "" +"دو عملیات دیگر با اولویت نحوی یکسان، :keyword:`in` و :keyword:`not in`، توسط" +" انواعی پشتیبانی می‌شوند که :term:`iterable` هستند یا روش " +":meth:`~object.__contains__` را پیاده‌سازی می‌کنند." #: library/stdtypes.rst:206 +#, fuzzy msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`" -msgstr "" +msgstr "انواع عددی --- :class:`int`، :class:`float`، :class:`complex`" #: library/stdtypes.rst:216 -msgid "There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of integers. Integers have unlimited precision. Floating-point numbers are usually implemented using :c:expr:`double` in C; information about the precision and internal representation of floating-point numbers for the machine on which your program is running is available in :data:`sys.float_info`. Complex numbers have a real and imaginary part, which are each a floating-point number. To extract these parts from a complex number *z*, use ``z.real`` and ``z.imag``. (The standard library includes the additional numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-definable precision.)" -msgstr "" +#, fuzzy +msgid "" +"There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-" +"point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a " +"subtype of integers. Integers have unlimited precision. Floating-point " +"numbers are usually implemented using :c:expr:`double` in C; information " +"about the precision and internal representation of floating-point numbers " +"for the machine on which your program is running is available in " +":data:`sys.float_info`. Complex numbers have a real and imaginary part, " +"which are each a floating-point number. To extract these parts from a " +"complex number *z*, use ``z.real`` and ``z.imag``. (The standard library " +"includes the additional numeric types :mod:`fractions.Fraction`, for " +"rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-" +"definable precision.)" +msgstr "" +"سه نوع عددی متمایز وجود دارد: :dfn: `اعداد صحیح`، :dfn: `اعداد ممیز شناور` و" +" :dfn:` اعداد مختلط. بعلاوه، Booleans زیرنوعی از اعداد صحیح هستند. اعداد " +"صحیح دقت نامحدودی دارند. اعداد ممیز شناور معمولاً با استفاده از " +":c:expr:`double` در C پیاده سازی می شوند. اطلاعات مربوط به دقت و نمایش داخلی" +" اعداد ممیز شناور برای ماشینی که برنامه شما روی آن اجرا می شود در " +":data:`sys.float_info` موجود است. اعداد مختلط یک قسمت واقعی و خیالی دارند " +"که هر کدام یک عدد ممیز شناور هستند. برای استخراج این قطعات از یک عدد مختلط " +"*z*، از ``z.real`` و ``z.imag`` استفاده کنید. (کتابخانه استاندارد شامل انواع" +" عددی اضافی :mod:`fractions.Fraction`, برای منطقی, و :mod:`decimal.Decimal`," +" برای اعداد ممیز شناور با دقت قابل تعریف توسط کاربر است.)" #: library/stdtypes.rst:238 -msgid "Numbers are created by numeric literals or as the result of built-in functions and operators. Unadorned integer literals (including hex, octal and binary numbers) yield integers. Numeric literals containing a decimal point or an exponent sign yield floating-point numbers. Appending ``'j'`` or ``'J'`` to a numeric literal yields an imaginary number (a complex number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts." -msgstr "" +#, fuzzy +msgid "" +"Numbers are created by numeric literals or as the result of built-in " +"functions and operators. Unadorned integer literals (including hex, octal " +"and binary numbers) yield integers. Numeric literals containing a decimal " +"point or an exponent sign yield floating-point numbers. Appending ``'j'`` " +"or ``'J'`` to a numeric literal yields an imaginary number (a complex number" +" with a zero real part) which you can add to an integer or float to get a " +"complex number with real and imaginary parts." +msgstr "" +"اعداد توسط حروف عددی یا در نتیجه توابع و عملگرهای داخلی ایجاد می شوند. " +"اعداد صحیح بدون تزئین (شامل اعداد هگز, هشت و دودویی) اعداد صحیح را به دست می" +" دهند. لفظ های عددی حاوی یک نقطه اعشار یا یک علامت توان اعداد ممیز شناور را" +" به دست می دهند. با اضافه کردن ``'j'`` یا ``'J'`` به یک عدد واقعی یک عدد " +"خیالی (یک عدد مختلط با قسمت واقعی صفر) به دست می‌آید که می‌توانید آن را به " +"یک عدد صحیح یا شناور اضافه کنید تا یک عدد مختلط با قسمت‌های واقعی و فرضی " +"بدست آورید." #: library/stdtypes.rst:263 -msgid "Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different numeric types, the operand with the \"narrower\" type is widened to that of the other, where integer is narrower than floating point, which is narrower than complex. A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [2]_" -msgstr "" +#, fuzzy +msgid "" +"Python fully supports mixed arithmetic: when a binary arithmetic operator " +"has operands of different numeric types, the operand with the \"narrower\" " +"type is widened to that of the other, where integer is narrower than " +"floating point, which is narrower than complex. A comparison between numbers" +" of different types behaves as though the exact values of those numbers were" +" being compared. [2]_" +msgstr "" +"پایتون به طور کامل از محاسبات مختلط پشتیبانی می‌کند: زمانی که یک عملگر حسابی" +" باینری دارای عملوندهایی از انواع مختلف عددی است، عملوند با نوع «باریک‌تر» " +"به دیگری گسترده می‌شود، جایی که عدد صحیح از ممیز شناور باریک‌تر است، که " +"باریک‌تر از مختلط است. مقایسه بین اعداد از انواع مختلف طوری رفتار می کند که " +"گویی مقادیر دقیق آن اعداد در حال مقایسه هستند. [2]_" #: library/stdtypes.rst:269 -msgid "The constructors :func:`int`, :func:`float`, and :func:`complex` can be used to produce numbers of a specific type." +#, fuzzy +msgid "" +"The constructors :func:`int`, :func:`float`, and :func:`complex` can be used" +" to produce numbers of a specific type." msgstr "" +"سازنده های :func:`int`، :func:`float` و :func:`complex` می توانند برای تولید" +" اعداد از یک نوع خاص استفاده شوند." #: library/stdtypes.rst:272 -msgid "All numeric types (except complex) support the following operations (for priorities of the operations, see :ref:`operator-summary`):" +#, fuzzy +msgid "" +"All numeric types (except complex) support the following operations (for " +"priorities of the operations, see :ref:`operator-summary`):" msgstr "" +"همه انواع عددی (به جز مختلط) از عملیات زیر پشتیبانی می کنند (برای اولویت های" +" عملیات, به :ref:`operator-summary` مراجعه کنید):" #: library/stdtypes.rst:276 +#, fuzzy msgid "Full documentation" -msgstr "" +msgstr "مستندات کامل" #: library/stdtypes.rst:278 +#, fuzzy msgid "``x + y``" -msgstr "" +msgstr "``x + y``" #: library/stdtypes.rst:278 +#, fuzzy msgid "sum of *x* and *y*" -msgstr "" +msgstr "مجموع *x* و *y*" #: library/stdtypes.rst:280 +#, fuzzy msgid "``x - y``" -msgstr "" +msgstr "``x - y``" #: library/stdtypes.rst:280 +#, fuzzy msgid "difference of *x* and *y*" -msgstr "" +msgstr "تفاوت *x* و *y*" #: library/stdtypes.rst:282 +#, fuzzy msgid "``x * y``" -msgstr "" +msgstr "``x * y``" #: library/stdtypes.rst:282 +#, fuzzy msgid "product of *x* and *y*" -msgstr "" +msgstr "محصول *x* و *y*" #: library/stdtypes.rst:284 +#, fuzzy msgid "``x / y``" -msgstr "" +msgstr "``x / y``" #: library/stdtypes.rst:284 +#, fuzzy msgid "quotient of *x* and *y*" -msgstr "" +msgstr "ضریب *x* و *y*" #: library/stdtypes.rst:286 +#, fuzzy msgid "``x // y``" -msgstr "" +msgstr "``x // y``" #: library/stdtypes.rst:286 +#, fuzzy msgid "floored quotient of *x* and *y*" -msgstr "" +msgstr "ضریب کفپوش *x* و *y*" #: library/stdtypes.rst:286 +#, fuzzy msgid "\\(1)\\(2)" -msgstr "" +msgstr "\\(1)\\(2)" #: library/stdtypes.rst:289 +#, fuzzy msgid "``x % y``" -msgstr "" +msgstr "``x % y``" #: library/stdtypes.rst:289 +#, fuzzy msgid "remainder of ``x / y``" -msgstr "" +msgstr "باقیمانده ``x / y``" #: library/stdtypes.rst:291 +#, fuzzy msgid "``-x``" -msgstr "" +msgstr "``-x``" #: library/stdtypes.rst:291 +#, fuzzy msgid "*x* negated" -msgstr "" +msgstr "*x* نفی شد" #: library/stdtypes.rst:293 +#, fuzzy msgid "``+x``" -msgstr "" +msgstr "``+x``" #: library/stdtypes.rst:293 +#, fuzzy msgid "*x* unchanged" -msgstr "" +msgstr "*x* بدون تغییر" #: library/stdtypes.rst:295 +#, fuzzy msgid "``abs(x)``" -msgstr "" +msgstr "``abs(x)``" #: library/stdtypes.rst:295 +#, fuzzy msgid "absolute value or magnitude of *x*" -msgstr "" +msgstr "مقدار مطلق یا بزرگی *x*" #: library/stdtypes.rst:295 +#, fuzzy msgid ":func:`abs`" -msgstr "" +msgstr ":func:`abs`" #: library/stdtypes.rst:298 +#, fuzzy msgid "``int(x)``" -msgstr "" +msgstr "``int(x)``" #: library/stdtypes.rst:298 +#, fuzzy msgid "*x* converted to integer" -msgstr "" +msgstr "*x* به عدد صحیح تبدیل شد" #: library/stdtypes.rst:298 +#, fuzzy msgid "\\(3)\\(6)" -msgstr "" +msgstr "\\(3)\\(6)" #: library/stdtypes.rst:298 +#, fuzzy msgid ":func:`int`" -msgstr "" +msgstr ":func:`int`" #: library/stdtypes.rst:300 +#, fuzzy msgid "``float(x)``" -msgstr "" +msgstr "``float(x)``" #: library/stdtypes.rst:300 +#, fuzzy msgid "*x* converted to floating point" -msgstr "" +msgstr "*x* به ممیز شناور تبدیل شد" #: library/stdtypes.rst:300 +#, fuzzy msgid "\\(4)\\(6)" -msgstr "" +msgstr "\\(4)\\(6)" #: library/stdtypes.rst:300 +#, fuzzy msgid ":func:`float`" -msgstr "" +msgstr ":func:`float`" #: library/stdtypes.rst:302 +#, fuzzy msgid "``complex(re, im)``" -msgstr "" +msgstr "``complex(re, im)``" #: library/stdtypes.rst:302 -msgid "a complex number with real part *re*, imaginary part *im*. *im* defaults to zero." +#, fuzzy +msgid "" +"a complex number with real part *re*, imaginary part *im*. *im* defaults to " +"zero." msgstr "" +"یک عدد مختلط با قسمت واقعی *re*، قسمت خیالی *im*. پیش فرض *im* صفر است." -#: library/stdtypes.rst:302 -#: library/stdtypes.rst:1202 -#: library/stdtypes.rst:2440 -#: library/stdtypes.rst:3688 +#: library/stdtypes.rst:302 library/stdtypes.rst:1202 +#: library/stdtypes.rst:2440 library/stdtypes.rst:3688 +#, fuzzy msgid "\\(6)" -msgstr "" +msgstr "\\ (6)" #: library/stdtypes.rst:302 +#, fuzzy msgid ":func:`complex`" -msgstr "" +msgstr ":func:`complex`" #: library/stdtypes.rst:306 +#, fuzzy msgid "``c.conjugate()``" -msgstr "" +msgstr "``c.conjugate()``" #: library/stdtypes.rst:306 +#, fuzzy msgid "conjugate of the complex number *c*" -msgstr "" +msgstr "مزدوج عدد مختلط *c*" #: library/stdtypes.rst:309 +#, fuzzy msgid "``divmod(x, y)``" -msgstr "" +msgstr "``divmod(x, y)``" #: library/stdtypes.rst:309 +#, fuzzy msgid "the pair ``(x // y, x % y)``" -msgstr "" +msgstr "جفت ``(x // y, x % y)``" #: library/stdtypes.rst:309 +#, fuzzy msgid ":func:`divmod`" -msgstr "" +msgstr ":func:`divmod`" #: library/stdtypes.rst:311 +#, fuzzy msgid "``pow(x, y)``" -msgstr "" +msgstr "``pow(x, y)``" -#: library/stdtypes.rst:311 -#: library/stdtypes.rst:313 +#: library/stdtypes.rst:311 library/stdtypes.rst:313 +#, fuzzy msgid "*x* to the power *y*" -msgstr "" +msgstr "*x* به قدرت *y*" -#: library/stdtypes.rst:311 -#: library/stdtypes.rst:313 -#: library/stdtypes.rst:1191 -#: library/stdtypes.rst:1194 -#: library/stdtypes.rst:2465 -#: library/stdtypes.rst:2468 -#: library/stdtypes.rst:2471 -#: library/stdtypes.rst:3684 -#: library/stdtypes.rst:3691 +#: library/stdtypes.rst:311 library/stdtypes.rst:313 library/stdtypes.rst:1191 +#: library/stdtypes.rst:1194 library/stdtypes.rst:2465 +#: library/stdtypes.rst:2468 library/stdtypes.rst:2471 +#: library/stdtypes.rst:3684 library/stdtypes.rst:3691 +#, fuzzy msgid "\\(5)" -msgstr "" +msgstr "\\ (5)" #: library/stdtypes.rst:311 +#, fuzzy msgid ":func:`pow`" -msgstr "" +msgstr ":func:`pow`" #: library/stdtypes.rst:313 +#, fuzzy msgid "``x ** y``" -msgstr "" +msgstr "``x ** y``" #: library/stdtypes.rst:323 -msgid "Also referred to as integer division. For operands of type :class:`int`, the result has type :class:`int`. For operands of type :class:`float`, the result has type :class:`float`. In general, the result is a whole integer, though the result's type is not necessarily :class:`int`. The result is always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is ``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``." -msgstr "" +#, fuzzy +msgid "" +"Also referred to as integer division. For operands of type :class:`int`, " +"the result has type :class:`int`. For operands of type :class:`float`, the " +"result has type :class:`float`. In general, the result is a whole integer, " +"though the result's type is not necessarily :class:`int`. The result is " +"always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is " +"``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``." +msgstr "" +"به آن تقسیم عدد صحیح نیز گفته می شود. برای عملوندهای نوع :class:`int`، " +"نتیجه دارای نوع :class:`int` است. برای عملوندهای نوع :class:`float`، نتیجه " +"دارای نوع :class:`float` است. به طور کلی، نتیجه یک عدد صحیح کامل است، اگرچه" +" نوع نتیجه لزوماً :class:`int` نیست. نتیجه همیشه به سمت منهای بی نهایت گرد " +"می شود: ``1//2`` ``0``، ``(-1)//2`` ``-1``، ``1//(-2)`` ``-1`` و " +"``(-1)//(-2)`` ``0`` است." #: library/stdtypes.rst:331 -msgid "Not for complex numbers. Instead convert to floats using :func:`abs` if appropriate." +#, fuzzy +msgid "" +"Not for complex numbers. Instead convert to floats using :func:`abs` if " +"appropriate." msgstr "" +"نه برای اعداد مختلط در عوض در صورت لزوم با استفاده از :func:`abs` به شناور " +"تبدیل کنید." #: library/stdtypes.rst:342 -msgid "Conversion from :class:`float` to :class:`int` truncates, discarding the fractional part. See functions :func:`math.floor` and :func:`math.ceil` for alternative conversions." +#, fuzzy +msgid "" +"Conversion from :class:`float` to :class:`int` truncates, discarding the " +"fractional part. See functions :func:`math.floor` and :func:`math.ceil` for " +"alternative conversions." msgstr "" +"تبدیل از :class:`float` به :class:`int` کوتاه می شود و قسمت کسری را دور می " +"اندازد. برای تبدیل‌های جایگزین به توابع :func:`math.floor` و " +":func:`math.ceil` مراجعه کنید." #: library/stdtypes.rst:347 -msgid "float also accepts the strings \"nan\" and \"inf\" with an optional prefix \"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." +#, fuzzy +msgid "" +"float also accepts the strings \"nan\" and \"inf\" with an optional prefix " +"\"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." msgstr "" +"float همچنین رشته‌های «nan» و «inf» را با پیشوند اختیاری «+» یا «-» برای No " +"Number (NaN) و بی‌نهایت مثبت یا منفی می‌پذیرد." #: library/stdtypes.rst:351 -msgid "Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for programming languages." +#, fuzzy +msgid "" +"Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for " +"programming languages." msgstr "" +"پایتون ``pow(0, 0)`` و ``0 ** 0`` را ``1`` تعریف می کند، همانطور که برای " +"زبان های برنامه نویسی رایج است." #: library/stdtypes.rst:355 -msgid "The numeric literals accepted include the digits ``0`` to ``9`` or any Unicode equivalent (code points with the ``Nd`` property)." +#, fuzzy +msgid "" +"The numeric literals accepted include the digits ``0`` to ``9`` or any " +"Unicode equivalent (code points with the ``Nd`` property)." msgstr "" +"حروف عددی پذیرفته شده شامل ارقام ``0`` تا ``9`` یا هر معادل یونیکد (نقاط کد " +"دارای ویژگی ``Nd``) است." #: library/stdtypes.rst:358 -msgid "See `the Unicode Standard `_ for a complete list of code points with the ``Nd`` property." +#, fuzzy +msgid "" +"See `the Unicode Standard " +"`_ for " +"a complete list of code points with the ``Nd`` property." msgstr "" +"برای لیست کامل نقاط کد با ویژگی ``Nd`` به `the Unicode Standard " +"`_ " +"مراجعه کنید." #: library/stdtypes.rst:362 -msgid "All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations:" +#, fuzzy +msgid "" +"All :class:`numbers.Real` types (:class:`int` and :class:`float`) also " +"include the following operations:" msgstr "" +"تمام انواع :class:`numbers.Real` (:class:`int` و :class:`float`) همچنین شامل" +" عملیات زیر می باشند:" #: library/stdtypes.rst:368 +#, fuzzy msgid ":func:`math.trunc(\\ x) `" -msgstr "" +msgstr ":func:`math.trunc(\\ x) `" #: library/stdtypes.rst:368 +#, fuzzy msgid "*x* truncated to :class:`~numbers.Integral`" -msgstr "" +msgstr "*x* به :class:`~numbers.Integral` کوتاه شد" #: library/stdtypes.rst:371 +#, fuzzy msgid ":func:`round(x[, n]) `" -msgstr "" +msgstr ":func:`round(x[, n]) `" #: library/stdtypes.rst:371 -msgid "*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it defaults to 0." +#, fuzzy +msgid "" +"*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it " +"defaults to 0." msgstr "" +"*x* به رقم *n* گرد شد و از نصف به زوج گرد شد. اگر *n* حذف شود، به طور پیش " +"فرض 0 است." #: library/stdtypes.rst:375 +#, fuzzy msgid ":func:`math.floor(\\ x) `" -msgstr "" +msgstr ":func:`math.floor(\\ x) `" #: library/stdtypes.rst:375 +#, fuzzy msgid "the greatest :class:`~numbers.Integral` <= *x*" -msgstr "" +msgstr "بزرگترین :class:`~numbers.Integral` <= *x*" #: library/stdtypes.rst:378 +#, fuzzy msgid ":func:`math.ceil(x) `" -msgstr "" +msgstr ":func:`math.ceil(x) `" #: library/stdtypes.rst:378 +#, fuzzy msgid "the least :class:`~numbers.Integral` >= *x*" -msgstr "" +msgstr "حداقل :class:`~numbers.Integral` >= *x*" #: library/stdtypes.rst:382 -msgid "For additional numeric operations see the :mod:`math` and :mod:`cmath` modules." +#, fuzzy +msgid "" +"For additional numeric operations see the :mod:`math` and :mod:`cmath` " +"modules." msgstr "" +"برای عملیات عددی بیشتر به ماژول های :mod:`math` و :mod:`cmath` مراجعه کنید." #: library/stdtypes.rst:391 +#, fuzzy msgid "Bitwise Operations on Integer Types" -msgstr "" +msgstr "عملیات بیتی در انواع عدد صحیح" #: library/stdtypes.rst:405 -msgid "Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an infinite number of sign bits." +#, fuzzy +msgid "" +"Bitwise operations only make sense for integers. The result of bitwise " +"operations is calculated as though carried out in two's complement with an " +"infinite number of sign bits." msgstr "" +"عملیات بیتی فقط برای اعداد صحیح معنا دارد. نتیجه عملیات بیتی به گونه ای " +"محاسبه می شود که گویی در مکمل دو با تعداد بی نهایت بیت علامت انجام می شود." #: library/stdtypes.rst:409 -msgid "The priorities of the binary bitwise operations are all lower than the numeric operations and higher than the comparisons; the unary operation ``~`` has the same priority as the other unary numeric operations (``+`` and ``-``)." +#, fuzzy +msgid "" +"The priorities of the binary bitwise operations are all lower than the " +"numeric operations and higher than the comparisons; the unary operation " +"``~`` has the same priority as the other unary numeric operations (``+`` and" +" ``-``)." msgstr "" +"اولویت‌های عملیات بیتی باینری همگی کمتر از عملیات عددی و بالاتر از مقایسه‌ها" +" هستند. عملیات یکنواخت ``~`` دارای اولویت مشابه سایر عملیات عددی یکنواخت " +"(``+`` و ``-``) است." #: library/stdtypes.rst:413 +#, fuzzy msgid "This table lists the bitwise operations sorted in ascending priority:" -msgstr "" +msgstr "این جدول عملیات بیتی مرتب شده در اولویت صعودی را فهرست می کند:" #: library/stdtypes.rst:418 +#, fuzzy msgid "``x | y``" -msgstr "" +msgstr "``x | y``" #: library/stdtypes.rst:418 +#, fuzzy msgid "bitwise :dfn:`or` of *x* and *y*" -msgstr "" +msgstr "به صورت بیتی :dfn:`or` از *x* و *y*" -#: library/stdtypes.rst:418 -#: library/stdtypes.rst:421 -#: library/stdtypes.rst:424 -#: library/stdtypes.rst:1216 -#: library/stdtypes.rst:2454 -#: library/stdtypes.rst:2458 -#: library/stdtypes.rst:3673 +#: library/stdtypes.rst:418 library/stdtypes.rst:421 library/stdtypes.rst:424 +#: library/stdtypes.rst:1216 library/stdtypes.rst:2454 +#: library/stdtypes.rst:2458 library/stdtypes.rst:3673 #: library/stdtypes.rst:3677 +#, fuzzy msgid "\\(4)" -msgstr "" +msgstr "\\ (4)" #: library/stdtypes.rst:421 +#, fuzzy msgid "``x ^ y``" -msgstr "" +msgstr "``x ^ y``" #: library/stdtypes.rst:421 +#, fuzzy msgid "bitwise :dfn:`exclusive or` of *x* and *y*" -msgstr "" +msgstr "بیتی :dfn:`انحصاری یا` از *x* و *y*" #: library/stdtypes.rst:424 +#, fuzzy msgid "``x & y``" -msgstr "" +msgstr "``x & y``" #: library/stdtypes.rst:424 +#, fuzzy msgid "bitwise :dfn:`and` of *x* and *y*" -msgstr "" +msgstr "به صورت بیتی :dfn:`and` از *x* و *y*" #: library/stdtypes.rst:427 +#, fuzzy msgid "``x << n``" -msgstr "" +msgstr "``x << n``" #: library/stdtypes.rst:427 +#, fuzzy msgid "*x* shifted left by *n* bits" -msgstr "" +msgstr "*x* توسط بیت *n* به چپ منتقل شد" #: library/stdtypes.rst:427 +#, fuzzy msgid "(1)(2)" -msgstr "" +msgstr "(1)(2)" #: library/stdtypes.rst:429 +#, fuzzy msgid "``x >> n``" -msgstr "" +msgstr "``x >> n``" #: library/stdtypes.rst:429 +#, fuzzy msgid "*x* shifted right by *n* bits" -msgstr "" +msgstr "*x* با بیت *n* به راست جابجا شد" #: library/stdtypes.rst:429 +#, fuzzy msgid "(1)(3)" -msgstr "" +msgstr "(1)(3)" #: library/stdtypes.rst:431 +#, fuzzy msgid "``~x``" -msgstr "" +msgstr "``~x``" #: library/stdtypes.rst:431 +#, fuzzy msgid "the bits of *x* inverted" -msgstr "" +msgstr "بیت های *x* معکوس شدند" #: library/stdtypes.rst:437 -msgid "Negative shift counts are illegal and cause a :exc:`ValueError` to be raised." +#, fuzzy +msgid "" +"Negative shift counts are illegal and cause a :exc:`ValueError` to be " +"raised." msgstr "" +"تعداد شیفت های منفی غیرقانونی است و باعث افزایش :exc:`ValueError` می شود." #: library/stdtypes.rst:440 -msgid "A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." -msgstr "" +#, fuzzy +msgid "" +"A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." +msgstr "یک شیفت به چپ توسط *n* بیت معادل ضرب در ``pow(2, n)`` است." #: library/stdtypes.rst:443 -msgid "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." -msgstr "" +#, fuzzy +msgid "" +"A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." +msgstr "یک شیفت به راست توسط *n* بیت معادل تقسیم طبقه توسط ``pow(2, n)`` است." #: library/stdtypes.rst:446 -msgid "Performing these calculations with at least one extra sign extension bit in a finite two's complement representation (a working bit-width of ``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same result as if there were an infinite number of sign bits." +#, fuzzy +msgid "" +"Performing these calculations with at least one extra sign extension bit in " +"a finite two's complement representation (a working bit-width of ``1 + " +"max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same" +" result as if there were an infinite number of sign bits." msgstr "" +"انجام این محاسبات با حداقل یک بیت اضافه علامت اضافی در یک نمایش مکمل دو " +"محدود (عرض بیت کاری ``1 + max(x.bit_length(), y.bit_length())`` یا بیشتر) " +"برای بدست آوردن همان نتیجه کافی است که گویی تعداد بی نهایت بیت علامت وجود " +"دارد." #: library/stdtypes.rst:453 +#, fuzzy msgid "Additional Methods on Integer Types" -msgstr "" +msgstr "روش های اضافی در انواع عدد صحیح" #: library/stdtypes.rst:455 -msgid "The int type implements the :class:`numbers.Integral` :term:`abstract base class`. In addition, it provides a few more methods:" +#, fuzzy +msgid "" +"The int type implements the :class:`numbers.Integral` :term:`abstract base " +"class`. In addition, it provides a few more methods:" msgstr "" +"نوع int :class:`numbers.Integral` :term:`abstract base class` را پیاده سازی " +"می کند. علاوه بر این، چند روش دیگر را ارائه می دهد:" #: library/stdtypes.rst:460 -msgid "Return the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros::" +#, fuzzy +msgid "" +"Return the number of bits necessary to represent an integer in binary, " +"excluding the sign and leading zeros::" msgstr "" +"تعداد بیت های لازم برای نمایش یک عدد صحیح به صورت باینری را به استثنای علامت" +" و صفرهای ابتدایی برگردانید::" #: library/stdtypes.rst:463 -msgid ">>> n = -37\n" +#, fuzzy +msgid "" +">>> n = -37\n" ">>> bin(n)\n" "'-0b100101'\n" ">>> n.bit_length()\n" "6" msgstr "" +">>> n = -37\n" +">>> bin(n)\n" +"'-0b100101'\n" +">>> n.bit_length()\n" +"6" #: library/stdtypes.rst:469 -msgid "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. Equivalently, when ``abs(x)`` is small enough to have a correctly rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then ``x.bit_length()`` returns ``0``." -msgstr "" - -#: library/stdtypes.rst:475 -#: library/stdtypes.rst:498 -#: library/stdtypes.rst:543 +#, fuzzy +msgid "" +"More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique " +"positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. " +"Equivalently, when ``abs(x)`` is small enough to have a correctly rounded " +"logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then " +"``x.bit_length()`` returns ``0``." +msgstr "" +"به طور دقیق تر، اگر ``x`` غیر صفر باشد، ``x.bit_length()`` عدد صحیح مثبت " +"منحصر به فرد ``k`` است به طوری که ``2**(k-1) <= abs(x) < 2**k``. به طور " +"معادل، زمانی که ``abs(x)`` به اندازه کافی کوچک است که لگاریتمی به درستی گرد " +"داشته باشد، ``k = 1 + int(log(abs(x), 2))``. اگر ``x`` صفر باشد، " +"``x.bit_length()`` ``0`` را برمی گرداند." + +#: library/stdtypes.rst:475 library/stdtypes.rst:498 library/stdtypes.rst:543 #: library/stdtypes.rst:587 +#, fuzzy msgid "Equivalent to::" -msgstr "" +msgstr "معادل::" #: library/stdtypes.rst:477 -msgid "def bit_length(self):\n" +#, fuzzy +msgid "" +"def bit_length(self):\n" " s = bin(self) # binary representation: bin(-37) --> '-0b100101'\n" " s = s.lstrip('-0b') # remove leading zeros and minus sign\n" " return len(s) # len('100101') --> 6" msgstr "" +"def bit_length(self):\n" +" s = bin(self) # binary representation: bin(-37) --> '-0b100101'\n" +" s = s.lstrip('-0b') # remove leading zeros and minus sign\n" +" return len(s) # len('100101') --> 6" #: library/stdtypes.rst:486 -msgid "Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example::" +#, fuzzy +msgid "" +"Return the number of ones in the binary representation of the absolute value" +" of the integer. This is also known as the population count. Example::" msgstr "" +"تعداد یک ها را در نمایش دودویی قدر مطلق عدد صحیح برگردانید. این به عنوان " +"شمارش جمعیت نیز شناخته می شود. مثال::" #: library/stdtypes.rst:490 -msgid ">>> n = 19\n" +#, fuzzy +msgid "" +">>> n = 19\n" ">>> bin(n)\n" "'0b10011'\n" ">>> n.bit_count()\n" @@ -711,43 +1098,96 @@ msgid ">>> n = 19\n" ">>> (-n).bit_count()\n" "3" msgstr "" +">>> n = 19\n" +">>> bin(n)\n" +"'0b10011'\n" +">>> n.bit_count()\n" +"3\n" +">>> (-n).bit_count()\n" +"3" #: library/stdtypes.rst:500 -msgid "def bit_count(self):\n" +#, fuzzy +msgid "" +"def bit_count(self):\n" " return bin(self).count(\"1\")" msgstr "" +"def bit_count(self):\n" +" return bin(self).count(\"1\")" #: library/stdtypes.rst:507 +#, fuzzy msgid "Return an array of bytes representing an integer." -msgstr "" +msgstr "آرایه ای از بایت ها را که یک عدد صحیح را نشان می دهد برگردانید." #: library/stdtypes.rst:519 -msgid "The integer is represented using *length* bytes, and defaults to 1. An :exc:`OverflowError` is raised if the integer is not representable with the given number of bytes." +#, fuzzy +msgid "" +"The integer is represented using *length* bytes, and defaults to 1. An " +":exc:`OverflowError` is raised if the integer is not representable with the " +"given number of bytes." msgstr "" +"عدد صحیح با استفاده از *length* بایت نمایش داده می شود و به طور پیش فرض 1 " +"است. اگر عدد صحیح با تعداد بایت های داده شده قابل نمایش نباشد، " +":exc:`OverflowError` افزایش می یابد." #: library/stdtypes.rst:523 -msgid "The *byteorder* argument determines the byte order used to represent the integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the most significant byte is at the beginning of the byte array. If *byteorder* is ``\"little\"``, the most significant byte is at the end of the byte array." +#, fuzzy +msgid "" +"The *byteorder* argument determines the byte order used to represent the " +"integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " +"most significant byte is at the beginning of the byte array. If *byteorder*" +" is ``\"little\"``, the most significant byte is at the end of the byte " +"array." msgstr "" +"آرگومان *byteorder* ترتیب بایت های مورد استفاده برای نمایش عدد صحیح را تعیین" +" می کند و به طور پیش فرض برای ``\"big\"`` قرار می گیرد. اگر *byteorder* " +"``\"big\"`` باشد، مهم ترین بایت در ابتدای آرایه بایت است. اگر *byteorder* " +"``\"little\"`` باشد، مهم ترین بایت در انتهای آرایه بایت است." #: library/stdtypes.rst:529 -msgid "The *signed* argument determines whether two's complement is used to represent the integer. If *signed* is ``False`` and a negative integer is given, an :exc:`OverflowError` is raised. The default value for *signed* is ``False``." +#, fuzzy +msgid "" +"The *signed* argument determines whether two's complement is used to " +"represent the integer. If *signed* is ``False`` and a negative integer is " +"given, an :exc:`OverflowError` is raised. The default value for *signed* is " +"``False``." msgstr "" +"آرگومان *signed* تعیین می کند که آیا مکمل دو برای نمایش عدد صحیح استفاده می " +"شود یا خیر. اگر *signed* ``False`` باشد و یک عدد صحیح منفی داده شود، یک " +":exc:`OverflowError` بلند می شود. مقدار پیش فرض *signed* ``False`` است." #: library/stdtypes.rst:534 -msgid "The default values can be used to conveniently turn an integer into a single byte object::" +#, fuzzy +msgid "" +"The default values can be used to conveniently turn an integer into a single" +" byte object::" msgstr "" +"مقادیر پیش‌فرض را می‌توان برای تبدیل راحت یک عدد صحیح به یک شی بایت تک " +"استفاده کرد:" #: library/stdtypes.rst:537 -msgid ">>> (65).to_bytes()\n" +#, fuzzy +msgid "" +">>> (65).to_bytes()\n" "b'A'" msgstr "" +">>> (65).to_bytes()\n" +"b'A'" #: library/stdtypes.rst:540 -msgid "However, when using the default arguments, don't try to convert a value greater than 255 or you'll get an :exc:`OverflowError`." +#, fuzzy +msgid "" +"However, when using the default arguments, don't try to convert a value " +"greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" +"با این حال، هنگام استفاده از آرگومان های پیش فرض، سعی نکنید مقداری بزرگتر از" +" 255 را تبدیل کنید وگرنه یک :exc:`OverflowError` دریافت خواهید کرد." #: library/stdtypes.rst:545 -msgid "def to_bytes(n, length=1, byteorder='big', signed=False):\n" +#, fuzzy +msgid "" +"def to_bytes(n, length=1, byteorder='big', signed=False):\n" " if byteorder == 'little':\n" " order = range(length)\n" " elif byteorder == 'big':\n" @@ -757,29 +1197,65 @@ msgid "def to_bytes(n, length=1, byteorder='big', signed=False):\n" "\n" " return bytes((n >> i*8) & 0xff for i in order)" msgstr "" +"def to_bytes(n, length=1, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" order = range(length)\n" +" elif byteorder == 'big':\n" +" order = reversed(range(length))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" return bytes((n >> i*8) & 0xff for i in order)" #: library/stdtypes.rst:556 +#, fuzzy msgid "Added default argument values for ``length`` and ``byteorder``." -msgstr "" +msgstr "مقادیر آرگومان پیش فرض برای ``length`` و ``byteorder`` اضافه شد." #: library/stdtypes.rst:561 +#, fuzzy msgid "Return the integer represented by the given array of bytes." -msgstr "" +msgstr "عدد صحیح نشان داده شده توسط آرایه بایت داده شده را برگردانید." #: library/stdtypes.rst:574 -msgid "The argument *bytes* must either be a :term:`bytes-like object` or an iterable producing bytes." +#, fuzzy +msgid "" +"The argument *bytes* must either be a :term:`bytes-like object` or an " +"iterable producing bytes." msgstr "" +"آرگومان *bytes* یا باید یک :term:`bytes-like object` باشد یا یک بایت تولید " +"کننده تکرارپذیر." #: library/stdtypes.rst:577 -msgid "The *byteorder* argument determines the byte order used to represent the integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the most significant byte is at the beginning of the byte array. If *byteorder* is ``\"little\"``, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use :data:`sys.byteorder` as the byte order value." -msgstr "" +#, fuzzy +msgid "" +"The *byteorder* argument determines the byte order used to represent the " +"integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " +"most significant byte is at the beginning of the byte array. If *byteorder*" +" is ``\"little\"``, the most significant byte is at the end of the byte " +"array. To request the native byte order of the host system, use " +":data:`sys.byteorder` as the byte order value." +msgstr "" +"آرگومان *byteorder* ترتیب بایت های مورد استفاده برای نمایش عدد صحیح را تعیین" +" می کند و به طور پیش فرض برای ``\"big\"`` قرار می گیرد. اگر *byteorder* " +"``\"big\"`` باشد، مهم ترین بایت در ابتدای آرایه بایت است. اگر *byteorder* " +"``\"little\"`` باشد، مهم ترین بایت در انتهای آرایه بایت است. برای درخواست " +"ترتیب بایت بومی سیستم میزبان، از :data:`sys.byteorder` به عنوان مقدار سفارش " +"بایت استفاده کنید." #: library/stdtypes.rst:584 -msgid "The *signed* argument indicates whether two's complement is used to represent the integer." +#, fuzzy +msgid "" +"The *signed* argument indicates whether two's complement is used to " +"represent the integer." msgstr "" +"آرگومان *signed* نشان می دهد که آیا از مکمل two برای نمایش عدد صحیح استفاده " +"می شود یا خیر." #: library/stdtypes.rst:589 -msgid "def from_bytes(bytes, byteorder='big', signed=False):\n" +#, fuzzy +msgid "" +"def from_bytes(bytes, byteorder='big', signed=False):\n" " if byteorder == 'little':\n" " little_ordered = list(bytes)\n" " elif byteorder == 'big':\n" @@ -793,130 +1269,323 @@ msgid "def from_bytes(bytes, byteorder='big', signed=False):\n" "\n" " return n" msgstr "" +"def from_bytes(bytes, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" little_ordered = list(bytes)\n" +" elif byteorder == 'big':\n" +" little_ordered = list(reversed(bytes))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" n = sum(b << i*8 for i, b in enumerate(little_ordered))\n" +" if signed and little_ordered and (little_ordered[-1] & 0x80):\n" +" n -= 1 << 8*len(little_ordered)\n" +"\n" +" return n" #: library/stdtypes.rst:604 +#, fuzzy msgid "Added default argument value for ``byteorder``." -msgstr "" +msgstr "مقدار آرگومان پیش فرض برای ``byteorder`` اضافه شد." #: library/stdtypes.rst:609 -msgid "Return a pair of integers whose ratio is equal to the original integer and has a positive denominator. The integer ratio of integers (whole numbers) is always the integer as the numerator and ``1`` as the denominator." +#, fuzzy +msgid "" +"Return a pair of integers whose ratio is equal to the original integer and " +"has a positive denominator. The integer ratio of integers (whole numbers) " +"is always the integer as the numerator and ``1`` as the denominator." msgstr "" +"یک جفت اعداد صحیح که نسبت آنها برابر با عدد صحیح اصلی و دارای مخرج مثبت است " +"را برگردانید. نسبت صحیح اعداد صحیح (اعداد کامل) همیشه عدد صحیح به عنوان " +"صورت و ``1`` به عنوان مخرج است." #: library/stdtypes.rst:618 -msgid "Returns ``True``. Exists for duck type compatibility with :meth:`float.is_integer`." +#, fuzzy +msgid "" +"Returns ``True``. Exists for duck type compatibility with " +":meth:`float.is_integer`." msgstr "" +"``True`` را برمی گرداند. برای سازگاری نوع اردک با :meth:`float.is_integer` " +"وجود دارد." #: library/stdtypes.rst:623 +#, fuzzy msgid "Additional Methods on Float" -msgstr "" +msgstr "روش های اضافی در شناور" #: library/stdtypes.rst:625 -msgid "The float type implements the :class:`numbers.Real` :term:`abstract base class`. float also has the following additional methods." +#, fuzzy +msgid "" +"The float type implements the :class:`numbers.Real` :term:`abstract base " +"class`. float also has the following additional methods." msgstr "" +"نوع float :class:`numbers.Real` :term:`abstract base class` را پیاده سازی می" +" کند. float روش های اضافی زیر را نیز دارد." #: library/stdtypes.rst:630 -msgid "Return a pair of integers whose ratio is exactly equal to the original float. The ratio is in lowest terms and has a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." +#, fuzzy +msgid "" +"Return a pair of integers whose ratio is exactly equal to the original " +"float. The ratio is in lowest terms and has a positive denominator. Raises " +":exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." msgstr "" +"یک جفت اعداد صحیح که نسبت آنها دقیقاً برابر با شناور اصلی است را برگردانید. " +"این نسبت در کمترین مقدار و دارای مخرج مثبت است. :exc:`OverflowError` را روی" +" بی نهایت ها و :exc:`ValueError` را روی NaN ها افزایش می دهد." #: library/stdtypes.rst:637 -msgid "Return ``True`` if the float instance is finite with integral value, and ``False`` otherwise::" +#, fuzzy +msgid "" +"Return ``True`` if the float instance is finite with integral value, and " +"``False`` otherwise::" msgstr "" +"اگر نمونه شناور با مقدار انتگرال محدود است، ``True`` را برگردانید و در غیر " +"این صورت ``False``::" #: library/stdtypes.rst:640 -msgid ">>> (-2.0).is_integer()\n" +#, fuzzy +msgid "" +">>> (-2.0).is_integer()\n" "True\n" ">>> (3.2).is_integer()\n" "False" msgstr "" +">>> (-2.0).is_integer()\n" +"True\n" +">>> (3.2).is_integer()\n" +"False" #: library/stdtypes.rst:645 -msgid "Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a *decimal* string usually involves a small rounding error. In contrast, hexadecimal strings allow exact representation and specification of floating-point numbers. This can be useful when debugging, and in numerical work." -msgstr "" +#, fuzzy +msgid "" +"Two methods support conversion to and from hexadecimal strings. Since " +"Python's floats are stored internally as binary numbers, converting a float " +"to or from a *decimal* string usually involves a small rounding error. In " +"contrast, hexadecimal strings allow exact representation and specification " +"of floating-point numbers. This can be useful when debugging, and in " +"numerical work." +msgstr "" +"دو روش از تبدیل به رشته های هگزادسیمال و از آن پشتیبانی می کنند. از آنجایی " +"که شناورهای پایتون در داخل به عنوان اعداد باینری ذخیره می شوند، تبدیل یک " +"شناور به یا از یک رشته *decimal* معمولاً شامل یک خطای گرد کردن کوچک است. در" +" مقابل، رشته‌های هگزا دسیمال امکان نمایش و تعیین دقیق اعداد ممیز شناور را " +"فراهم می‌کنند. این می تواند هنگام اشکال زدایی و در کار عددی مفید باشد." #: library/stdtypes.rst:656 -msgid "Return a representation of a floating-point number as a hexadecimal string. For finite floating-point numbers, this representation will always include a leading ``0x`` and a trailing ``p`` and exponent." +#, fuzzy +msgid "" +"Return a representation of a floating-point number as a hexadecimal string." +" For finite floating-point numbers, this representation will always include" +" a leading ``0x`` and a trailing ``p`` and exponent." msgstr "" +"نمایشی از یک عدد ممیز شناور را به عنوان یک رشته هگزادسیمال برگردانید. برای " +"اعداد ممیز شناور متناهی، این نمایش همیشه شامل یک ``0x`` پیشرو و یک ``p`` و " +"یک توان بعد است." #: library/stdtypes.rst:664 -msgid "Class method to return the float represented by a hexadecimal string *s*. The string *s* may have leading and trailing whitespace." +#, fuzzy +msgid "" +"Class method to return the float represented by a hexadecimal string *s*. " +"The string *s* may have leading and trailing whitespace." msgstr "" +"روش کلاس برای برگرداندن شناور نشان داده شده توسط یک رشته هگزادسیمال *s*. " +"رشته *s* ممکن است دارای فضای خالی پیشرو و انتهایی باشد." #: library/stdtypes.rst:669 -msgid "Note that :meth:`float.hex` is an instance method, while :meth:`float.fromhex` is a class method." +#, fuzzy +msgid "" +"Note that :meth:`float.hex` is an instance method, while " +":meth:`float.fromhex` is a class method." msgstr "" +"توجه داشته باشید که :meth:`float.hex` یک متد نمونه است، در حالی که " +":meth:`float.fromhex` یک متد کلاس است." #: library/stdtypes.rst:672 +#, fuzzy msgid "A hexadecimal string takes the form::" -msgstr "" +msgstr "یک رشته هگزادسیمال به شکل زیر است:" #: library/stdtypes.rst:674 +#, fuzzy msgid "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" -msgstr "" +msgstr "[sign] ['0x'] عدد صحیح ['.' کسری] [نمایش 'p']" #: library/stdtypes.rst:676 -msgid "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and ``fraction`` are strings of hexadecimal digits, and ``exponent`` is a decimal integer with an optional leading sign. Case is not significant, and there must be at least one hexadecimal digit in either the integer or the fraction. This syntax is similar to the syntax specified in section 6.4.4.2 of the C99 standard, and also to the syntax used in Java 1.5 onwards. In particular, the output of :meth:`float.hex` is usable as a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted by :meth:`float.fromhex`." -msgstr "" +#, fuzzy +msgid "" +"where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " +"``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " +"decimal integer with an optional leading sign. Case is not significant, and" +" there must be at least one hexadecimal digit in either the integer or the " +"fraction. This syntax is similar to the syntax specified in section 6.4.4.2" +" of the C99 standard, and also to the syntax used in Java 1.5 onwards. In " +"particular, the output of :meth:`float.hex` is usable as a hexadecimal " +"floating-point literal in C or Java code, and hexadecimal strings produced " +"by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted" +" by :meth:`float.fromhex`." +msgstr "" +"در جایی که ``sign`` اختیاری ممکن است با ``+`` یا ``-`` باشد، ``integer`` و " +"``fraction`` رشته هایی از ارقام هگزا دسیمال هستند و ``exponent`` یک عدد صحیح" +" اعشاری با علامت ابتدایی اختیاری است. حروف کوچک و بزرگ مهم نیست و باید " +"حداقل یک رقم هگزادسیمال در عدد صحیح یا کسری وجود داشته باشد. این نحو شبیه " +"به نحو مشخص شده در بخش 6.4.4.2 استاندارد C99 و همچنین سینتکس مورد استفاده در" +" جاوا 1.5 به بعد است. به طور خاص، خروجی :meth:`float.hex` به عنوان یک ممیز " +"شناور هگزا دسیمال در کد C یا جاوا قابل استفاده است و رشته های هگزادسیمال " +"تولید شده توسط کاراکتر فرمت ``%a`` C یا ``Double.toHexString`` جاوا توسط " +":meth:`float.fromhex` پذیرفته می شود." #: library/stdtypes.rst:689 -msgid "Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the coefficient. For example, the hexadecimal string ``0x3.a7p10`` represents the floating-point number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" +#, fuzzy +msgid "" +"Note that the exponent is written in decimal rather than hexadecimal, and " +"that it gives the power of 2 by which to multiply the coefficient. For " +"example, the hexadecimal string ``0x3.a7p10`` represents the floating-point " +"number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" +"توجه داشته باشید که توان به جای هگزادسیمال به صورت اعشاری نوشته می شود و " +"توان 2 را می دهد تا ضریب را در آن ضرب کنیم. به عنوان مثال، رشته هگزادسیمال " +"``0x3.a7p10`` عدد ممیز شناور ``(3 + 10./16 + 7./16**2) * 2.0**10`` یا " +"``3740.0``::" #: library/stdtypes.rst:695 -msgid ">>> float.fromhex('0x3.a7p10')\n" +#, fuzzy +msgid "" +">>> float.fromhex('0x3.a7p10')\n" "3740.0" msgstr "" +">>> float.fromhex('0x3.a7p10')\n" +"3740.0" #: library/stdtypes.rst:699 -msgid "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal string representing the same number::" +#, fuzzy +msgid "" +"Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " +"string representing the same number::" msgstr "" +"اعمال تبدیل معکوس به ``3740.0`` یک رشته هگزادسیمال متفاوت به دست می دهد که " +"نشان دهنده همان عدد است:" #: library/stdtypes.rst:702 -msgid ">>> float.hex(3740.0)\n" +#, fuzzy +msgid "" +">>> float.hex(3740.0)\n" "'0x1.d380000000000p+11'" msgstr "" +">>> float.hex(3740.0)\n" +"'0x1.d380000000000p+11'" #: library/stdtypes.rst:709 +#, fuzzy msgid "Hashing of numeric types" -msgstr "" +msgstr "هش کردن انواع عددی" #: library/stdtypes.rst:711 -msgid "For numbers ``x`` and ``y``, possibly of different types, it's a requirement that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object.__hash__` method documentation for more details). For ease of implementation and efficiency across a variety of numeric types (including :class:`int`, :class:`float`, :class:`decimal.Decimal` and :class:`fractions.Fraction`) Python's hash for numeric types is based on a single mathematical function that's defined for any rational number, and hence applies to all instances of :class:`int` and :class:`fractions.Fraction`, and all finite instances of :class:`float` and :class:`decimal.Decimal`. Essentially, this function is given by reduction modulo ``P`` for a fixed prime ``P``. The value of ``P`` is made available to Python as the :attr:`~sys.hash_info.modulus` attribute of :data:`sys.hash_info`." -msgstr "" +#, fuzzy +msgid "" +"For numbers ``x`` and ``y``, possibly of different types, it's a requirement" +" that ``hash(x) == hash(y)`` whenever ``x == y`` (see the " +":meth:`~object.__hash__` method documentation for more details). For ease " +"of implementation and efficiency across a variety of numeric types " +"(including :class:`int`, :class:`float`, :class:`decimal.Decimal` and " +":class:`fractions.Fraction`) Python's hash for numeric types is based on a " +"single mathematical function that's defined for any rational number, and " +"hence applies to all instances of :class:`int` and " +":class:`fractions.Fraction`, and all finite instances of :class:`float` and " +":class:`decimal.Decimal`. Essentially, this function is given by reduction " +"modulo ``P`` for a fixed prime ``P``. The value of ``P`` is made available " +"to Python as the :attr:`~sys.hash_info.modulus` attribute of " +":data:`sys.hash_info`." +msgstr "" +"برای اعداد ``x`` و ``y``، که ممکن است از انواع مختلف باشند، این الزام است که هرگاه ``x == y`` باشد، در نتیجه داشته باشیم ``hash(x) == hash(y)`` (برای جزئیات بیشتر به مستندات روش :meth:`~object.__hash__` مراجعه کنید). برای سهولت پیاده‌سازی و کارایی در میان انواع عددی متفاوت (از جمله :class:`int`, :class:`float`, :class:`decimal.Decimal` و :class:`fractions.Fraction`) هش پایتون برای انواع عددی بر اساس یک تابع ریاضی یکتا تعریف شده است که برای هر عدد گویا معتبر است و بر همین اساس در تمامی نمونه‌های :class:`int` و :class:`fractions.Fraction`, و همچنین در تمامی نمونه‌های متناهی :class:`float` و :class:`decimal.Decimal` اعمال می‌شود. اساساً، این تابع به صورت کاهش باقی‌مانده نسبت به ``P``، که یک عدد اول ثابت است، تعریف شده است. مقدار ``P`` به عنوان ویژگی :attr:`~sys.hash_info.modulus` در :data:`sys.hash_info` در دسترس پایتون قرار گرفته است." #: library/stdtypes.rst:726 -msgid "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." +#, fuzzy +msgid "" +"Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " +"longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." msgstr "" +"در حال حاضر، پرایم مورد استفاده ``P = 2**31 - 1`` در ماشین‌های با طول C 32 " +"بیت و ``P = 2**61 - 1`` در ماشین‌هایی با طول C 64 بیت است." #: library/stdtypes.rst:729 +#, fuzzy msgid "Here are the rules in detail:" -msgstr "" +msgstr "در اینجا قوانین به تفصیل آمده است:" #: library/stdtypes.rst:731 -msgid "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, P)`` gives the inverse of ``n`` modulo ``P``." +#, fuzzy +msgid "" +"If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible" +" by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n," +" P)`` gives the inverse of ``n`` modulo ``P``." msgstr "" +"اگر ``x = m / n`` یک عدد گویا غیرمنفی است و ``n`` بر ``P`` بخش پذیر نیست، " +"``hash(x)`` را به عنوان ``m * invmod(n, P) % P`` تعریف کنید، جایی که " +"``invmod(n, P)`` معکوس مدول ``n`` ``P`` را می دهد." #: library/stdtypes.rst:735 -msgid "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by ``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule above doesn't apply; in this case define ``hash(x)`` to be the constant value ``sys.hash_info.inf``." +#, fuzzy +msgid "" +"If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " +"``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule" +" above doesn't apply; in this case define ``hash(x)`` to be the constant " +"value ``sys.hash_info.inf``." msgstr "" +"اگر ``x = m / n`` یک عدد گویا غیرمنفی است و ``n`` بر ``P`` بخش پذیر است (اما" +" ``m`` نیست) پس ``n`` مدول معکوس ``P`` ندارد و قانون بالا اعمال نمی شود. در " +"این مورد ``hash(x)`` را به عنوان مقدار ثابت ``sys.hash_info.inf`` تعریف " +"کنید." #: library/stdtypes.rst:740 -msgid "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." +#, fuzzy +msgid "" +"If ``x = m / n`` is a negative rational number define ``hash(x)`` as " +"``-hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" +"اگر ``x = m / n`` یک عدد گویا منفی است، ``hash(x)`` را به عنوان " +"``-hash(-x)`` تعریف کنید. اگر هش حاصل ``-1`` است، آن را با ``-2`` جایگزین " +"کنید." #: library/stdtypes.rst:744 -msgid "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are used as hash values for positive infinity or negative infinity (respectively)." +#, fuzzy +msgid "" +"The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " +"used as hash values for positive infinity or negative infinity " +"(respectively)." msgstr "" +"مقادیر خاص ``sys.hash_info.inf`` و ``-sys.hash_info.inf`` به عنوان مقادیر هش" +" برای بی‌نهایت مثبت یا بی‌نهایت منفی (به ترتیب) استفاده می‌شوند." #: library/stdtypes.rst:748 -msgid "For a :class:`complex` number ``z``, the hash values of the real and imaginary parts are combined by computing ``hash(z.real) + sys.hash_info.imag * hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. Again, if the result is ``-1``, it's replaced with ``-2``." -msgstr "" +#, fuzzy +msgid "" +"For a :class:`complex` number ``z``, the hash values of the real and " +"imaginary parts are combined by computing ``hash(z.real) + " +"sys.hash_info.imag * hash(z.imag)``, reduced modulo " +"``2**sys.hash_info.width`` so that it lies in " +"``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. " +"Again, if the result is ``-1``, it's replaced with ``-2``." +msgstr "" +"برای یک عدد :class:`complex` ``z``، مقادیر هش بخش واقعی و خیالی با محاسبه " +"``hash(z.real) + sys.hash_info.imag * hash(z.imag)``، مدول کاهش‌یافته " +"``2**sys.hash_info.width`` ترکیب می‌شوند تا در " +"``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))`` قرار " +"گیرد. دوباره، اگر نتیجه ``-1`` باشد، با ``-2`` جایگزین می شود." #: library/stdtypes.rst:756 -msgid "To clarify the above rules, here's some example Python code, equivalent to the built-in hash, for computing the hash of a rational number, :class:`float`, or :class:`complex`::" +#, fuzzy +msgid "" +"To clarify the above rules, here's some example Python code, equivalent to " +"the built-in hash, for computing the hash of a rational number, " +":class:`float`, or :class:`complex`::" msgstr "" +"برای روشن شدن قوانین فوق، در اینجا چند نمونه کد پایتون، معادل هش داخلی، برای" +" محاسبه هش یک عدد گویا، :class:`float` یا :class:`complex` آورده شده است:" #: library/stdtypes.rst:761 -msgid "import sys, math\n" +#, fuzzy +msgid "" +"import sys, math\n" "\n" "def hash_fraction(m, n):\n" " \"\"\"Compute the hash of a rational number m / n.\n" @@ -963,625 +1632,1339 @@ msgid "import sys, math\n" " hash_value = -2\n" " return hash_value" msgstr "" +"import sys, math\n" +"\n" +"def hash_fraction(m, n):\n" +" \"\"\"Compute the hash of a rational number m / n.\n" +"\n" +" Assumes m and n are integers, with n positive.\n" +" Equivalent to hash(fractions.Fraction(m, n)).\n" +"\n" +" \"\"\"\n" +" P = sys.hash_info.modulus\n" +" # Remove common factors of P. (Unnecessary if m and n already coprime.)\n" +" while m % P == n % P == 0:\n" +" m, n = m // P, n // P\n" +"\n" +" if n % P == 0:\n" +" hash_value = sys.hash_info.inf\n" +" else:\n" +" # Fermat's Little Theorem: pow(n, P-1, P) is 1, so\n" +" # pow(n, P-2, P) gives the inverse of n modulo P.\n" +" hash_value = (abs(m) % P) * pow(n, P - 2, P) % P\n" +" if m < 0:\n" +" hash_value = -hash_value\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value\n" +"\n" +"def hash_float(x):\n" +" \"\"\"Compute the hash of a float x.\"\"\"\n" +"\n" +" if math.isnan(x):\n" +" return object.__hash__(x)\n" +" elif math.isinf(x):\n" +" return sys.hash_info.inf if x > 0 else -sys.hash_info.inf\n" +" else:\n" +" return hash_fraction(*x.as_integer_ratio())\n" +"\n" +"def hash_complex(z):\n" +" \"\"\"Compute the hash of a complex number z.\"\"\"\n" +"\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)\n" +" # do a signed reduction modulo 2**sys.hash_info.width\n" +" M = 2**(sys.hash_info.width - 1)\n" +" hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value" + +#: library/stdtypes.rst:812 +#, fuzzy +msgid "Boolean Type - :class:`bool`" +msgstr "نوع بولی - :class:`bool`" + +#: library/stdtypes.rst:814 +#, fuzzy +msgid "" +"Booleans represent truth values. The :class:`bool` type has exactly two " +"constant instances: ``True`` and ``False``." +msgstr "" +"بولی ها مقادیر حقیقت را نشان می دهند. نوع :class:`bool` دقیقاً دو نمونه ثابت" +" دارد: ``True`` و ``False``." + +#: library/stdtypes.rst:822 +#, fuzzy +msgid "" +"The built-in function :func:`bool` converts any value to a boolean, if the " +"value can be interpreted as a truth value (see section :ref:`truth` above)." +msgstr "" +"تابع داخلی :func:`bool` هر مقداری را به یک بولی تبدیل می کند، در صورتی که " +"مقدار را بتوان به عنوان یک مقدار واقعی تفسیر کرد (به بخش :ref:`truth` در " +"بالا مراجعه کنید)." + +#: library/stdtypes.rst:825 +#, fuzzy +msgid "" +"For logical operations, use the :ref:`boolean operators ` ``and``, " +"``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` " +"to two booleans, they return a bool equivalent to the logical operations " +"\"and\", \"or\", \"xor\". However, the logical operators ``and``, ``or`` and" +" ``!=`` should be preferred over ``&``, ``|`` and ``^``." +msgstr "" +"برای عملیات منطقی، از :ref:`boolean operators ` ``and``، ``or`` و " +"``not`` استفاده کنید. هنگامی که عملگرهای بیتی ``&``، ``|``، ``^`` را به دو " +"بولی اعمال می‌کنند، آنها یک Bool معادل عملیات منطقی \"and\"، \"or\"، \"xor\"" +" برمی‌گردانند. با این حال، عملگرهای منطقی ``and``، ``or`` و ``!=`` باید بر " +"``&``، ``|`` و ``^`` ترجیح داده شوند." + +#: library/stdtypes.rst:834 +#, fuzzy +msgid "" +"The use of the bitwise inversion operator ``~`` is deprecated and will raise" +" an error in Python 3.16." +msgstr "" +"استفاده از عملگر معکوس بیتی ``~`` منسوخ شده است و باعث بروز خطا در پایتون " +"3.16 می شود." + +#: library/stdtypes.rst:837 +#, fuzzy +msgid "" +":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In " +"many numeric contexts, ``False`` and ``True`` behave like the integers 0 and" +" 1, respectively. However, relying on this is discouraged; explicitly " +"convert using :func:`int` instead." +msgstr "" +":class:`bool` زیر کلاس :class:`int` است (به :ref:`typesnumeric` مراجعه " +"کنید). در بسیاری از زمینه های عددی، ``False`` و ``True`` به ترتیب مانند " +"اعداد صحیح 0 و 1 رفتار می کنند. با این حال، تکیه بر این دلسرد می شود; در عوض" +" با استفاده از :func:`int` به صراحت تبدیل کنید." + +#: library/stdtypes.rst:845 +#, fuzzy +msgid "Iterator Types" +msgstr "انواع تکرار کننده" -#: library/stdtypes.rst:812 -msgid "Boolean Type - :class:`bool`" -msgstr "" - -#: library/stdtypes.rst:814 -msgid "Booleans represent truth values. The :class:`bool` type has exactly two constant instances: ``True`` and ``False``." -msgstr "" - -#: library/stdtypes.rst:822 -msgid "The built-in function :func:`bool` converts any value to a boolean, if the value can be interpreted as a truth value (see section :ref:`truth` above)." -msgstr "" - -#: library/stdtypes.rst:825 -msgid "For logical operations, use the :ref:`boolean operators ` ``and``, ``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` to two booleans, they return a bool equivalent to the logical operations \"and\", \"or\", \"xor\". However, the logical operators ``and``, ``or`` and ``!=`` should be preferred over ``&``, ``|`` and ``^``." -msgstr "" - -#: library/stdtypes.rst:834 -msgid "The use of the bitwise inversion operator ``~`` is deprecated and will raise an error in Python 3.16." -msgstr "" - -#: library/stdtypes.rst:837 -msgid ":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In many numeric contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitly convert using :func:`int` instead." -msgstr "" - -#: library/stdtypes.rst:845 -msgid "Iterator Types" -msgstr "" - #: library/stdtypes.rst:853 -msgid "Python supports a concept of iteration over containers. This is implemented using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods." +#, fuzzy +msgid "" +"Python supports a concept of iteration over containers. This is implemented" +" using two distinct methods; these are used to allow user-defined classes to" +" support iteration. Sequences, described below in more detail, always " +"support the iteration methods." msgstr "" +"پایتون از مفهوم تکرار بر روی کانتینرها پشتیبانی می کند. این با استفاده از " +"دو روش مجزا اجرا می شود. اینها برای اجازه دادن به کلاس های تعریف شده توسط " +"کاربر برای پشتیبانی از تکرار استفاده می شوند. توالی‌هایی که در زیر با " +"جزئیات بیشتر توضیح داده شده‌اند، همیشه از روش‌های تکرار پشتیبانی می‌کنند." #: library/stdtypes.rst:858 -msgid "One method needs to be defined for container objects to provide :term:`iterable` support:" +#, fuzzy +msgid "" +"One method needs to be defined for container objects to provide " +":term:`iterable` support:" msgstr "" +"برای پشتیبانی از :term:`iterable` باید یک روش برای اشیاء کانتینر تعریف شود:" #: library/stdtypes.rst:865 -msgid "Return an :term:`iterator` object. The object is required to support the iterator protocol described below. If a container supports different types of iteration, additional methods can be provided to specifically request iterators for those iteration types. (An example of an object supporting multiple forms of iteration would be a tree structure which supports both breadth-first and depth-first traversal.) This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API." -msgstr "" +#, fuzzy +msgid "" +"Return an :term:`iterator` object. The object is required to support the " +"iterator protocol described below. If a container supports different types " +"of iteration, additional methods can be provided to specifically request " +"iterators for those iteration types. (An example of an object supporting " +"multiple forms of iteration would be a tree structure which supports both " +"breadth-first and depth-first traversal.) This method corresponds to the " +":c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python " +"objects in the Python/C API." +msgstr "" +"یک شی :term:`iterator` را برگردانید. شی برای پشتیبانی از پروتکل تکرار کننده" +" که در زیر توضیح داده شده است مورد نیاز است. اگر ظرفی از انواع مختلف تکرار " +"پشتیبانی می‌کند، می‌توان روش‌های دیگری را برای درخواست تکرارکننده‌های خاص " +"برای آن انواع تکرار ارائه کرد. (نمونه‌ای از یک شی که از چندین شکل تکرار " +"پشتیبانی می‌کند, ساختار درختی است که هم پیمایش اول عرض و هم از پیمایش عمق را" +" پشتیبانی می‌کند.) این روش مطابق با شکاف :c:member:`~PyTypeObject.tp_iter` " +"ساختار نوع برای اشیاء پایتون در Python/C API است." #: library/stdtypes.rst:874 -msgid "The iterator objects themselves are required to support the following two methods, which together form the :dfn:`iterator protocol`:" +#, fuzzy +msgid "" +"The iterator objects themselves are required to support the following two " +"methods, which together form the :dfn:`iterator protocol`:" msgstr "" +"خود اشیاء iterator باید از دو روش زیر پشتیبانی کنند که با هم پروتکل :dfn:` " +"iterator را تشکیل می دهند:" #: library/stdtypes.rst:880 -msgid "Return the :term:`iterator` object itself. This is required to allow both containers and iterators to be used with the :keyword:`for` and :keyword:`in` statements. This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API." +#, fuzzy +msgid "" +"Return the :term:`iterator` object itself. This is required to allow both " +"containers and iterators to be used with the :keyword:`for` and " +":keyword:`in` statements. This method corresponds to the " +":c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python " +"objects in the Python/C API." msgstr "" +"خود شی :term:`iterator` را برگردانید. این مورد لازم است تا امکان استفاده از" +" کانتینرها و تکرارکننده ها با دستورات :keyword:`for` و :keyword:`in` فراهم " +"شود. این روش با شکاف :c:member:`~PyTypeObject.tp_iter` ساختار نوع برای " +"اشیاء پایتون در Python/C API مطابقت دارد." #: library/stdtypes.rst:889 -msgid "Return the next item from the :term:`iterator`. If there are no further items, raise the :exc:`StopIteration` exception. This method corresponds to the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for Python objects in the Python/C API." +#, fuzzy +msgid "" +"Return the next item from the :term:`iterator`. If there are no further " +"items, raise the :exc:`StopIteration` exception. This method corresponds to" +" the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for " +"Python objects in the Python/C API." msgstr "" +"مورد بعدی را از :term:`iterator` برگردانید. اگر مورد دیگری وجود ندارد، " +"استثناء :exc:`StopIteration` را مطرح کنید. این روش مربوط به شکاف " +":c:member:`~PyTypeObject.tp_iternext` از ساختار نوع برای اشیاء پایتون در " +"Python/C API است." #: library/stdtypes.rst:894 -msgid "Python defines several iterator objects to support iteration over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol." +#, fuzzy +msgid "" +"Python defines several iterator objects to support iteration over general " +"and specific sequence types, dictionaries, and other more specialized forms." +" The specific types are not important beyond their implementation of the " +"iterator protocol." msgstr "" +"پایتون چندین شی تکرار کننده را برای پشتیبانی از تکرار بر روی انواع توالی های" +" عمومی و خاص، دیکشنری ها و سایر اشکال تخصصی تر تعریف می کند. انواع خاص " +"فراتر از اجرای پروتکل تکرارکننده مهم نیستند." #: library/stdtypes.rst:899 -msgid "Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken." +#, fuzzy +msgid "" +"Once an iterator's :meth:`~iterator.__next__` method raises " +":exc:`StopIteration`, it must continue to do so on subsequent calls. " +"Implementations that do not obey this property are deemed broken." msgstr "" +"هنگامی که متد :meth:`~iterator.__next__` تکرار کننده :exc:`StopIteration` را" +" افزایش می دهد، باید این کار را در تماس های بعدی ادامه دهد. اجراهایی که از " +"این ویژگی تبعیت نمی کنند شکسته تلقی می شوند." #: library/stdtypes.rst:907 +#, fuzzy msgid "Generator Types" -msgstr "" +msgstr "انواع ژنراتور" #: library/stdtypes.rst:909 -msgid "Python's :term:`generator`\\s provide a convenient way to implement the iterator protocol. If a container object's :meth:`~iterator.__iter__` method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the :meth:`!__iter__` and :meth:`~generator.__next__` methods. More information about generators can be found in :ref:`the documentation for the yield expression `." -msgstr "" +#, fuzzy +msgid "" +"Python's :term:`generator`\\s provide a convenient way to implement the " +"iterator protocol. If a container object's :meth:`~iterator.__iter__` " +"method is implemented as a generator, it will automatically return an " +"iterator object (technically, a generator object) supplying the " +":meth:`!__iter__` and :meth:`~generator.__next__` methods. More information " +"about generators can be found in :ref:`the documentation for the yield " +"expression `." +msgstr "" +":term:`generator` پایتون راه مناسبی برای پیاده سازی پروتکل تکرار کننده ارائه" +" می دهد. اگر روش :meth:`~iterator.__iter__` یک شی کانتینر به عنوان یک مولد " +"پیاده سازی شود، به طور خودکار یک شی تکرار کننده (از لحاظ فنی, یک شی مولد) که" +" متدهای :meth:`!__iter__` و :meth:`~generator.__next__` را تامین می کند، " +"برمی گرداند. اطلاعات بیشتر در مورد ژنراتورها را می توان در :ref:`the " +"documentation for the yield expression ` یافت." #: library/stdtypes.rst:921 +#, fuzzy msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" -msgstr "" +msgstr "انواع توالی --- :class:`list`، :class:`tuple`، :class:`range`" #: library/stdtypes.rst:923 -msgid "There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of :ref:`binary data ` and :ref:`text strings ` are described in dedicated sections." +#, fuzzy +msgid "" +"There are three basic sequence types: lists, tuples, and range objects. " +"Additional sequence types tailored for processing of :ref:`binary data " +"` and :ref:`text strings ` are described in dedicated " +"sections." msgstr "" +"سه نوع توالی اصلی وجود دارد: لیست ها، تاپل ها و اشیاء محدوده. انواع توالی " +"اضافی که برای پردازش :ref:`binary data ` و :ref:`text strings " +"` طراحی شده اند در بخش های اختصاصی توضیح داده شده اند." #: library/stdtypes.rst:932 +#, fuzzy msgid "Common Sequence Operations" -msgstr "" +msgstr "عملیات توالی مشترک" #: library/stdtypes.rst:936 -msgid "The operations in the following table are supported by most sequence types, both mutable and immutable. The :class:`collections.abc.Sequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types." +#, fuzzy +msgid "" +"The operations in the following table are supported by most sequence types, " +"both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " +"provided to make it easier to correctly implement these operations on custom" +" sequence types." msgstr "" +"عملیات‌های جدول زیر توسط اکثر انواع توالی، هم قابل تغییر و هم غیرقابل تغییر " +"پشتیبانی می‌شوند. :class:`collections.abc.Sequence` ABC برای سهولت اجرای " +"صحیح این عملیات در انواع توالی سفارشی ارائه شده است." #: library/stdtypes.rst:941 -msgid "This table lists the sequence operations sorted in ascending priority. In the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* are integers and *x* is an arbitrary object that meets any type and value restrictions imposed by *s*." +#, fuzzy +msgid "" +"This table lists the sequence operations sorted in ascending priority. In " +"the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k*" +" are integers and *x* is an arbitrary object that meets any type and value " +"restrictions imposed by *s*." msgstr "" +"این جدول عملیات های دنباله ای را که در اولویت صعودی مرتب شده اند فهرست می " +"کند. در جدول، *s* و *t* دنباله هایی از یک نوع هستند، *n*، *i*، *j* و *k* " +"اعداد صحیح هستند و *x* یک شی دلخواه است که هر نوع و مقدار محدودیت اعمال شده " +"توسط *s* را برآورده می کند." #: library/stdtypes.rst:946 -msgid "The ``in`` and ``not in`` operations have the same priorities as the comparison operations. The ``+`` (concatenation) and ``*`` (repetition) operations have the same priority as the corresponding numeric operations. [3]_" +#, fuzzy +msgid "" +"The ``in`` and ``not in`` operations have the same priorities as the " +"comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " +"operations have the same priority as the corresponding numeric operations. " +"[3]_" msgstr "" +"عملیات ``in`` و ``not in`` دارای اولویت های مشابه عملیات مقایسه هستند. " +"عملیات ``+`` (الحاق) و ``*`` (تکرار) اولویت مشابهی با عملیات عددی مربوطه " +"دارند. [3]_" #: library/stdtypes.rst:967 +#, fuzzy msgid "``x in s``" -msgstr "" +msgstr "``x in s``" #: library/stdtypes.rst:967 +#, fuzzy msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" +"``True`` اگر یک مورد از *s* برابر با *x* باشد، در غیر این صورت ``False``" #: library/stdtypes.rst:970 +#, fuzzy msgid "``x not in s``" -msgstr "" +msgstr "``x not in s``" #: library/stdtypes.rst:970 +#, fuzzy msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" +"``False`` اگر یک مورد از *s* برابر با *x* باشد، در غیر این صورت ``True``" #: library/stdtypes.rst:973 +#, fuzzy msgid "``s + t``" -msgstr "" +msgstr "``s + t``" #: library/stdtypes.rst:973 +#, fuzzy msgid "the concatenation of *s* and *t*" -msgstr "" +msgstr "الحاق *s* و *t*" #: library/stdtypes.rst:973 +#, fuzzy msgid "(6)(7)" -msgstr "" +msgstr "(6)(7)" #: library/stdtypes.rst:976 +#, fuzzy msgid "``s * n`` or ``n * s``" -msgstr "" +msgstr "``s * n`` یا ``n * s``" #: library/stdtypes.rst:976 +#, fuzzy msgid "equivalent to adding *s* to itself *n* times" -msgstr "" +msgstr "معادل اضافه کردن *s* به خود *n* بار" #: library/stdtypes.rst:976 +#, fuzzy msgid "(2)(7)" -msgstr "" +msgstr "(2)(7)" #: library/stdtypes.rst:979 +#, fuzzy msgid "``s[i]``" -msgstr "" +msgstr "``s[i]``" #: library/stdtypes.rst:979 +#, fuzzy msgid "*i*\\ th item of *s*, origin 0" -msgstr "" +msgstr "*i*\\ امین مورد از *s*، مبدا 0" #: library/stdtypes.rst:981 +#, fuzzy msgid "``s[i:j]``" -msgstr "" +msgstr "``s[i:j]``" #: library/stdtypes.rst:981 +#, fuzzy msgid "slice of *s* from *i* to *j*" -msgstr "" +msgstr "برشی از *s* از *i* به *j*" #: library/stdtypes.rst:981 +#, fuzzy msgid "(3)(4)" -msgstr "" +msgstr "(3)(4)" #: library/stdtypes.rst:983 +#, fuzzy msgid "``s[i:j:k]``" -msgstr "" +msgstr "``s[i:j:k]``" #: library/stdtypes.rst:983 +#, fuzzy msgid "slice of *s* from *i* to *j* with step *k*" -msgstr "" +msgstr "تکه ای از *s* از *i* به *j* با مرحله *k*" #: library/stdtypes.rst:983 +#, fuzzy msgid "(3)(5)" -msgstr "" +msgstr "(3)(5)" #: library/stdtypes.rst:986 +#, fuzzy msgid "``len(s)``" -msgstr "" +msgstr "``len(s)``" #: library/stdtypes.rst:986 +#, fuzzy msgid "length of *s*" -msgstr "" +msgstr "طول *s*" #: library/stdtypes.rst:988 +#, fuzzy msgid "``min(s)``" -msgstr "" +msgstr "``min(s)``" #: library/stdtypes.rst:988 +#, fuzzy msgid "smallest item of *s*" -msgstr "" +msgstr "کوچکترین مورد از *s*" #: library/stdtypes.rst:990 +#, fuzzy msgid "``max(s)``" -msgstr "" +msgstr "``max(s)``" #: library/stdtypes.rst:990 +#, fuzzy msgid "largest item of *s*" -msgstr "" +msgstr "بزرگترین مورد از *s*" #: library/stdtypes.rst:992 +#, fuzzy msgid "``s.index(x[, i[, j]])``" -msgstr "" +msgstr "``s.index(x[, i[, j]])``" #: library/stdtypes.rst:992 -msgid "index of the first occurrence of *x* in *s* (at or after index *i* and before index *j*)" -msgstr "" +#, fuzzy +msgid "" +"index of the first occurrence of *x* in *s* (at or after index *i* and " +"before index *j*)" +msgstr "شاخص اولین وقوع *x* در *s* (در یا بعد از شاخص *i* و قبل از شاخص *j*)" -#: library/stdtypes.rst:992 -#: library/stdtypes.rst:3659 +#: library/stdtypes.rst:992 library/stdtypes.rst:3659 +#, fuzzy msgid "\\(8)" -msgstr "" +msgstr "\\ (8)" #: library/stdtypes.rst:996 +#, fuzzy msgid "``s.count(x)``" -msgstr "" +msgstr "``s.count(x)``" #: library/stdtypes.rst:996 +#, fuzzy msgid "total number of occurrences of *x* in *s*" -msgstr "" +msgstr "تعداد کل موارد *x* در *s*" #: library/stdtypes.rst:1000 -msgid "Sequences of the same type also support comparisons. In particular, tuples and lists are compared lexicographically by comparing corresponding elements. This means that to compare equal, every element must compare equal and the two sequences must be of the same type and have the same length. (For full details see :ref:`comparisons` in the language reference.)" -msgstr "" +#, fuzzy +msgid "" +"Sequences of the same type also support comparisons. In particular, tuples " +"and lists are compared lexicographically by comparing corresponding " +"elements. This means that to compare equal, every element must compare equal" +" and the two sequences must be of the same type and have the same length. " +"(For full details see :ref:`comparisons` in the language reference.)" +msgstr "" +"دنباله هایی از همان نوع نیز از مقایسه پشتیبانی می کنند. به‌ویژه، تاپل‌ها و " +"فهرست‌ها از نظر واژگانی با مقایسه عناصر متناظر با هم مقایسه می‌شوند. این " +"بدان معنی است که برای مقایسه برابر، هر عنصر باید برابر باشد و دو دنباله باید" +" از یک نوع و طول یکسان باشند. (برای جزئیات کامل به :ref:`comparisons` در " +"مرجع زبان مراجعه کنید.)" #: library/stdtypes.rst:1010 -msgid "Forward and reversed iterators over mutable sequences access values using an index. That index will continue to march forward (or backward) even if the underlying sequence is mutated. The iterator terminates only when an :exc:`IndexError` or a :exc:`StopIteration` is encountered (or when the index drops below zero)." -msgstr "" +#, fuzzy +msgid "" +"Forward and reversed iterators over mutable sequences access values using an" +" index. That index will continue to march forward (or backward) even if the" +" underlying sequence is mutated. The iterator terminates only when an " +":exc:`IndexError` or a :exc:`StopIteration` is encountered (or when the " +"index drops below zero)." +msgstr "" +"تکرار کننده های رو به جلو و معکوس بر روی توالی های قابل تغییر به مقادیر با " +"استفاده از یک شاخص دسترسی پیدا می کنند. حتی اگر دنباله اصلی جهش یافته باشد،" +" این شاخص به حرکت به جلو (یا عقب) ادامه خواهد داد. تکرار کننده تنها زمانی " +"خاتمه می یابد که با :exc:`IndexError` یا :exc:`StopIteration` مواجه می شوید " +"(یا زمانی که ایندکس به زیر صفر می رسد)." #: library/stdtypes.rst:1019 -msgid "While the ``in`` and ``not in`` operations are used only for simple containment testing in the general case, some specialised sequences (such as :class:`str`, :class:`bytes` and :class:`bytearray`) also use them for subsequence testing::" +#, fuzzy +msgid "" +"While the ``in`` and ``not in`` operations are used only for simple " +"containment testing in the general case, some specialised sequences (such as" +" :class:`str`, :class:`bytes` and :class:`bytearray`) also use them for " +"subsequence testing::" msgstr "" +"در حالی که عملیات ``in`` و ``not in`` فقط برای آزمایش ساده مهار در حالت کلی " +"استفاده می شود، برخی از توالی های تخصصی (مانند :class:`str`, :class:`bytes` " +"و :class:`bytearray`) نیز از آنها برای آزمایش بعدی استفاده می کنند:" #: library/stdtypes.rst:1024 -msgid ">>> \"gg\" in \"eggs\"\n" +#, fuzzy +msgid "" +">>> \"gg\" in \"eggs\"\n" "True" msgstr "" +">>> \"gg\" in \"eggs\"\n" +"True" #: library/stdtypes.rst:1028 -msgid "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty sequence of the same type as *s*). Note that items in the sequence *s* are not copied; they are referenced multiple times. This often haunts new Python programmers; consider::" +#, fuzzy +msgid "" +"Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " +"sequence of the same type as *s*). Note that items in the sequence *s* are " +"not copied; they are referenced multiple times. This often haunts new " +"Python programmers; consider::" msgstr "" +"مقادیر *n* کمتر از ``0`` به عنوان ``0`` در نظر گرفته می شوند (که یک دنباله " +"خالی از همان نوع *s* را ایجاد می کند). توجه داشته باشید که موارد در دنباله " +"*s* کپی نمی شوند. آنها چندین بار ارجاع داده می شوند. این اغلب برنامه نویسان" +" پایتون جدید را آزار می دهد. در نظر بگیرید::" #: library/stdtypes.rst:1033 -msgid ">>> lists = [[]] * 3\n" +#, fuzzy +msgid "" +">>> lists = [[]] * 3\n" ">>> lists\n" "[[], [], []]\n" ">>> lists[0].append(3)\n" ">>> lists\n" "[[3], [3], [3]]" msgstr "" +">>> lists = [[]] * 3\n" +">>> lists\n" +"[[], [], []]\n" +">>> lists[0].append(3)\n" +">>> lists\n" +"[[3], [3], [3]]" #: library/stdtypes.rst:1040 -msgid "What has happened is that ``[[]]`` is a one-element list containing an empty list, so all three elements of ``[[]] * 3`` are references to this single empty list. Modifying any of the elements of ``lists`` modifies this single list. You can create a list of different lists this way::" +#, fuzzy +msgid "" +"What has happened is that ``[[]]`` is a one-element list containing an empty" +" list, so all three elements of ``[[]] * 3`` are references to this single " +"empty list. Modifying any of the elements of ``lists`` modifies this single" +" list. You can create a list of different lists this way::" msgstr "" +"اتفاقی که افتاده این است که ``[[]]`` یک لیست تک عنصری حاوی یک لیست خالی است،" +" بنابراین هر سه عنصر ``[[]] * 3`` ارجاعاتی به این لیست خالی هستند. اصلاح هر" +" یک از عناصر ``lists`` این لیست واحد را اصلاح می کند. شما می توانید لیستی از" +" لیست های مختلف را به این ترتیب ایجاد کنید:" #: library/stdtypes.rst:1045 -msgid ">>> lists = [[] for i in range(3)]\n" +#, fuzzy +msgid "" +">>> lists = [[] for i in range(3)]\n" ">>> lists[0].append(3)\n" ">>> lists[1].append(5)\n" ">>> lists[2].append(7)\n" ">>> lists\n" "[[3], [5], [7]]" msgstr "" +">>> lists = [[] for i in range(3)]\n" +">>> lists[0].append(3)\n" +">>> lists[1].append(5)\n" +">>> lists[2].append(7)\n" +">>> lists\n" +"[[3], [5], [7]]" #: library/stdtypes.rst:1052 -msgid "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-list`." +#, fuzzy +msgid "" +"Further explanation is available in the FAQ entry :ref:`faq-" +"multidimensional-list`." msgstr "" +"توضیحات بیشتر در مدخل سؤالات متداول :ref:`faq-multidimensional-list` موجود " +"است." #: library/stdtypes.rst:1056 -msgid "If *i* or *j* is negative, the index is relative to the end of sequence *s*: ``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is still ``0``." +#, fuzzy +msgid "" +"If *i* or *j* is negative, the index is relative to the end of sequence *s*:" +" ``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " +"still ``0``." msgstr "" +"اگر *i* یا *j* منفی باشد، شاخص نسبت به انتهای دنباله *s* است: ``len(s) + i``" +" یا ``len(s) + j`` جایگزین شده است. اما توجه داشته باشید که ``-0`` همچنان " +"``0`` است." #: library/stdtypes.rst:1061 -msgid "The slice of *s* from *i* to *j* is defined as the sequence of items with index *k* such that ``i <= k < j``. If *i* or *j* is greater than ``len(s)``, use ``len(s)``. If *i* is omitted or ``None``, use ``0``. If *j* is omitted or ``None``, use ``len(s)``. If *i* is greater than or equal to *j*, the slice is empty." -msgstr "" +#, fuzzy +msgid "" +"The slice of *s* from *i* to *j* is defined as the sequence of items with " +"index *k* such that ``i <= k < j``. If *i* or *j* is greater than " +"``len(s)``, use ``len(s)``. If *i* is omitted or ``None``, use ``0``. If " +"*j* is omitted or ``None``, use ``len(s)``. If *i* is greater than or equal" +" to *j*, the slice is empty." +msgstr "" +"برش *s* از *i* به *j* به عنوان دنباله ای از موارد با شاخص *k* تعریف می شود " +"به طوری که ``i <= k < j``. اگر *i* یا *j* بزرگتر از ``len(s)`` است، از " +"``len(s)`` استفاده کنید. اگر *i* حذف شده است یا ``None``، از ``0`` استفاده " +"کنید. اگر *j* حذف شده یا ``None``، از ``len(s)`` استفاده کنید. اگر *i* " +"بزرگتر یا مساوی با *j* باشد، برش خالی است." #: library/stdtypes.rst:1068 -msgid "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other words, the indices are ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but never including *j*). When *k* is positive, *i* and *j* are reduced to ``len(s)`` if they are greater. When *k* is negative, *i* and *j* are reduced to ``len(s) - 1`` if they are greater. If *i* or *j* are omitted or ``None``, they become \"end\" values (which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is ``None``, it is treated like ``1``." -msgstr "" +#, fuzzy +msgid "" +"The slice of *s* from *i* to *j* with step *k* is defined as the sequence of" +" items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other" +" words, the indices are ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` and so on, " +"stopping when *j* is reached (but never including *j*). When *k* is " +"positive, *i* and *j* are reduced to ``len(s)`` if they are greater. When " +"*k* is negative, *i* and *j* are reduced to ``len(s) - 1`` if they are " +"greater. If *i* or *j* are omitted or ``None``, they become \"end\" values " +"(which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is" +" ``None``, it is treated like ``1``." +msgstr "" +"برش *s* از *i* به *j* با مرحله *k* به عنوان دنباله ای از موارد با شاخص ``x =" +" i + n*k`` تعریف می شود به طوری که ``0 <= n < (j-i)/k``. به عبارت دیگر، " +"شاخص‌ها ``i``، ``i+k``، ``i+2*k``، ``i+3*k`` و غیره هستند که با رسیدن به *j*" +" متوقف می‌شوند (اما هرگز شامل *j* نمی‌شوند). هنگامی که *k* مثبت است، *i* و " +"*j* اگر بزرگتر باشند به ``len(s)`` کاهش می یابد. وقتی *k* منفی است، اگر " +"بزرگتر باشند، *i* و *j* به ``len(s) - 1`` کاهش می یابد. اگر *i* یا *j* حذف " +"شوند یا ``None``، به مقادیر \"پایان\" تبدیل می شوند (که پایان به علامت *k* " +"بستگی دارد). توجه داشته باشید، *k* نمی تواند صفر باشد. اگر *k* ``None`` " +"باشد، مانند ``1`` رفتار می شود." #: library/stdtypes.rst:1079 -msgid "Concatenating immutable sequences always results in a new object. This means that building up a sequence by repeated concatenation will have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below:" +#, fuzzy +msgid "" +"Concatenating immutable sequences always results in a new object. This " +"means that building up a sequence by repeated concatenation will have a " +"quadratic runtime cost in the total sequence length. To get a linear " +"runtime cost, you must switch to one of the alternatives below:" msgstr "" +"پیوستن دنباله های تغییرناپذیر همیشه منجر به یک شی جدید می شود. این بدان " +"معنی است که ساخت یک دنباله با الحاق مکرر هزینه زمان اجرا درجه دوم در طول کل " +"دنباله خواهد داشت. برای دریافت هزینه زمان اجرا خطی، باید به یکی از گزینه " +"های زیر بروید:" #: library/stdtypes.rst:1084 -msgid "if concatenating :class:`str` objects, you can build a list and use :meth:`str.join` at the end or else write to an :class:`io.StringIO` instance and retrieve its value when complete" +#, fuzzy +msgid "" +"if concatenating :class:`str` objects, you can build a list and use " +":meth:`str.join` at the end or else write to an :class:`io.StringIO` " +"instance and retrieve its value when complete" msgstr "" +"اگر اشیاء :class:`str` را به هم متصل کنید، می توانید یک لیست بسازید و در " +"پایان از :meth:`str.join` استفاده کنید یا در غیر این صورت در یک نمونه " +":class:`io.StringIO` بنویسید و پس از تکمیل مقدار آن را بازیابی کنید." #: library/stdtypes.rst:1088 -msgid "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :class:`bytearray` object. :class:`bytearray` objects are mutable and have an efficient overallocation mechanism" +#, fuzzy +msgid "" +"if concatenating :class:`bytes` objects, you can similarly use " +":meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place " +"concatenation with a :class:`bytearray` object. :class:`bytearray` objects " +"are mutable and have an efficient overallocation mechanism" msgstr "" +"اگر اشیاء :class:`bytes` را به هم متصل کنید، می توانید به طور مشابه از " +":meth:`bytes.join` یا :class:`io.BytesIO` استفاده کنید، یا می توانید الحاق " +"در محل با یک شی :class:`bytearray` انجام دهید. اشیاء :class:`bytearray` " +"قابل تغییر هستند و مکانیسم تخصیص بیش از حد کارآمدی دارند" #: library/stdtypes.rst:1093 -msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" +#, fuzzy +msgid "" +"if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" +"اگر اشیاء :class:`tuple` را به هم متصل کنید، به جای آن یک :class:`list` را " +"گسترش دهید" #: library/stdtypes.rst:1095 +#, fuzzy msgid "for other types, investigate the relevant class documentation" -msgstr "" +msgstr "برای انواع دیگر، مستندات کلاس مربوطه را بررسی کنید" #: library/stdtypes.rst:1099 -msgid "Some sequence types (such as :class:`range`) only support item sequences that follow specific patterns, and hence don't support sequence concatenation or repetition." +#, fuzzy +msgid "" +"Some sequence types (such as :class:`range`) only support item sequences " +"that follow specific patterns, and hence don't support sequence " +"concatenation or repetition." msgstr "" +"برخی از انواع توالی (مانند :class:`range`) فقط از دنباله آیتم هایی پشتیبانی " +"می کنند که از الگوهای خاصی پیروی می کنند، و از این رو از الحاق یا تکرار " +"دنباله پشتیبانی نمی کنند." #: library/stdtypes.rst:1104 -msgid "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all implementations support passing the additional arguments *i* and *j*. These arguments allow efficient searching of subsections of the sequence. Passing the extra arguments is roughly equivalent to using ``s[i:j].index(x)``, only without copying any data and with the returned index being relative to the start of the sequence rather than the start of the slice." -msgstr "" +#, fuzzy +msgid "" +"``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " +"implementations support passing the additional arguments *i* and *j*. These " +"arguments allow efficient searching of subsections of the sequence. Passing " +"the extra arguments is roughly equivalent to using ``s[i:j].index(x)``, only" +" without copying any data and with the returned index being relative to the " +"start of the sequence rather than the start of the slice." +msgstr "" +"هنگامی که *x* در *s* یافت نمی شود، ``index`` :exc:`ValueError` را افزایش می " +"دهد. همه پیاده سازی ها از ارسال آرگومان های اضافی *i* و *j* پشتیبانی نمی " +"کنند. این آرگومان‌ها امکان جستجوی مؤثر زیربخش‌های دنباله را فراهم می‌کنند. " +"ارسال آرگومان‌های اضافی تقریباً معادل استفاده از ``s[i:j].index(x)`` است، " +"فقط بدون کپی کردن هیچ داده‌ای و با ایندکس بازگشتی نسبت به شروع دنباله به جای" +" شروع برش." #: library/stdtypes.rst:1115 +#, fuzzy msgid "Immutable Sequence Types" -msgstr "" +msgstr "انواع توالی تغییرناپذیر" #: library/stdtypes.rst:1122 -msgid "The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the :func:`hash` built-in." +#, fuzzy +msgid "" +"The only operation that immutable sequence types generally implement that is" +" not also implemented by mutable sequence types is support for the " +":func:`hash` built-in." msgstr "" +"تنها عملیاتی که انواع توالی غیرقابل تغییر معمولاً اجرا می‌کنند و توسط انواع " +"توالی تغییرپذیر نیز اجرا نمی‌شود، پشتیبانی از :func:`hash` داخلی است." #: library/stdtypes.rst:1126 -msgid "This support allows immutable sequences, such as :class:`tuple` instances, to be used as :class:`dict` keys and stored in :class:`set` and :class:`frozenset` instances." +#, fuzzy +msgid "" +"This support allows immutable sequences, such as :class:`tuple` instances, " +"to be used as :class:`dict` keys and stored in :class:`set` and " +":class:`frozenset` instances." msgstr "" +"این پشتیبانی به دنباله های تغییرناپذیر مانند نمونه های :class:`tuple` اجازه " +"می دهد تا به عنوان کلیدهای :class:`dict` استفاده شوند و در نمونه های " +":class:`set` و :class:`frozenset` ذخیره شوند." #: library/stdtypes.rst:1130 -msgid "Attempting to hash an immutable sequence that contains unhashable values will result in :exc:`TypeError`." +#, fuzzy +msgid "" +"Attempting to hash an immutable sequence that contains unhashable values " +"will result in :exc:`TypeError`." msgstr "" +"تلاش برای هش کردن یک دنباله غیرقابل تغییر که حاوی مقادیر غیرقابل درهم سازی " +"است منجر به :exc:`TypeError` می شود." #: library/stdtypes.rst:1137 +#, fuzzy msgid "Mutable Sequence Types" -msgstr "" +msgstr "انواع توالی قابل تغییر" #: library/stdtypes.rst:1144 -msgid "The operations in the following table are defined on mutable sequence types. The :class:`collections.abc.MutableSequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types." +#, fuzzy +msgid "" +"The operations in the following table are defined on mutable sequence types." +" The :class:`collections.abc.MutableSequence` ABC is provided to make it " +"easier to correctly implement these operations on custom sequence types." msgstr "" +"عملیات در جدول زیر بر روی انواع توالی قابل تغییر تعریف شده است. " +":class:`collections.abc.MutableSequence` ABC برای سهولت اجرای صحیح این " +"عملیات در انواع توالی سفارشی ارائه شده است." #: library/stdtypes.rst:1148 -msgid "In the table *s* is an instance of a mutable sequence type, *t* is any iterable object and *x* is an arbitrary object that meets any type and value restrictions imposed by *s* (for example, :class:`bytearray` only accepts integers that meet the value restriction ``0 <= x <= 255``)." +#, fuzzy +msgid "" +"In the table *s* is an instance of a mutable sequence type, *t* is any " +"iterable object and *x* is an arbitrary object that meets any type and value" +" restrictions imposed by *s* (for example, :class:`bytearray` only accepts " +"integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" +"در جدول *s* نمونه ای از یک نوع توالی قابل تغییر است، *t* هر شیء قابل تکرار " +"است و *x* یک شی دلخواه است که هر نوع و مقدار محدودیت اعمال شده توسط *s* را " +"برآورده می کند (به عنوان مثال, :class:`bytearray` فقط اعداد صحیحی را می " +"پذیرد که دارای محدودیت مقدار ``0 <= x <= 255`` باشند)." #: library/stdtypes.rst:1172 +#, fuzzy msgid "``s[i] = x``" -msgstr "" +msgstr "``s[i] = x``" #: library/stdtypes.rst:1172 +#, fuzzy msgid "item *i* of *s* is replaced by *x*" -msgstr "" +msgstr "مورد *i* از *s* با *x* جایگزین شده است" #: library/stdtypes.rst:1175 +#, fuzzy msgid "``s[i:j] = t``" -msgstr "" +msgstr "``s[i:j] = t``" #: library/stdtypes.rst:1175 -msgid "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" -msgstr "" +#, fuzzy +msgid "" +"slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" +msgstr "تکه ای از *s* از *i* به *j* با محتویات *t* قابل تکرار جایگزین می شود." #: library/stdtypes.rst:1179 +#, fuzzy msgid "``del s[i:j]``" -msgstr "" +msgstr "``del s[i:j]``" #: library/stdtypes.rst:1179 +#, fuzzy msgid "same as ``s[i:j] = []``" -msgstr "" +msgstr "همانند ``s[i:j] = []``" #: library/stdtypes.rst:1181 +#, fuzzy msgid "``s[i:j:k] = t``" -msgstr "" +msgstr "``s[i:j:k] = t``" #: library/stdtypes.rst:1181 +#, fuzzy msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" -msgstr "" +msgstr "عناصر ``s[i:j:k]`` با عناصر *t* جایگزین می شوند" #: library/stdtypes.rst:1184 +#, fuzzy msgid "``del s[i:j:k]``" -msgstr "" +msgstr "``del s[i:j:k]``" #: library/stdtypes.rst:1184 +#, fuzzy msgid "removes the elements of ``s[i:j:k]`` from the list" -msgstr "" +msgstr "عناصر ``s[i:j:k]`` را از لیست حذف می کند" #: library/stdtypes.rst:1187 +#, fuzzy msgid "``s.append(x)``" -msgstr "" +msgstr "``s.append(x)``" #: library/stdtypes.rst:1187 -msgid "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" +#, fuzzy +msgid "" +"appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" +"*x* را به انتهای دنباله اضافه می کند (همان ``s[len(s):len(s)] = [x]``)" #: library/stdtypes.rst:1191 +#, fuzzy msgid "``s.clear()``" -msgstr "" +msgstr "``s.clear()``" #: library/stdtypes.rst:1191 +#, fuzzy msgid "removes all items from *s* (same as ``del s[:]``)" -msgstr "" +msgstr "تمام موارد را از *s* (همان ``del s[:]``) حذف می کند" #: library/stdtypes.rst:1194 +#, fuzzy msgid "``s.copy()``" -msgstr "" +msgstr "``s.copy()``" #: library/stdtypes.rst:1194 +#, fuzzy msgid "creates a shallow copy of *s* (same as ``s[:]``)" -msgstr "" +msgstr "یک کپی کم عمق از *s* (همان ``s[:]``) ایجاد می کند" #: library/stdtypes.rst:1197 +#, fuzzy msgid "``s.extend(t)`` or ``s += t``" -msgstr "" +msgstr "``s.extend(t)`` یا ``s += t``" #: library/stdtypes.rst:1197 -msgid "extends *s* with the contents of *t* (for the most part the same as ``s[len(s):len(s)] = t``)" +#, fuzzy +msgid "" +"extends *s* with the contents of *t* (for the most part the same as " +"``s[len(s):len(s)] = t``)" msgstr "" +"*s* را با محتویات *t* گسترش می دهد (در بیشتر موارد مشابه ``s[len(s):len(s)] " +"= t``)" #: library/stdtypes.rst:1202 +#, fuzzy msgid "``s *= n``" -msgstr "" +msgstr "``s *= n``" #: library/stdtypes.rst:1202 +#, fuzzy msgid "updates *s* with its contents repeated *n* times" -msgstr "" +msgstr "به روز رسانی *s* با محتوای آن *n* بار تکرار شده است" #: library/stdtypes.rst:1205 +#, fuzzy msgid "``s.insert(i, x)``" -msgstr "" +msgstr "``s.insert(i, x)``" #: library/stdtypes.rst:1205 -msgid "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" -msgstr "" +#, fuzzy +msgid "" +"inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" +msgstr "*x* را در شاخص *i* (همان ``s[i:i] = [x]``) در *s* قرار می دهد." #: library/stdtypes.rst:1209 +#, fuzzy msgid "``s.pop()`` or ``s.pop(i)``" -msgstr "" +msgstr "``s.pop()`` یا ``s.pop(i)``" #: library/stdtypes.rst:1209 +#, fuzzy msgid "retrieves the item at *i* and also removes it from *s*" -msgstr "" +msgstr "مورد را در *i* بازیابی می کند و همچنین آن را از *s* حذف می کند" #: library/stdtypes.rst:1212 +#, fuzzy msgid "``s.remove(x)``" -msgstr "" +msgstr "``s.remove(x)``" #: library/stdtypes.rst:1212 +#, fuzzy msgid "removes the first item from *s* where ``s[i]`` is equal to *x*" -msgstr "" +msgstr "اولین مورد را از *s* حذف می کند که در آن ``s[i]`` برابر با *x* است." #: library/stdtypes.rst:1216 +#, fuzzy msgid "``s.reverse()``" -msgstr "" +msgstr "``s.reverse()``" #: library/stdtypes.rst:1216 +#, fuzzy msgid "reverses the items of *s* in place" -msgstr "" +msgstr "موارد *s* را در جای خود معکوس می کند" #: library/stdtypes.rst:1224 -msgid "If *k* is not equal to ``1``, *t* must have the same length as the slice it is replacing." +#, fuzzy +msgid "" +"If *k* is not equal to ``1``, *t* must have the same length as the slice it " +"is replacing." msgstr "" +"اگر *k* برابر با ``1`` نباشد، *t* باید همان طول برشی که جایگزین می شود داشته" +" باشد." #: library/stdtypes.rst:1227 -msgid "The optional argument *i* defaults to ``-1``, so that by default the last item is removed and returned." +#, fuzzy +msgid "" +"The optional argument *i* defaults to ``-1``, so that by default the last " +"item is removed and returned." msgstr "" +"آرگومان اختیاری *i* به طور پیش فرض روی ``-1`` است، به طوری که به طور پیش فرض" +" آخرین مورد حذف شده و برگردانده می شود." #: library/stdtypes.rst:1231 +#, fuzzy msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" +"هنگامی که *x* در *s* یافت نمی شود، :meth:`remove` :exc:`ValueError` را " +"افزایش می دهد." #: library/stdtypes.rst:1234 -msgid "The :meth:`reverse` method modifies the sequence in place for economy of space when reversing a large sequence. To remind users that it operates by side effect, it does not return the reversed sequence." +#, fuzzy +msgid "" +"The :meth:`reverse` method modifies the sequence in place for economy of " +"space when reversing a large sequence. To remind users that it operates by " +"side effect, it does not return the reversed sequence." msgstr "" +"روش :meth:`reverse` توالی را برای صرفه جویی در فضا هنگام معکوس کردن یک " +"دنباله بزرگ تغییر می دهد. برای یادآوری به کاربران که با اثر جانبی عمل می " +"کند، دنباله معکوس را بر نمی گرداند." #: library/stdtypes.rst:1239 -msgid ":meth:`clear` and :meth:`!copy` are included for consistency with the interfaces of mutable containers that don't support slicing operations (such as :class:`dict` and :class:`set`). :meth:`!copy` is not part of the :class:`collections.abc.MutableSequence` ABC, but most concrete mutable sequence classes provide it." +#, fuzzy +msgid "" +":meth:`clear` and :meth:`!copy` are included for consistency with the " +"interfaces of mutable containers that don't support slicing operations (such" +" as :class:`dict` and :class:`set`). :meth:`!copy` is not part of the " +":class:`collections.abc.MutableSequence` ABC, but most concrete mutable " +"sequence classes provide it." msgstr "" +":meth:`clear` و :meth:`!copy` برای سازگاری با رابط های ظروف قابل تغییر که از" +" عملیات برش پشتیبانی نمی کنند (مانند :class:`dict` و :class:`set`) گنجانده " +"شده اند. :meth:`!copy` بخشی از :class:`collections.abc.MutableSequence` ABC " +"نیست، اما بیشتر کلاس‌های توالی قابل تغییر بتن آن را ارائه می‌کنند." #: library/stdtypes.rst:1245 +#, fuzzy msgid ":meth:`clear` and :meth:`!copy` methods." -msgstr "" +msgstr "روش های :meth:`clear` و :meth:`!copy`." #: library/stdtypes.rst:1249 -msgid "The value *n* is an integer, or an object implementing :meth:`~object.__index__`. Zero and negative values of *n* clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-common`." +#, fuzzy +msgid "" +"The value *n* is an integer, or an object implementing " +":meth:`~object.__index__`. Zero and negative values of *n* clear the " +"sequence. Items in the sequence are not copied; they are referenced " +"multiple times, as explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" +"مقدار *n* یک عدد صحیح یا یک شی است که :meth:`~object.__index__` را پیاده " +"سازی می کند. مقادیر صفر و منفی *n* دنباله را پاک می کند. موارد موجود در " +"دنباله کپی نمی شوند. همانطور که برای ``s * n`` در :ref:`typesseq-common` " +"توضیح داده شد، چندین بار به آنها ارجاع داده می شود." #: library/stdtypes.rst:1258 +#, fuzzy msgid "Lists" -msgstr "" +msgstr "لیست ها" #: library/stdtypes.rst:1262 -msgid "Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application)." +#, fuzzy +msgid "" +"Lists are mutable sequences, typically used to store collections of " +"homogeneous items (where the precise degree of similarity will vary by " +"application)." msgstr "" +"فهرست‌ها توالی‌های قابل تغییر هستند که معمولاً برای ذخیره مجموعه‌هایی از " +"آیتم‌های همگن استفاده می‌شوند (که در آن درجه دقیق شباهت بر اساس کاربرد " +"متفاوت است)." #: library/stdtypes.rst:1268 +#, fuzzy msgid "Lists may be constructed in several ways:" -msgstr "" +msgstr "فهرست ها را می توان به روش های مختلفی ساخت:" #: library/stdtypes.rst:1270 +#, fuzzy msgid "Using a pair of square brackets to denote the empty list: ``[]``" -msgstr "" +msgstr "استفاده از یک جفت براکت مربع برای نشان دادن لیست خالی: ``[]``" #: library/stdtypes.rst:1271 -msgid "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" +#, fuzzy +msgid "" +"Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" +"با استفاده از براکت مربع، موارد را با کاما جدا کنید: ``[a]``، ``[a, b, c]``" #: library/stdtypes.rst:1272 +#, fuzzy msgid "Using a list comprehension: ``[x for x in iterable]``" -msgstr "" +msgstr "با استفاده از درک لیست: ``[x for x in iterable]``" #: library/stdtypes.rst:1273 +#, fuzzy msgid "Using the type constructor: ``list()`` or ``list(iterable)``" -msgstr "" +msgstr "با استفاده از سازنده نوع: ``list()`` یا ``list(iterable)``" #: library/stdtypes.rst:1275 -msgid "The constructor builds a list whose items are the same and in the same order as *iterable*'s items. *iterable* may be either a sequence, a container that supports iteration, or an iterator object. If *iterable* is already a list, a copy is made and returned, similar to ``iterable[:]``. For example, ``list('abc')`` returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, the constructor creates a new empty list, ``[]``." -msgstr "" +#, fuzzy +msgid "" +"The constructor builds a list whose items are the same and in the same order" +" as *iterable*'s items. *iterable* may be either a sequence, a container " +"that supports iteration, or an iterator object. If *iterable* is already a " +"list, a copy is made and returned, similar to ``iterable[:]``. For example, " +"``list('abc')`` returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` " +"returns ``[1, 2, 3]``. If no argument is given, the constructor creates a " +"new empty list, ``[]``." +msgstr "" +"سازنده لیستی می سازد که آیتم های آن مشابه و به ترتیب آیتم های *iterable* " +"هستند. *iterable* ممکن است یک دنباله باشد، یک ظرف که از تکرار پشتیبانی می " +"کند، یا یک شی تکرار شونده. اگر *iterable* از قبل یک لیست است، یک کپی ساخته " +"شده و بازگردانده می شود، مشابه ``iterable[:]``. برای مثال، ``list('abc')`` " +"``['a', 'b', 'c']`` و ``list( (1, 2, 3) )`` ``[1, 2, 3]`` را برمی گرداند. " +"اگر هیچ آرگومانی داده نشود، سازنده یک لیست خالی جدید به نام ``[]`` ایجاد می " +"کند." #: library/stdtypes.rst:1284 -msgid "Many other operations also produce lists, including the :func:`sorted` built-in." +#, fuzzy +msgid "" +"Many other operations also produce lists, including the :func:`sorted` " +"built-in." msgstr "" +"بسیاری از عملیات های دیگر نیز لیست هایی را تولید می کنند، از جمله " +":func:`sorted` داخلی." #: library/stdtypes.rst:1287 -msgid "Lists implement all of the :ref:`common ` and :ref:`mutable ` sequence operations. Lists also provide the following additional method:" +#, fuzzy +msgid "" +"Lists implement all of the :ref:`common ` and :ref:`mutable" +" ` sequence operations. Lists also provide the following " +"additional method:" msgstr "" +"لیست ها تمام عملیات دنباله :ref:`common ` و :ref:`mutable " +"` را اجرا می کنند. فهرست ها همچنین روش اضافی زیر را ارائه " +"می دهند:" #: library/stdtypes.rst:1293 -msgid "This method sorts the list in place, using only ``<`` comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state)." +#, fuzzy +msgid "" +"This method sorts the list in place, using only ``<`` comparisons between " +"items. Exceptions are not suppressed - if any comparison operations fail, " +"the entire sort operation will fail (and the list will likely be left in a " +"partially modified state)." msgstr "" +"این روش با استفاده از مقایسه ``<`` بین موارد، لیست را در جای خود مرتب می " +"کند. استثناها سرکوب نمی شوند - اگر هر یک از عملیات مقایسه با شکست مواجه شود،" +" کل عملیات مرتب سازی با شکست مواجه می شود (و لیست احتمالاً در یک حالت اصلاح " +"شده باقی می ماند)." #: library/stdtypes.rst:1298 -msgid ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:`keyword-only arguments `):" +#, fuzzy +msgid "" +":meth:`sort` accepts two arguments that can only be passed by keyword " +"(:ref:`keyword-only arguments `):" msgstr "" +":meth:`sort` دو آرگومان را می پذیرد که فقط با کلمه کلیدی (:ref:`keyword-only" +" arguments `) قابل ارسال هستند:" #: library/stdtypes.rst:1301 -msgid "*key* specifies a function of one argument that is used to extract a comparison key from each list element (for example, ``key=str.lower``). The key corresponding to each item in the list is calculated once and then used for the entire sorting process. The default value of ``None`` means that list items are sorted directly without calculating a separate key value." -msgstr "" +#, fuzzy +msgid "" +"*key* specifies a function of one argument that is used to extract a " +"comparison key from each list element (for example, ``key=str.lower``). The " +"key corresponding to each item in the list is calculated once and then used " +"for the entire sorting process. The default value of ``None`` means that " +"list items are sorted directly without calculating a separate key value." +msgstr "" +"*key* تابعی از یک آرگومان را مشخص می کند که برای استخراج یک کلید مقایسه از " +"هر عنصر لیست (مثلا ``key=str.lower``) استفاده می شود. کلید مربوط به هر مورد " +"در لیست یک بار محاسبه می شود و سپس برای کل فرآیند مرتب سازی استفاده می شود. " +"مقدار پیش‌فرض ``None`` به این معنی است که آیتم‌های لیست مستقیماً بدون محاسبه" +" مقدار کلید جداگانه مرتب می‌شوند." #: library/stdtypes.rst:1308 -msgid "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style *cmp* function to a *key* function." +#, fuzzy +msgid "" +"The :func:`functools.cmp_to_key` utility is available to convert a 2.x style" +" *cmp* function to a *key* function." msgstr "" +"ابزار :func:`functools.cmp_to_key` برای تبدیل تابع *cmp* سبک 2.x به تابع " +"*key* در دسترس است." #: library/stdtypes.rst:1311 -msgid "*reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed." +#, fuzzy +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the list elements " +"are sorted as if each comparison were reversed." msgstr "" +"*reverse* یک مقدار بولی است. اگر روی ``True`` تنظیم شود، عناصر لیست طوری " +"مرتب می شوند که گویی هر مقایسه معکوس شده است." #: library/stdtypes.rst:1314 -msgid "This method modifies the sequence in place for economy of space when sorting a large sequence. To remind users that it operates by side effect, it does not return the sorted sequence (use :func:`sorted` to explicitly request a new sorted list instance)." +#, fuzzy +msgid "" +"This method modifies the sequence in place for economy of space when sorting" +" a large sequence. To remind users that it operates by side effect, it does" +" not return the sorted sequence (use :func:`sorted` to explicitly request a " +"new sorted list instance)." msgstr "" +"این روش هنگام مرتب‌سازی یک توالی بزرگ، توالی را برای صرفه‌جویی در فضا تغییر " +"می‌دهد. برای یادآوری به کاربران که با اثر جانبی عمل می کند، دنباله مرتب شده" +" را بر نمی گرداند (از :func:`sorted` برای درخواست صریح یک نمونه لیست مرتب " +"شده جدید استفاده کنید)." #: library/stdtypes.rst:1319 -msgid "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade)." +#, fuzzy +msgid "" +"The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " +"guarantees not to change the relative order of elements that compare equal " +"--- this is helpful for sorting in multiple passes (for example, sort by " +"department, then by salary grade)." msgstr "" +"روش :meth:`sort` تضمین شده است که پایدار است. مرتب‌سازی پایدار است اگر " +"تضمین کند که ترتیب نسبی عناصری که با هم مقایسه می‌شوند تغییر نمی‌کند --- این" +" برای مرتب‌سازی در چند پاس مفید است (مثلاً مرتب‌سازی بر اساس بخش, سپس بر " +"اساس درجه حقوق)." #: library/stdtypes.rst:1324 -msgid "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." +#, fuzzy +msgid "" +"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" +"برای نمونه‌های مرتب‌سازی و یک آموزش مختصر مرتب‌سازی، به :ref:`sortinghowto` " +"مراجعه کنید." #: library/stdtypes.rst:1328 -msgid "While a list is being sorted, the effect of attempting to mutate, or even inspect, the list is undefined. The C implementation of Python makes the list appear empty for the duration, and raises :exc:`ValueError` if it can detect that the list has been mutated during a sort." +#, fuzzy +msgid "" +"While a list is being sorted, the effect of attempting to mutate, or even " +"inspect, the list is undefined. The C implementation of Python makes the " +"list appear empty for the duration, and raises :exc:`ValueError` if it can " +"detect that the list has been mutated during a sort." msgstr "" +"در حالی که یک لیست مرتب می شود، اثر تلاش برای جهش، یا حتی بازرسی، لیست تعریف" +" نشده است. پیاده سازی C پایتون باعث می شود که لیست برای مدت زمان خالی به " +"نظر برسد و اگر بتواند تشخیص دهد که لیست در طول مرتب سازی جهش یافته است، " +":exc:`ValueError` را افزایش می دهد." #: library/stdtypes.rst:1337 +#, fuzzy msgid "Tuples" -msgstr "" +msgstr "تاپل ها" #: library/stdtypes.rst:1341 -msgid "Tuples are immutable sequences, typically used to store collections of heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` built-in). Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a :class:`set` or :class:`dict` instance)." -msgstr "" +#, fuzzy +msgid "" +"Tuples are immutable sequences, typically used to store collections of " +"heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " +"built-in). Tuples are also used for cases where an immutable sequence of " +"homogeneous data is needed (such as allowing storage in a :class:`set` or " +":class:`dict` instance)." +msgstr "" +"تاپل ها توالی های تغییرناپذیری هستند که معمولاً برای ذخیره مجموعه ای از داده" +" های ناهمگن استفاده می شوند (مانند 2 تاپل تولید شده توسط :func:`enumerate` " +"داخلی). تاپل ها همچنین برای مواردی استفاده می شوند که به دنباله ای " +"تغییرناپذیر از داده های همگن نیاز است (مانند اجازه ذخیره سازی در یک نمونه " +":class:`set` یا :class:`dict`)." #: library/stdtypes.rst:1349 +#, fuzzy msgid "Tuples may be constructed in a number of ways:" -msgstr "" +msgstr "تاپل ها ممکن است به روش های مختلفی ساخته شوند:" #: library/stdtypes.rst:1351 +#, fuzzy msgid "Using a pair of parentheses to denote the empty tuple: ``()``" -msgstr "" +msgstr "استفاده از یک جفت پرانتز برای نشان دادن تاپل خالی: ``()``" #: library/stdtypes.rst:1352 +#, fuzzy msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" -msgstr "" +msgstr "استفاده از کاما انتهایی برای یک تاپل تکی: ``a,`` یا ``(a,)``" #: library/stdtypes.rst:1353 +#, fuzzy msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" -msgstr "" +msgstr "جداسازی موارد با کاما: ``a, b, c`` یا ``(a, b, c)``" #: library/stdtypes.rst:1354 +#, fuzzy msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" -msgstr "" +msgstr "استفاده از :func:`tuple` داخلی: ``tuple()`` یا ``tuple(iterable)``" #: library/stdtypes.rst:1356 -msgid "The constructor builds a tuple whose items are the same and in the same order as *iterable*'s items. *iterable* may be either a sequence, a container that supports iteration, or an iterator object. If *iterable* is already a tuple, it is returned unchanged. For example, ``tuple('abc')`` returns ``('a', 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, 3)``. If no argument is given, the constructor creates a new empty tuple, ``()``." -msgstr "" +#, fuzzy +msgid "" +"The constructor builds a tuple whose items are the same and in the same " +"order as *iterable*'s items. *iterable* may be either a sequence, a " +"container that supports iteration, or an iterator object. If *iterable* is " +"already a tuple, it is returned unchanged. For example, ``tuple('abc')`` " +"returns ``('a', 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, " +"3)``. If no argument is given, the constructor creates a new empty tuple, " +"``()``." +msgstr "" +"سازنده یک تاپل می‌سازد که آیتم‌های آن مشابه و به ترتیب آیتم‌های *iterable* " +"هستند. *iterable* ممکن است یک دنباله باشد، یک ظرف که از تکرار پشتیبانی می " +"کند، یا یک شی تکرار شونده. اگر *iterable* قبلاً یک تاپل باشد، بدون تغییر " +"برگردانده می شود. برای مثال، ``tuple('abc')`` ``('a', 'b', 'c')`` و ``tuple(" +" [1, 2, 3] )`` ``(1, 2, 3)`` را برمی گرداند. اگر هیچ آرگومانی داده نشود، " +"سازنده یک تاپل خالی جدید به نام ``()`` ایجاد می کند." #: library/stdtypes.rst:1364 -msgid "Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or when they are needed to avoid syntactic ambiguity. For example, ``f(a, b, c)`` is a function call with three arguments, while ``f((a, b, c))`` is a function call with a 3-tuple as the sole argument." -msgstr "" +#, fuzzy +msgid "" +"Note that it is actually the comma which makes a tuple, not the parentheses." +" The parentheses are optional, except in the empty tuple case, or when they " +"are needed to avoid syntactic ambiguity. For example, ``f(a, b, c)`` is a " +"function call with three arguments, while ``f((a, b, c))`` is a function " +"call with a 3-tuple as the sole argument." +msgstr "" +"توجه داشته باشید که در واقع کاما است که تاپل را می سازد، نه پرانتز. پرانتزها" +" اختیاری هستند، به جز در حالت تاپلی خالی، یا زمانی که برای جلوگیری از ابهام " +"نحوی مورد نیاز هستند. به عنوان مثال، ``f(a, b, c)`` یک فراخوانی تابع با سه " +"آرگومان است، در حالی که ``f((a, b, c))`` یک فراخوانی تابع با 3-tuple به " +"عنوان تنها آرگومان است." #: library/stdtypes.rst:1370 -msgid "Tuples implement all of the :ref:`common ` sequence operations." +#, fuzzy +msgid "" +"Tuples implement all of the :ref:`common ` sequence " +"operations." msgstr "" +"Tuples تمام عملیات توالی :ref:`common ` را اجرا می کند." #: library/stdtypes.rst:1373 -msgid "For heterogeneous collections of data where access by name is clearer than access by index, :func:`collections.namedtuple` may be a more appropriate choice than a simple tuple object." +#, fuzzy +msgid "" +"For heterogeneous collections of data where access by name is clearer than " +"access by index, :func:`collections.namedtuple` may be a more appropriate " +"choice than a simple tuple object." msgstr "" +"برای مجموعه‌های ناهمگن از داده‌ها که دسترسی به نام واضح‌تر از دسترسی به " +"فهرست است، :func:`collections.namedtuple` ممکن است انتخاب مناسب‌تری نسبت به " +"یک شی چندگانه ساده باشد." #: library/stdtypes.rst:1381 +#, fuzzy msgid "Ranges" -msgstr "" +msgstr "محدوده ها" #: library/stdtypes.rst:1385 -msgid "The :class:`range` type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in :keyword:`for` loops." +#, fuzzy +msgid "" +"The :class:`range` type represents an immutable sequence of numbers and is " +"commonly used for looping a specific number of times in :keyword:`for` " +"loops." msgstr "" +"نوع :class:`range` نشان دهنده یک دنباله غیرقابل تغییر از اعداد است و معمولاً" +" برای حلقه زدن تعداد مشخصی از بارها در حلقه های :keyword:`for` استفاده می " +"شود." #: library/stdtypes.rst:1392 -msgid "The arguments to the range constructor must be integers (either built-in :class:`int` or any object that implements the :meth:`~object.__index__` special method). If the *step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it defaults to ``0``. If *step* is zero, :exc:`ValueError` is raised." -msgstr "" +#, fuzzy +msgid "" +"The arguments to the range constructor must be integers (either built-in " +":class:`int` or any object that implements the :meth:`~object.__index__` " +"special method). If the *step* argument is omitted, it defaults to ``1``. " +"If the *start* argument is omitted, it defaults to ``0``. If *step* is zero," +" :exc:`ValueError` is raised." +msgstr "" +"آرگومان های سازنده محدوده باید اعداد صحیح باشند (یا :class:`int` داخلی یا هر" +" شیئی که متد ویژه :meth:`~object.__index__` را پیاده سازی می کند). اگر " +"آرگومان *step* حذف شود، به طور پیش فرض روی ``1`` قرار می گیرد. اگر آرگومان " +"*start* حذف شود، به طور پیش فرض روی ``0`` قرار می گیرد. اگر *step* صفر باشد،" +" :exc:`ValueError` افزایش می یابد." #: library/stdtypes.rst:1398 -msgid "For a positive *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." +#, fuzzy +msgid "" +"For a positive *step*, the contents of a range ``r`` are determined by the " +"formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" +"برای *step* مثبت، محتویات یک محدوده ``r`` با فرمول ``r[i] = start + step*i``" +" که در آن ``i >= 0`` و ``r[i] < stop`` تعیین می شود." #: library/stdtypes.rst:1402 -msgid "For a negative *step*, the contents of the range are still determined by the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and ``r[i] > stop``." +#, fuzzy +msgid "" +"For a negative *step*, the contents of the range are still determined by the" +" formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " +"``r[i] > stop``." msgstr "" +"برای *step* منفی، محتویات محدوده همچنان با فرمول ``r[i] = start + step*i`` " +"تعیین می شود، اما محدودیت ها ``i >= 0`` و ``r[i] > stop`` هستند." #: library/stdtypes.rst:1406 -msgid "A range object will be empty if ``r[0]`` does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices." +#, fuzzy +msgid "" +"A range object will be empty if ``r[0]`` does not meet the value constraint." +" Ranges do support negative indices, but these are interpreted as indexing " +"from the end of the sequence determined by the positive indices." msgstr "" +"اگر ``r[0]`` محدودیت مقدار را برآورده نکند، یک شی محدوده خالی خواهد بود. " +"محدوده ها از شاخص های منفی پشتیبانی می کنند، اما این شاخص ها به عنوان نمایه " +"سازی از انتهای دنباله تعیین شده توسط شاخص های مثبت تفسیر می شوند." #: library/stdtypes.rst:1411 -msgid "Ranges containing absolute values larger than :data:`sys.maxsize` are permitted but some features (such as :func:`len`) may raise :exc:`OverflowError`." +#, fuzzy +msgid "" +"Ranges containing absolute values larger than :data:`sys.maxsize` are " +"permitted but some features (such as :func:`len`) may raise " +":exc:`OverflowError`." msgstr "" +"محدوده های حاوی مقادیر مطلق بزرگتر از :data:`sys.maxsize` مجاز هستند، اما " +"برخی از ویژگی ها (مانند :func:`len`) ممکن است :exc:`OverflowError` را افزایش" +" دهند." #: library/stdtypes.rst:1415 +#, fuzzy msgid "Range examples::" -msgstr "" +msgstr "نمونه های محدوده::" #: library/stdtypes.rst:1417 -msgid ">>> list(range(10))\n" +#, fuzzy +msgid "" +">>> list(range(10))\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" ">>> list(range(1, 11))\n" "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" @@ -1596,471 +2979,1216 @@ msgid ">>> list(range(10))\n" ">>> list(range(1, 0))\n" "[]" msgstr "" +">>> list(range(10))\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> list(range(1, 11))\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" +">>> list(range(0, 30, 5))\n" +"[0, 5, 10, 15, 20, 25]\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +">>> list(range(0, -10, -1))\n" +"[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n" +">>> list(range(0))\n" +"[]\n" +">>> list(range(1, 0))\n" +"[]" #: library/stdtypes.rst:1432 -msgid "Ranges implement all of the :ref:`common ` sequence operations except concatenation and repetition (due to the fact that range objects can only represent sequences that follow a strict pattern and repetition and concatenation will usually violate that pattern)." +#, fuzzy +msgid "" +"Ranges implement all of the :ref:`common ` sequence " +"operations except concatenation and repetition (due to the fact that range " +"objects can only represent sequences that follow a strict pattern and " +"repetition and concatenation will usually violate that pattern)." msgstr "" +"محدوده ها همه عملیات دنباله :ref:`common ` را به جز الحاق و" +" تکرار اجرا می کنند (به دلیل این واقعیت که اشیاء محدوده فقط می توانند دنباله" +" هایی را نشان دهند که از یک الگوی دقیق پیروی می کنند و تکرار و الحاق معمولاً" +" آن الگو را نقض می کند)." #: library/stdtypes.rst:1439 -msgid "The value of the *start* parameter (or ``0`` if the parameter was not supplied)" -msgstr "" +#, fuzzy +msgid "" +"The value of the *start* parameter (or ``0`` if the parameter was not " +"supplied)" +msgstr "مقدار پارامتر *start* (یا ``0`` اگر پارامتر ارائه نشده باشد)" #: library/stdtypes.rst:1444 +#, fuzzy msgid "The value of the *stop* parameter" -msgstr "" +msgstr "مقدار پارامتر *stop*" #: library/stdtypes.rst:1448 -msgid "The value of the *step* parameter (or ``1`` if the parameter was not supplied)" -msgstr "" +#, fuzzy +msgid "" +"The value of the *step* parameter (or ``1`` if the parameter was not " +"supplied)" +msgstr "مقدار پارامتر *step* (یا ``1`` اگر پارامتر ارائه نشده باشد)" #: library/stdtypes.rst:1451 -msgid "The advantage of the :class:`range` type over a regular :class:`list` or :class:`tuple` is that a :class:`range` object will always take the same (small) amount of memory, no matter the size of the range it represents (as it only stores the ``start``, ``stop`` and ``step`` values, calculating individual items and subranges as needed)." -msgstr "" +#, fuzzy +msgid "" +"The advantage of the :class:`range` type over a regular :class:`list` or " +":class:`tuple` is that a :class:`range` object will always take the same " +"(small) amount of memory, no matter the size of the range it represents (as " +"it only stores the ``start``, ``stop`` and ``step`` values, calculating " +"individual items and subranges as needed)." +msgstr "" +"مزیت نوع :class:`range` نسبت به یک :class:`list` یا :class:`tuple` معمولی " +"این است که یک شی :class:`range` همیشه همان مقدار (کم) حافظه را اشغال می کند،" +" صرف نظر از اندازه محدوده ای که نشان می دهد (زیرا فقط مقادیر ``start``, " +"``stop`` و ``step`` را ذخیره می کند و مقادیر مورد نیاز را به صورت جداگانه " +"محاسبه می کند)." #: library/stdtypes.rst:1457 -msgid "Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see :ref:`typesseq`):" +#, fuzzy +msgid "" +"Range objects implement the :class:`collections.abc.Sequence` ABC, and " +"provide features such as containment tests, element index lookup, slicing " +"and support for negative indices (see :ref:`typesseq`):" msgstr "" +"اشیاء محدوده :class:`collections.abc.Sequence` ABC را پیاده‌سازی می‌کنند و " +"ویژگی‌هایی مانند آزمایش‌های مهار، جستجوی فهرست عناصر، برش و پشتیبانی از " +"شاخص‌های منفی را ارائه می‌کنند (به :ref:`typesseq` مراجعه کنید):" #: library/stdtypes.rst:1477 -msgid "Testing range objects for equality with ``==`` and ``!=`` compares them as sequences. That is, two range objects are considered equal if they represent the same sequence of values. (Note that two range objects that compare equal might have different :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, 3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" -msgstr "" +#, fuzzy +msgid "" +"Testing range objects for equality with ``==`` and ``!=`` compares them as " +"sequences. That is, two range objects are considered equal if they " +"represent the same sequence of values. (Note that two range objects that " +"compare equal might have different :attr:`~range.start`, :attr:`~range.stop`" +" and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, " +"3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" +msgstr "" +"آزمایش اشیاء محدوده برای برابری با ``==`` و ``!=`` آنها را به عنوان دنباله " +"مقایسه می کند. به این معنا که دو شی محدوده در صورتی برابر در نظر گرفته می " +"شوند که دنباله ای از مقادیر یکسان را نشان دهند. (توجه داشته باشید که دو شی " +"محدوده ای که با هم مقایسه می شوند ممکن است ویژگی های :attr:`~range.start`, " +":attr:`~range.stop` و :attr:`~range.step` متفاوتی داشته باشند, برای مثال " +"``range(0) == range(2, 1, 3)`` یا ``range(0, 3, 2) == range(0, 4, 2)``.)" #: library/stdtypes.rst:1484 -msgid "Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for membership in constant time instead of iterating through all items." +#, fuzzy +msgid "" +"Implement the Sequence ABC. Support slicing and negative indices. Test " +":class:`int` objects for membership in constant time instead of iterating " +"through all items." msgstr "" +"دنباله ABC را اجرا کنید. از برش و شاخص های منفی پشتیبانی کنید. به جای تکرار " +"در تمام موارد، اشیاء :class:`int` را برای عضویت در زمان ثابت آزمایش کنید." #: library/stdtypes.rst:1490 -msgid "Define '==' and '!=' to compare range objects based on the sequence of values they define (instead of comparing based on object identity)." +#, fuzzy +msgid "" +"Define '==' and '!=' to compare range objects based on the sequence of " +"values they define (instead of comparing based on object identity)." msgstr "" +"«==» و «!=» را برای مقایسه اشیاء محدوده بر اساس توالی مقادیری که تعریف می " +"کنند (به جای مقایسه بر اساس هویت شی) تعریف کنید." #: library/stdtypes.rst:1495 -msgid "Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes." +#, fuzzy +msgid "" +"Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " +"attributes." msgstr "" +"ویژگی های :attr:`~range.start`، :attr:`~range.stop` و :attr:`~range.step` " +"اضافه شده است." #: library/stdtypes.rst:1500 -msgid "The `linspace recipe `_ shows how to implement a lazy version of range suitable for floating-point applications." +#, fuzzy +msgid "" +"The `linspace recipe `_ shows how to implement a lazy version of range " +"suitable for floating-point applications." msgstr "" +"`linspace recipe `_ نشان می دهد که چگونه می توان یک نسخه تنبل از " +"محدوده مناسب برای برنامه های ممیز شناور را پیاده سازی کرد." #: library/stdtypes.rst:1512 +#, fuzzy msgid "Text Sequence Type --- :class:`str`" -msgstr "" +msgstr "نوع دنباله متن --- :class:`str`" #: library/stdtypes.rst:1514 -msgid "Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`. Strings are immutable :ref:`sequences ` of Unicode code points. String literals are written in a variety of ways:" +#, fuzzy +msgid "" +"Textual data in Python is handled with :class:`str` objects, or " +":dfn:`strings`. Strings are immutable :ref:`sequences ` of Unicode" +" code points. String literals are written in a variety of ways:" msgstr "" +"داده های متنی در پایتون با اشیاء :class:`str` یا :dfn:`strings` مدیریت می " +"شود. رشته ها :ref:`sequences ` تغییرناپذیر نقاط کد یونیکد هستند. " +"لفظ رشته ای به روش های مختلفی نوشته می شود:" #: library/stdtypes.rst:1519 +#, fuzzy msgid "Single quotes: ``'allows embedded \"double\" quotes'``" -msgstr "" +msgstr "نقل قول تک: ``'allows embedded \"double\" quotes'``" #: library/stdtypes.rst:1520 +#, fuzzy msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" -msgstr "" +msgstr "دو نقل قول: ``\"allows embedded 'single' quotes\"``" #: library/stdtypes.rst:1521 +#, fuzzy msgid "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double quotes\"\"\"``" msgstr "" +"نقل قول سه گانه: ``'''Three single quotes'''``، ``\"\"\"Three double " +"quotes\"\"\"``" #: library/stdtypes.rst:1523 -msgid "Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal." +#, fuzzy +msgid "" +"Triple quoted strings may span multiple lines - all associated whitespace " +"will be included in the string literal." msgstr "" +"رشته‌های نقل‌قول‌شده سه‌گانه ممکن است چندین خط را دربر گیرند - تمام فضای " +"خالی مرتبط در رشته تحت اللفظی گنجانده می‌شود." #: library/stdtypes.rst:1526 -msgid "String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." +#, fuzzy +msgid "" +"String literals that are part of a single expression and have only " +"whitespace between them will be implicitly converted to a single string " +"literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" +"حروف رشته ای که بخشی از یک عبارت واحد هستند و فقط فضای خالی بین آنها وجود " +"دارد به طور ضمنی به یک رشته واحد تبدیل می شوند. یعنی ``(\"spam \" \"eggs\") " +"== \"spam eggs\"``." #: library/stdtypes.rst:1530 -msgid "See :ref:`strings` for more about the various forms of string literal, including supported :ref:`escape sequences `, and the ``r`` (\"raw\") prefix that disables most escape sequence processing." +#, fuzzy +msgid "" +"See :ref:`strings` for more about the various forms of string literal, " +"including supported :ref:`escape sequences `, and the " +"``r`` (\"raw\") prefix that disables most escape sequence processing." msgstr "" +"برای اطلاعات بیشتر در مورد اشکال مختلف رشته تحت اللفظی، از جمله :ref:`escape" +" sequences ` پشتیبانی شده و پیشوند ``r`` (\"خام\") که اکثر" +" پردازش دنباله فرار را غیرفعال می کند، به :ref:`strings` مراجعه کنید." #: library/stdtypes.rst:1534 -msgid "Strings may also be created from other objects using the :class:`str` constructor." +#, fuzzy +msgid "" +"Strings may also be created from other objects using the :class:`str` " +"constructor." msgstr "" +"رشته ها همچنین ممکن است از اشیاء دیگر با استفاده از سازنده :class:`str` " +"ایجاد شوند." #: library/stdtypes.rst:1537 -msgid "Since there is no separate \"character\" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." +#, fuzzy +msgid "" +"Since there is no separate \"character\" type, indexing a string produces " +"strings of length 1. That is, for a non-empty string *s*, ``s[0] == " +"s[0:1]``." msgstr "" +"از آنجایی که هیچ نوع \"کاراکتر\" جداگانه ای وجود ندارد، نمایه سازی یک رشته " +"رشته هایی به طول 1 تولید می کند. یعنی برای یک رشته غیر خالی *s*، ``s[0] == " +"s[0:1]``." #: library/stdtypes.rst:1543 -msgid "There is also no mutable string type, but :meth:`str.join` or :class:`io.StringIO` can be used to efficiently construct strings from multiple fragments." +#, fuzzy +msgid "" +"There is also no mutable string type, but :meth:`str.join` or " +":class:`io.StringIO` can be used to efficiently construct strings from " +"multiple fragments." msgstr "" +"همچنین هیچ نوع رشته قابل تغییری وجود ندارد، اما از :meth:`str.join` یا " +":class:`io.StringIO` می توان برای ساخت موثر رشته ها از چند قطعه استفاده کرد." #: library/stdtypes.rst:1547 -msgid "For backwards compatibility with the Python 2 series, the ``u`` prefix is once again permitted on string literals. It has no effect on the meaning of string literals and cannot be combined with the ``r`` prefix." +#, fuzzy +msgid "" +"For backwards compatibility with the Python 2 series, the ``u`` prefix is " +"once again permitted on string literals. It has no effect on the meaning of " +"string literals and cannot be combined with the ``r`` prefix." msgstr "" +"برای سازگاری رو به عقب با سری پایتون 2، پیشوند ``u`` یک بار دیگر در حروف " +"رشته‌ای مجاز است. این هیچ تاثیری بر معنای لفظ رشته ای ندارد و نمی توان آن را" +" با پیشوند ``r`` ترکیب کرد." #: library/stdtypes.rst:1559 -msgid "Return a :ref:`string ` version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is given, as follows." +#, fuzzy +msgid "" +"Return a :ref:`string ` version of *object*. If *object* is not " +"provided, returns the empty string. Otherwise, the behavior of ``str()`` " +"depends on whether *encoding* or *errors* is given, as follows." msgstr "" +"یک نسخه :ref:`string ` از *object* را برگردانید. اگر *object* " +"ارائه نشده باشد، رشته خالی را برمی گرداند. در غیر این صورت، رفتار ``str()``" +" بستگی به این دارد که *encoding* یا *errors* داده شده باشد، به شرح زیر." #: library/stdtypes.rst:1563 -msgid "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:`type(object).__str__(object) `, which is the \"informal\" or nicely printable string representation of *object*. For string objects, this is the string itself. If *object* does not have a :meth:`~object.__str__` method, then :func:`str` falls back to returning :func:`repr(object) `." -msgstr "" +#, fuzzy +msgid "" +"If neither *encoding* nor *errors* is given, ``str(object)`` returns " +":meth:`type(object).__str__(object) `, which is the " +"\"informal\" or nicely printable string representation of *object*. For " +"string objects, this is the string itself. If *object* does not have a " +":meth:`~object.__str__` method, then :func:`str` falls back to returning " +":func:`repr(object) `." +msgstr "" +"اگر نه *encoding* و نه *errors* داده شود، ``str(object)`` " +":meth:`type(object).__str__(object) ` را برمی گرداند، که " +"نمایش رشته \"غیررسمی\" یا قابل چاپ زیبای *object* است. برای اشیاء رشته، این" +" خود رشته است. اگر *object* روش :meth:`~object.__str__` ندارد، :func:`str` " +"به :func:`repr(object) ` برمی‌گردد." #: library/stdtypes.rst:1575 -msgid "If at least one of *encoding* or *errors* is given, *object* should be a :term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object, then ``str(bytes, encoding, errors)`` is equivalent to :meth:`bytes.decode(encoding, errors) `. Otherwise, the bytes object underlying the buffer object is obtained before calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on buffer objects." -msgstr "" +#, fuzzy +msgid "" +"If at least one of *encoding* or *errors* is given, *object* should be a " +":term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " +"this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object, " +"then ``str(bytes, encoding, errors)`` is equivalent to " +":meth:`bytes.decode(encoding, errors) `. Otherwise, the bytes" +" object underlying the buffer object is obtained before calling " +":meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for " +"information on buffer objects." +msgstr "" +"اگر حداقل یکی از *encoding* یا *errors* داده شده باشد، *object* باید " +":term:`bytes-like object` باشد (به عنوان مثال :class:`bytes` یا " +":class:`bytearray`). در این مورد، اگر *object* یک شی :class:`bytes` (یا " +":class:`bytearray`) باشد، ``str(bytes, encoding, errors)`` معادل " +":meth:`bytes.decode(encoding, errors) ` است. در غیر این صورت،" +" شی بایتی که در زیر شی بافر قرار دارد، قبل از فراخوانی :meth:`bytes.decode` " +"به دست می آید. برای اطلاعات در مورد اشیاء بافر به :ref:`binaryseq` و " +":ref:`bufferobjects` مراجعه کنید." #: library/stdtypes.rst:1584 -msgid "Passing a :class:`bytes` object to :func:`str` without the *encoding* or *errors* arguments falls under the first case of returning the informal string representation (see also the :option:`-b` command-line option to Python). For example::" +#, fuzzy +msgid "" +"Passing a :class:`bytes` object to :func:`str` without the *encoding* or " +"*errors* arguments falls under the first case of returning the informal " +"string representation (see also the :option:`-b` command-line option to " +"Python). For example::" msgstr "" +"ارسال یک شی :class:`bytes` به :func:`str` بدون آرگومان های *encoding* یا " +"*errors* تحت اولین مورد بازگرداندن نمایش رشته غیررسمی قرار می گیرد (همچنین " +"به گزینه خط فرمان :option:`-b` به پایتون مراجعه کنید). به عنوان مثال::" #: library/stdtypes.rst:1589 -msgid ">>> str(b'Zoot!')\n" +#, fuzzy +msgid "" +">>> str(b'Zoot!')\n" "\"b'Zoot!'\"" msgstr "" +">>> str(b'Zoot!')\n" +"\"b'Zoot!'\"" #: library/stdtypes.rst:1592 -msgid "For more information on the ``str`` class and its methods, see :ref:`textseq` and the :ref:`string-methods` section below. To output formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In addition, see the :ref:`stringservices` section." -msgstr "" +#, fuzzy +msgid "" +"For more information on the ``str`` class and its methods, see " +":ref:`textseq` and the :ref:`string-methods` section below. To output " +"formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` " +"sections. In addition, see the :ref:`stringservices` section." +msgstr "" +"هنگام قالب‌بندی یک عدد (:class:`int`, :class:`float`, :class:`complex`, " +":class:`decimal.Decimal` و کلاس‌های فرعی) با نوع ``n`` (مثلاً: " +"``'{:n}'.format(1234)``)، این تابع به‌طور موقت محلی ``LC_CTYPE`` را به محلی " +"``LC_NUMERIC`` تنظیم می‌کند تا فیلدهای ``decimal_point`` و ``thousands_sep``" +" مربوط به :c:func:`localeconv`، در صورتی که غیر ASCII باشند یا بیشتر از 1 " +"بایت طول داشته باشند، رمزگشایی شوند، به شرطی که محلی ``LC_NUMERIC`` با محلی " +"``LC_CTYPE`` متفاوت باشد. این تغییر موقت بر سایر رشته‌ها تأثیر می‌گذارد" #: library/stdtypes.rst:1604 +#, fuzzy msgid "String Methods" -msgstr "" +msgstr "روش های رشته ای" #: library/stdtypes.rst:1609 -msgid "Strings implement all of the :ref:`common ` sequence operations, along with the additional methods described below." +#, fuzzy +msgid "" +"Strings implement all of the :ref:`common ` sequence " +"operations, along with the additional methods described below." msgstr "" +"رشته ها تمام عملیات توالی :ref:`common ` را به همراه روش " +"های اضافی که در زیر توضیح داده شده است، اجرا می کنند." #: library/stdtypes.rst:1612 -msgid "Strings also support two styles of string formatting, one providing a large degree of flexibility and customization (see :meth:`str.format`, :ref:`formatstrings` and :ref:`string-formatting`) and the other based on C ``printf`` style formatting that handles a narrower range of types and is slightly harder to use correctly, but is often faster for the cases it can handle (:ref:`old-string-formatting`)." -msgstr "" +#, fuzzy +msgid "" +"Strings also support two styles of string formatting, one providing a large " +"degree of flexibility and customization (see :meth:`str.format`, " +":ref:`formatstrings` and :ref:`string-formatting`) and the other based on C " +"``printf`` style formatting that handles a narrower range of types and is " +"slightly harder to use correctly, but is often faster for the cases it can " +"handle (:ref:`old-string-formatting`)." +msgstr "" +"رشته‌ها همچنین از دو سبک قالب‌بندی رشته پشتیبانی می‌کنند، یکی انعطاف‌پذیری و" +" سفارشی‌سازی زیادی را ارائه می‌کند (به :meth:`str.format`, " +":ref:`formatstrings` و :ref:`string-formatting` مراجعه کنید) و دیگری مبتنی " +"بر قالب‌بندی سبک C ``printf`` است که طیف باریک‌تری از انواع را مدیریت می‌کند" +" و استفاده صحیح کمی سخت‌تر است، اما اغلب برای مواردی که می‌تواند کار کند، " +"سریع‌تر است (:ref:`old-string-formatting`)." #: library/stdtypes.rst:1619 -msgid "The :ref:`textservices` section of the standard library covers a number of other modules that provide various text related utilities (including regular expression support in the :mod:`re` module)." +#, fuzzy +msgid "" +"The :ref:`textservices` section of the standard library covers a number of " +"other modules that provide various text related utilities (including regular" +" expression support in the :mod:`re` module)." msgstr "" +"بخش :ref:`textservices` کتابخانه استاندارد تعدادی ماژول دیگر را پوشش می دهد " +"که ابزارهای مختلف مرتبط با متن را ارائه می دهند (از جمله پشتیبانی از عبارت " +"منظم در ماژول :mod:`re`)." #: library/stdtypes.rst:1625 -msgid "Return a copy of the string with its first character capitalized and the rest lowercased." +#, fuzzy +msgid "" +"Return a copy of the string with its first character capitalized and the " +"rest lowercased." msgstr "" +"یک کپی از رشته را با کاراکتر اول آن با حروف بزرگ و بقیه با حروف کوچک " +"برگردانید." #: library/stdtypes.rst:1628 -msgid "The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first letter capitalized, instead of the full character." +#, fuzzy +msgid "" +"The first character is now put into titlecase rather than uppercase. This " +"means that characters like digraphs will only have their first letter " +"capitalized, instead of the full character." msgstr "" +"کاراکتر اول در حال حاضر به جای حروف بزرگ به حروف عنوان اضافه می شود. این " +"بدان معنی است که کاراکترهایی مانند دیگراف به جای کاراکتر کامل، فقط حرف اول " +"خود را بزرگ می کنند." #: library/stdtypes.rst:1635 -msgid "Return a casefolded copy of the string. Casefolded strings may be used for caseless matching." +#, fuzzy +msgid "" +"Return a casefolded copy of the string. Casefolded strings may be used for " +"caseless matching." msgstr "" +"یک کپی تا شده از رشته را برگردانید. رشته های جعبه دار ممکن است برای تطبیق " +"بدون کیس استفاده شوند." #: library/stdtypes.rst:1638 -msgid "Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter ``'ß'`` is equivalent to ``\"ss\"``. Since it is already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold` converts it to ``\"ss\"``." -msgstr "" +#, fuzzy +msgid "" +"Casefolding is similar to lowercasing but more aggressive because it is " +"intended to remove all case distinctions in a string. For example, the " +"German lowercase letter ``'ß'`` is equivalent to ``\"ss\"``. Since it is " +"already lowercase, :meth:`lower` would do nothing to ``'ß'``; " +":meth:`casefold` converts it to ``\"ss\"``." +msgstr "" +"Casefolding شبیه به حروف کوچک است اما تهاجمی تر است زیرا در نظر گرفته شده " +"است که تمام تمایزهای حروف را در یک رشته حذف کند. به عنوان مثال، حرف کوچک " +"آلمانی ``'ß'`` معادل ``\"ss\"`` است. از آنجایی که از قبل حروف کوچک است، " +":meth:`lower` هیچ کاری برای ``'ß'`` انجام نمی دهد. :meth:`casefold` آن را به" +" ``\"ss\"`` تبدیل می کند." #: library/stdtypes.rst:1644 -msgid "The casefolding algorithm is `described in section 3.13 'Default Case Folding' of the Unicode Standard `__." +#, fuzzy +msgid "" +"The casefolding algorithm is `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard " +"`__." msgstr "" +"الگوریتم casefolding `described in section 3.13 'Default Case Folding' of " +"the Unicode Standard " +"`__ است." #: library/stdtypes.rst:1653 -msgid "Return centered in a string of length *width*. Padding is done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return centered in a string of length *width*. Padding is done using the " +"specified *fillchar* (default is an ASCII space). The original string is " +"returned if *width* is less than or equal to ``len(s)``." msgstr "" +"برگرداندن در مرکز یک رشته به طول *width*. Padding با استفاده از *fillchar* " +"مشخص شده انجام می شود (پیش فرض یک فضای ASCII است). اگر *width* کمتر یا مساوی" +" با ``len(s)`` باشد، رشته اصلی برگردانده می شود." #: library/stdtypes.rst:1661 -msgid "Return the number of non-overlapping occurrences of substring *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation." +#, fuzzy +msgid "" +"Return the number of non-overlapping occurrences of substring *sub* in the " +"range [*start*, *end*]. Optional arguments *start* and *end* are " +"interpreted as in slice notation." msgstr "" +"تعداد رخدادهای غیر همپوشانی رشته فرعی *sub* را در محدوده [*start*, *end*] " +"برگردانید. آرگومان های اختیاری *start* و *end* به صورت نمادگذاری برش تفسیر " +"می شوند." #: library/stdtypes.rst:1665 -msgid "If *sub* is empty, returns the number of empty strings between characters which is the length of the string plus one." +#, fuzzy +msgid "" +"If *sub* is empty, returns the number of empty strings between characters " +"which is the length of the string plus one." msgstr "" +"اگر *sub* خالی باشد، تعداد رشته های خالی بین کاراکترها را برمی گرداند که طول" +" رشته به اضافه یک است." #: library/stdtypes.rst:1671 +#, fuzzy msgid "Return the string encoded to :class:`bytes`." -msgstr "" +msgstr "رشته کد شده به :class:`bytes` را برگردانید." -#: library/stdtypes.rst:1673 -#: library/stdtypes.rst:2824 -msgid "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values." +#: library/stdtypes.rst:1673 library/stdtypes.rst:2824 +#, fuzzy +msgid "" +"*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " +"possible values." msgstr "" +"*encoding* به طور پیش فرض روی ``'utf-8'`` است. برای مقادیر ممکن به " +":ref:`standard-encodings` مراجعه کنید." #: library/stdtypes.rst:1676 -msgid "*errors* controls how encoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details." -msgstr "" +#, fuzzy +msgid "" +"*errors* controls how encoding errors are handled. If ``'strict'`` (the " +"default), a :exc:`UnicodeError` exception is raised. Other possible values " +"are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, " +"``'backslashreplace'`` and any other name registered via " +":func:`codecs.register_error`. See :ref:`error-handlers` for details." +msgstr "" +"*errors* نحوه رسیدگی به خطاهای کدگذاری را کنترل می کند. اگر ``'strict'`` " +"(پیش فرض), یک استثنا :exc:`UnicodeError` مطرح می شود. مقادیر احتمالی دیگر " +"``'ignore'``، ``'replace'``، ``'xmlcharrefreplace'``، ``'backslashreplace'``" +" و هر نام دیگری ثبت شده از طریق :func:`codecs.register_error` هستند. برای " +"جزئیات بیشتر به :ref:`error-handlers` مراجعه کنید." #: library/stdtypes.rst:1683 -msgid "For performance reasons, the value of *errors* is not checked for validity unless an encoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build ` is used." +#, fuzzy +msgid "" +"For performance reasons, the value of *errors* is not checked for validity " +"unless an encoding error actually occurs, :ref:`devmode` is enabled or a " +":ref:`debug build ` is used." msgstr "" +"به دلایل عملکرد، مقدار *errors* از نظر اعتبار بررسی نمی شود، مگر اینکه " +"واقعاً یک خطای رمزگذاری رخ دهد، :ref:`devmode` فعال شود یا از :ref:`debug " +"build ` استفاده شود." -#: library/stdtypes.rst:1688 -#: library/stdtypes.rst:2843 +#: library/stdtypes.rst:1688 library/stdtypes.rst:2843 +#, fuzzy msgid "Added support for keyword arguments." -msgstr "" +msgstr "پشتیبانی از آرگومان های کلمه کلیدی اضافه شده است." -#: library/stdtypes.rst:1691 -#: library/stdtypes.rst:2846 -msgid "The value of the *errors* argument is now checked in :ref:`devmode` and in :ref:`debug mode `." +#: library/stdtypes.rst:1691 library/stdtypes.rst:2846 +#, fuzzy +msgid "" +"The value of the *errors* argument is now checked in :ref:`devmode` and in " +":ref:`debug mode `." msgstr "" +"مقدار آرگومان *errors* اکنون در :ref:`devmode` و در :ref:`debug mode ` بررسی می شود." #: library/stdtypes.rst:1698 -msgid "Return ``True`` if the string ends with the specified *suffix*, otherwise return ``False``. *suffix* can also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position." +#, fuzzy +msgid "" +"Return ``True`` if the string ends with the specified *suffix*, otherwise " +"return ``False``. *suffix* can also be a tuple of suffixes to look for. " +"With optional *start*, test beginning at that position. With optional " +"*end*, stop comparing at that position." msgstr "" +"اگر رشته به *suffix* مشخص شده ختم شود، ``True`` را برگردانید، در غیر این " +"صورت ``False`` را برگردانید. *suffix* همچنین می تواند چندین پسوند باشد که " +"باید به دنبال آن باشید. با *start* اختیاری، آزمایش را از همان موقعیت شروع " +"کنید. با *end* اختیاری، مقایسه را در آن موقعیت متوقف کنید." #: library/stdtypes.rst:1706 -msgid "Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* characters (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the string, the current column is set to zero and the string is examined character by character. If the character is a tab (``\\t``), one or more space characters are inserted in the result until the current column is equal to the next tab position. (The tab character itself is not copied.) If the character is a newline (``\\n``) or return (``\\r``), it is copied and the current column is reset to zero. Any other character is copied unchanged and the current column is incremented by one regardless of how the character is represented when printed." -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the string where all tab characters are replaced by one or " +"more spaces, depending on the current column and the given tab size. Tab " +"positions occur every *tabsize* characters (default is 8, giving tab " +"positions at columns 0, 8, 16 and so on). To expand the string, the current" +" column is set to zero and the string is examined character by character. " +"If the character is a tab (``\\t``), one or more space characters are " +"inserted in the result until the current column is equal to the next tab " +"position. (The tab character itself is not copied.) If the character is a " +"newline (``\\n``) or return (``\\r``), it is copied and the current column " +"is reset to zero. Any other character is copied unchanged and the current " +"column is incremented by one regardless of how the character is represented " +"when printed." +msgstr "" +"یک کپی از رشته را برگردانید که در آن همه کاراکترهای برگه با یک یا چند فاصله،" +" بسته به ستون فعلی و اندازه برگه داده شده، جایگزین می شوند. موقعیت‌های " +"برگه‌ها در هر نویسه *tabsize* رخ می‌دهند (پیش‌فرض 8 است که موقعیت‌های تب را " +"در ستون‌های 0, 8, 16 و غیره می‌دهد). برای گسترش رشته، ستون فعلی صفر می شود " +"و رشته کاراکتر به کاراکتر بررسی می شود. اگر کاراکتر یک زبانه باشد " +"(``\\t``), یک یا چند کاراکتر فاصله در نتیجه درج می شود تا زمانی که ستون فعلی" +" با موقعیت زبانه بعدی برابر شود. (خود کاراکتر برگه کپی نشده است.) اگر " +"کاراکتر یک خط جدید (``\\n``) یا بازگشتی (``\\r``) باشد، کپی می شود و ستون " +"فعلی به صفر بازنشانی می شود. هر کاراکتر دیگری بدون تغییر کپی می‌شود و ستون " +"فعلی یک عدد افزایش می‌یابد، صرفنظر از نحوه نمایش نویسه هنگام چاپ." #: library/stdtypes.rst:1727 -msgid "Return the lowest index in the string where substring *sub* is found within the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found." +#, fuzzy +msgid "" +"Return the lowest index in the string where substring *sub* is found within " +"the slice ``s[start:end]``. Optional arguments *start* and *end* are " +"interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" +"کمترین شاخص را در رشته ای که زیر رشته *sub* در برش ``s[start:end]`` یافت می " +"شود، برگردانید. آرگومان های اختیاری *start* و *end* به صورت نمادگذاری برش " +"تفسیر می شوند. اگر *sub* یافت نشد، ``-1`` را برگردانید." #: library/stdtypes.rst:1733 -msgid "The :meth:`~str.find` method should be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::" +#, fuzzy +msgid "" +"The :meth:`~str.find` method should be used only if you need to know the " +"position of *sub*. To check if *sub* is a substring or not, use the " +":keyword:`in` operator::" msgstr "" +"روش :meth:`~str.find` فقط در صورتی باید استفاده شود که باید موقعیت *sub* را " +"بدانید. برای بررسی اینکه آیا *sub* یک رشته فرعی است یا نه، از عملگر " +":keyword:`in` استفاده کنید:" #: library/stdtypes.rst:1737 -msgid ">>> 'Py' in 'Python'\n" +#, fuzzy +msgid "" +">>> 'Py' in 'Python'\n" "True" msgstr "" +">>> 'Py' in 'Python'\n" +"True" #: library/stdtypes.rst:1743 -msgid "Perform a string formatting operation. The string on which this method is called can contain literal text or replacement fields delimited by braces ``{}``. Each replacement field contains either the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of the string where each replacement field is replaced with the string value of the corresponding argument." -msgstr "" +#, fuzzy +msgid "" +"Perform a string formatting operation. The string on which this method is " +"called can contain literal text or replacement fields delimited by braces " +"``{}``. Each replacement field contains either the numeric index of a " +"positional argument, or the name of a keyword argument. Returns a copy of " +"the string where each replacement field is replaced with the string value of" +" the corresponding argument." +msgstr "" +"عملیات قالب بندی رشته را انجام دهید. رشته ای که این متد بر روی آن فراخوانی " +"می شود می تواند حاوی متن تحت اللفظی یا فیلدهای جایگزین باشد که با پرانتزهای " +"``{}`` محدود شده اند. هر فیلد جایگزین شامل یا شاخص عددی یک آرگومان موقعیتی " +"یا نام یک آرگومان کلمه کلیدی است. یک کپی از رشته را برمی‌گرداند که در آن هر" +" فیلد جایگزین با مقدار رشته آرگومان مربوطه جایگزین می‌شود." #: library/stdtypes.rst:1753 -msgid "See :ref:`formatstrings` for a description of the various formatting options that can be specified in format strings." +#, fuzzy +msgid "" +"See :ref:`formatstrings` for a description of the various formatting options" +" that can be specified in format strings." msgstr "" +"برای توضیح گزینه‌های قالب‌بندی مختلف که می‌توانند در رشته‌های قالب مشخص " +"شوند، به :ref:`formatstrings` مراجعه کنید." #: library/stdtypes.rst:1757 -msgid "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode ``decimal_point`` and ``thousands_sep`` fields of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This temporary change affects other threads." -msgstr "" +#, fuzzy +msgid "" +"When formatting a number (:class:`int`, :class:`float`, :class:`complex`, " +":class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: " +"``'{:n}'.format(1234)``), the function temporarily sets the ``LC_CTYPE`` " +"locale to the ``LC_NUMERIC`` locale to decode ``decimal_point`` and " +"``thousands_sep`` fields of :c:func:`localeconv` if they are non-ASCII or " +"longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the " +"``LC_CTYPE`` locale. This temporary change affects other threads." +msgstr "" +"هنگام قالب‌بندی یک عدد (:class:`int`, :class:`float`, :class:`complex`, " +":class:`decimal.Decimal` و کلاس‌های فرعی) با نوع ``n`` (مثلاً: " +"``'{:n}'.format(1234)``)، این تابع به‌طور موقت محلی ``LC_CTYPE`` را به محلی " +"``LC_NUMERIC`` تنظیم می‌کند تا فیلدهای ``decimal_point`` و ``thousands_sep``" +" مربوط به :c:func:`localeconv`، در صورتی که غیر ASCII باشند یا بیشتر از 1 " +"بایت طول داشته باشند، رمزگشایی شوند، به شرطی که محلی ``LC_NUMERIC`` با محلی " +"``LC_CTYPE`` متفاوت باشد. این تغییر موقت بر سایر رشته‌ها تأثیر می‌گذارد" #: library/stdtypes.rst:1766 -msgid "When formatting a number with the ``n`` type, the function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." +#, fuzzy +msgid "" +"When formatting a number with the ``n`` type, the function sets temporarily " +"the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" +"هنگام قالب بندی یک عدد با نوع ``n``، این تابع در برخی موارد به طور موقت محلی" +" ``LC_CTYPE`` را به محلی ``LC_NUMERIC`` تنظیم می کند." #: library/stdtypes.rst:1774 -msgid "Similar to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:" +#, fuzzy +msgid "" +"Similar to ``str.format(**mapping)``, except that ``mapping`` is used " +"directly and not copied to a :class:`dict`. This is useful if for example " +"``mapping`` is a dict subclass:" msgstr "" +"مشابه ``str.format(**mapping)``، با این تفاوت که ``mapping`` مستقیما استفاده" +" می شود و در :class:`dict` کپی نمی شود. اگر برای مثال ``mapping`` یک زیر " +"کلاس dict باشد، این مفید است:" #: library/stdtypes.rst:1790 -msgid "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is not found." +#, fuzzy +msgid "" +"Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " +"not found." msgstr "" +"مانند :meth:`~str.find`، اما وقتی رشته فرعی پیدا نشد، :exc:`ValueError` را " +"بالا ببرید." #: library/stdtypes.rst:1796 -msgid "Return ``True`` if all characters in the string are alphanumeric and there is at least one character, ``False`` otherwise. A character ``c`` is alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." +#, fuzzy +msgid "" +"Return ``True`` if all characters in the string are alphanumeric and there " +"is at least one character, ``False`` otherwise. A character ``c`` is " +"alphanumeric if one of the following returns ``True``: ``c.isalpha()``, " +"``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" +"اگر همه کاراکترهای رشته حروف عددی هستند و حداقل یک کاراکتر وجود دارد، " +"``True`` را برگردانید، در غیر این صورت ``False`` را برگردانید. یک کاراکتر " +"``c`` الفبایی است اگر یکی از موارد زیر ``True`` را برگرداند: " +"``c.isalpha()``، ``c.isdecimal()``، ``c.isdigit()``، یا ``c.isnumeric()``." #: library/stdtypes.rst:1804 -msgid "Return ``True`` if all characters in the string are alphabetic and there is at least one character, ``False`` otherwise. Alphabetic characters are those characters defined in the Unicode character database as \"Letter\", i.e., those with general category property being one of \"Lm\", \"Lt\", \"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' of the Unicode Standard `_." -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if all characters in the string are alphabetic and there is " +"at least one character, ``False`` otherwise. Alphabetic characters are " +"those characters defined in the Unicode character database as \"Letter\", " +"i.e., those with general category property being one of \"Lm\", \"Lt\", " +"\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic" +" property defined in the section 4.10 'Letters, Alphabetic, and Ideographic'" +" of the Unicode Standard " +"`_." +msgstr "" +"اگر همه کاراکترهای رشته حروف الفبا هستند و حداقل یک کاراکتر وجود دارد، " +"``True`` را برگردانید، در غیر این صورت ``False`` را برگردانید. کاراکترهای " +"الفبایی آن دسته از کاراکترهایی هستند که در پایگاه داده کاراکترهای یونیکد به " +"عنوان \"حرف\" تعریف می شوند، یعنی آنهایی که دارای ویژگی دسته بندی عمومی " +"هستند یکی از \"Lm\"، \"Lt\"، \"Lu\"، \"Ll\" یا \"Lo\" هستند. توجه داشته " +"باشید که این با `Alphabetic property defined in the section 4.10 'Letters, " +"Alphabetic, and Ideographic' of the Unicode Standard " +"`_ متفاوت است." #: library/stdtypes.rst:1815 -msgid "Return ``True`` if the string is empty or all characters in the string are ASCII, ``False`` otherwise. ASCII characters have code points in the range U+0000-U+007F." +#, fuzzy +msgid "" +"Return ``True`` if the string is empty or all characters in the string are " +"ASCII, ``False`` otherwise. ASCII characters have code points in the range " +"U+0000-U+007F." msgstr "" +"اگر رشته خالی است یا تمام کاراکترهای رشته ASCII هستند، ``True`` را " +"برگردانید، در غیر این صورت ``False``. کاراکترهای اسکی دارای نقاط کد در " +"محدوده U+0000-U+007F هستند." #: library/stdtypes.rst:1824 -msgid "Return ``True`` if all characters in the string are decimal characters and there is at least one character, ``False`` otherwise. Decimal characters are those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a character in the Unicode General Category \"Nd\"." -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if all characters in the string are decimal characters and " +"there is at least one character, ``False`` otherwise. Decimal characters are" +" those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-" +"INDIC DIGIT ZERO. Formally a decimal character is a character in the " +"Unicode General Category \"Nd\"." +msgstr "" +"اگر همه کاراکترهای رشته اعشاری هستند و حداقل یک کاراکتر وجود دارد، ``True`` " +"را برگردانید، در غیر این صورت ``False``. کاراکترهای اعشاری آنهایی هستند که " +"می توان از آنها برای تشکیل اعداد در پایه 10 استفاده کرد، به عنوان مثال. " +"U+0660، رقم عربی- هندی صفر. به طور رسمی یک کاراکتر اعشاری یک کاراکتر در رده" +" عمومی یونیکد \"Nd\" است." #: library/stdtypes.rst:1834 -msgid "Return ``True`` if all characters in the string are digits and there is at least one character, ``False`` otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, like the Kharosthi numbers. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal." -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if all characters in the string are digits and there is at " +"least one character, ``False`` otherwise. Digits include decimal characters" +" and digits that need special handling, such as the compatibility " +"superscript digits. This covers digits which cannot be used to form numbers " +"in base 10, like the Kharosthi numbers. Formally, a digit is a character " +"that has the property value Numeric_Type=Digit or Numeric_Type=Decimal." +msgstr "" +"اگر همه کاراکترهای رشته رقمی هستند و حداقل یک کاراکتر وجود دارد، ``True`` را" +" برگردانید، در غیر این صورت ``False`` را برگردانید. ارقام شامل کاراکترهای " +"اعشاری و ارقامی هستند که نیاز به رسیدگی خاصی دارند، مانند ارقام فوق‌نویس " +"سازگاری. این شامل ارقامی است که نمی توان از آنها برای تشکیل اعداد در پایه 10" +" استفاده کرد، مانند اعداد خاروستی. به طور رسمی، یک رقم، کاراکتری است که " +"دارای مقدار ویژگی Numeric_Type=Digit یا Numeric_Type=Decimal است." #: library/stdtypes.rst:1844 -msgid "Return ``True`` if the string is a valid identifier according to the language definition, section :ref:`identifiers`." +#, fuzzy +msgid "" +"Return ``True`` if the string is a valid identifier according to the " +"language definition, section :ref:`identifiers`." msgstr "" +"اگر رشته طبق تعریف زبان، بخش :ref:`identifiers` یک شناسه معتبر است، ``True``" +" را برگردانید." #: library/stdtypes.rst:1847 -msgid ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved identifier, such as :keyword:`def` and :keyword:`class`." +#, fuzzy +msgid "" +":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " +"reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" +"از :func:`keyword.iskeyword` می توان برای آزمایش اینکه آیا رشته ``s`` یک " +"شناسه رزرو شده است، مانند :keyword:`def` و :keyword:`class` استفاده کرد." #: library/stdtypes.rst:1850 +#, fuzzy msgid "Example: ::" -msgstr "" +msgstr "مثال: ::" #: library/stdtypes.rst:1853 -msgid ">>> from keyword import iskeyword\n" +#, fuzzy +msgid "" +">>> from keyword import iskeyword\n" "\n" ">>> 'hello'.isidentifier(), iskeyword('hello')\n" "(True, False)\n" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" msgstr "" +">>> from keyword import iskeyword\n" +"\n" +">>> 'hello'.isidentifier(), iskeyword('hello')\n" +"(True, False)\n" +">>> 'def'.isidentifier(), iskeyword('def')\n" +"(True, True)" #: library/stdtypes.rst:1863 -msgid "Return ``True`` if all cased characters [4]_ in the string are lowercase and there is at least one cased character, ``False`` otherwise." +#, fuzzy +msgid "" +"Return ``True`` if all cased characters [4]_ in the string are lowercase and" +" there is at least one cased character, ``False`` otherwise." msgstr "" +"اگر همه کاراکترهای با حروف [4]_ در رشته کوچک هستند و حداقل یک کاراکتر با " +"حروف کوچک وجود دارد، ``True`` را برگردانید، در غیر این صورت ``False``." #: library/stdtypes.rst:1869 -msgid "Return ``True`` if all characters in the string are numeric characters, and there is at least one character, ``False`` otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric." -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if all characters in the string are numeric characters, and " +"there is at least one character, ``False`` otherwise. Numeric characters " +"include digit characters, and all characters that have the Unicode numeric " +"value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric " +"characters are those with the property value Numeric_Type=Digit, " +"Numeric_Type=Decimal or Numeric_Type=Numeric." +msgstr "" +"اگر همه کاراکترهای رشته دارای کاراکترهای عددی هستند و حداقل یک کاراکتر وجود " +"دارد، ``True`` را برگردانید، در غیر این صورت ``False``. کاراکترهای عددی شامل" +" کاراکترهای رقمی هستند و همه کاراکترهایی که دارای خاصیت مقدار عددی یونیکد " +"هستند، به عنوان مثال. U+2155، کسری مبتذل یک پنجم. به طور رسمی، کاراکترهای " +"عددی آنهایی هستند که دارای مقدار ویژگی Numeric_Type=رقم، Numeric_Type=اعشاری" +" یا Numeric_Type=Numeric هستند." #: library/stdtypes.rst:1879 -msgid "Return ``True`` if all characters in the string are printable or the string is empty, ``False`` otherwise. Nonprintable characters are those characters defined in the Unicode character database as \"Other\" or \"Separator\", excepting the ASCII space (0x20) which is considered printable. (Note that printable characters in this context are those which should not be escaped when :func:`repr` is invoked on a string. It has no bearing on the handling of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if all characters in the string are printable or the string " +"is empty, ``False`` otherwise. Nonprintable characters are those characters" +" defined in the Unicode character database as \"Other\" or \"Separator\", " +"excepting the ASCII space (0x20) which is considered printable. (Note that " +"printable characters in this context are those which should not be escaped " +"when :func:`repr` is invoked on a string. It has no bearing on the handling" +" of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" +msgstr "" +"اگر تمام کاراکترهای رشته قابل چاپ هستند یا رشته خالی است، ``True`` را " +"برگردانید، در غیر این صورت ``False`` را برگردانید. کاراکترهای غیرقابل چاپ " +"آن دسته از کاراکترهایی هستند که در پایگاه داده کاراکترهای یونیکد به عنوان " +"\"سایر\" یا \"جداکننده\" تعریف شده اند، به جز فضای ASCII (0x20) که قابل چاپ " +"در نظر گرفته می شود. (توجه داشته باشید که کاراکترهای قابل چاپ در این زمینه " +"آنهایی هستند که هنگام فراخوانی :func:`repr` روی یک رشته نباید از آنها فرار " +"کرد. این کاراکتر هیچ ارتباطی با مدیریت رشته های نوشته شده به " +":data:`sys.stdout` یا :data:`sys.stderr` ندارد.)" #: library/stdtypes.rst:1890 -msgid "Return ``True`` if there are only whitespace characters in the string and there is at least one character, ``False`` otherwise." +#, fuzzy +msgid "" +"Return ``True`` if there are only whitespace characters in the string and " +"there is at least one character, ``False`` otherwise." msgstr "" +"اگر فقط کاراکترهای فضای خالی در رشته وجود دارد و حداقل یک کاراکتر وجود دارد،" +" ``True`` را برگردانید، در غیر این صورت ``False``." #: library/stdtypes.rst:1893 -msgid "A character is *whitespace* if in the Unicode character database (see :mod:`unicodedata`), either its general category is ``Zs`` (\"Separator, space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." +#, fuzzy +msgid "" +"A character is *whitespace* if in the Unicode character database (see " +":mod:`unicodedata`), either its general category is ``Zs`` (\"Separator, " +"space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" +"یک کاراکتر اگر در پایگاه داده کاراکترهای یونیکد (به :mod:`unicodedata` " +"مراجعه کنید), یا دسته کلی آن ``Zs`` («جداکننده, فاصله») باشد، یا کلاس دوطرفه" +" آن یکی از ``WS``، ``B`` یا ``S`` باشد، *whitespace* است." #: library/stdtypes.rst:1901 -msgid "Return ``True`` if the string is a titlecased string and there is at least one character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return ``False`` otherwise." +#, fuzzy +msgid "" +"Return ``True`` if the string is a titlecased string and there is at least " +"one character, for example uppercase characters may only follow uncased " +"characters and lowercase characters only cased ones. Return ``False`` " +"otherwise." msgstr "" +"اگر رشته یک رشته با حروف عنوان است و حداقل یک کاراکتر وجود دارد، ``True`` را" +" برگردانید، به عنوان مثال، کاراکترهای بزرگ ممکن است فقط از کاراکترهای بدون " +"حروف و کاراکترهای کوچک فقط به دنبال کاراکترهای حروف کوچک باشند. در غیر این " +"صورت ``False`` را برگردانید." #: library/stdtypes.rst:1908 -msgid "Return ``True`` if all cased characters [4]_ in the string are uppercase and there is at least one cased character, ``False`` otherwise." +#, fuzzy +msgid "" +"Return ``True`` if all cased characters [4]_ in the string are uppercase and" +" there is at least one cased character, ``False`` otherwise." msgstr "" +"اگر همه کاراکترهای با حروف [4]_ در رشته بزرگ باشند و حداقل یک کاراکتر با " +"حروف وجود داشته باشد، ``True`` را برگردانید، در غیر این صورت ``False``." #: library/stdtypes.rst:1926 -msgid "Return a string which is the concatenation of the strings in *iterable*. A :exc:`TypeError` will be raised if there are any non-string values in *iterable*, including :class:`bytes` objects. The separator between elements is the string providing this method." +#, fuzzy +msgid "" +"Return a string which is the concatenation of the strings in *iterable*. A " +":exc:`TypeError` will be raised if there are any non-string values in " +"*iterable*, including :class:`bytes` objects. The separator between " +"elements is the string providing this method." msgstr "" +"رشته ای را برگردانید که الحاق رشته ها در *iterable* است. اگر مقادیر غیر رشته" +" ای در *iterable* از جمله اشیاء :class:`bytes` وجود داشته باشد، یک " +":exc:`TypeError` بالا می رود. جداکننده بین عناصر رشته ای است که این روش را " +"ارائه می دهد." #: library/stdtypes.rst:1934 -msgid "Return the string left justified in a string of length *width*. Padding is done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return the string left justified in a string of length *width*. Padding is " +"done using the specified *fillchar* (default is an ASCII space). The " +"original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" +"رشته سمت چپ توجیه شده در رشته ای به طول *width* را برگردانید. Padding با " +"استفاده از *fillchar* مشخص شده انجام می شود (پیش فرض یک فضای ASCII است). اگر" +" *width* کمتر یا مساوی با ``len(s)`` باشد، رشته اصلی برگردانده می شود." #: library/stdtypes.rst:1941 -msgid "Return a copy of the string with all the cased characters [4]_ converted to lowercase." -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the string with all the cased characters [4]_ converted to " +"lowercase." +msgstr "یک کپی از رشته را با تمام حروف کوچک [4]_ به حروف کوچک تبدیل کنید." #: library/stdtypes.rst:1944 -msgid "The lowercasing algorithm used is `described in section 3.13 'Default Case Folding' of the Unicode Standard `__." +#, fuzzy +msgid "" +"The lowercasing algorithm used is `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard " +"`__." msgstr "" +"الگوریتم حروف کوچک مورد استفاده `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard " +"`__ است." #: library/stdtypes.rst:1951 -msgid "Return a copy of the string with leading characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped::" +#, fuzzy +msgid "" +"Return a copy of the string with leading characters removed. The *chars* " +"argument is a string specifying the set of characters to be removed. If " +"omitted or ``None``, the *chars* argument defaults to removing whitespace. " +"The *chars* argument is not a prefix; rather, all combinations of its values" +" are stripped::" msgstr "" +"یک کپی از رشته را با نویسه های اصلی حذف شده برگردانید. آرگومان *chars* رشته" +" ای است که مجموعه کاراکترهایی را که باید حذف شوند را مشخص می کند. اگر حذف " +"شود یا ``None``، آرگومان *chars* به طور پیش‌فرض فضای خالی را حذف می‌کند. " +"آرگومان *chars* یک پیشوند نیست. بلکه تمام ترکیبات مقادیر آن حذف می شوند::" #: library/stdtypes.rst:1956 -msgid ">>> ' spacious '.lstrip()\n" +#, fuzzy +msgid "" +">>> ' spacious '.lstrip()\n" "'spacious '\n" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" msgstr "" +">>> ' spacious '.lstrip()\n" +"'spacious '\n" +">>> 'www.example.com'.lstrip('cmowz.')\n" +"'example.com'" #: library/stdtypes.rst:1961 -msgid "See :meth:`str.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::" +#, fuzzy +msgid "" +"See :meth:`str.removeprefix` for a method that will remove a single prefix " +"string rather than all of a set of characters. For example::" msgstr "" +":meth:`str.removeprefix` را برای روشی ببینید که یک رشته پیشوند واحد را به " +"جای همه مجموعه ای از کاراکترها حذف می کند. به عنوان مثال::" #: library/stdtypes.rst:1964 -msgid ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +#, fuzzy +msgid "" +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" msgstr "" +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +"'ee!'\n" +">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" +"'three!'" #: library/stdtypes.rst:1972 -msgid "This static method returns a translation table usable for :meth:`str.translate`." +#, fuzzy +msgid "" +"This static method returns a translation table usable for " +":meth:`str.translate`." msgstr "" +"این روش استاتیک یک جدول ترجمه قابل استفاده برای :meth:`str.translate` را " +"برمی گرداند." #: library/stdtypes.rst:1974 -msgid "If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals." +#, fuzzy +msgid "" +"If there is only one argument, it must be a dictionary mapping Unicode " +"ordinals (integers) or characters (strings of length 1) to Unicode ordinals," +" strings (of arbitrary lengths) or ``None``. Character keys will then be " +"converted to ordinals." msgstr "" +"اگر تنها یک آرگومان وجود داشته باشد، باید یک فرهنگ لغت باشد که ترتیبات " +"یونیکد (اعداد صحیح) یا کاراکترها (رشته های طول 1) را به ترتیبات یونیکد، رشته" +" ها (با طول دلخواه) یا ``None`` نگاشت می کند. سپس کلیدهای کاراکتر به ترتیبی" +" تبدیل می شوند." #: library/stdtypes.rst:1979 -msgid "If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to ``None`` in the result." +#, fuzzy +msgid "" +"If there are two arguments, they must be strings of equal length, and in the" +" resulting dictionary, each character in x will be mapped to the character " +"at the same position in y. If there is a third argument, it must be a " +"string, whose characters will be mapped to ``None`` in the result." msgstr "" +"اگر دو آرگومان وجود داشته باشد، آنها باید رشته هایی با طول مساوی باشند و در " +"فرهنگ لغت حاصل، هر کاراکتر x در همان موقعیت در y به کاراکتر نگاشت می شود. " +"اگر آرگومان سومی وجود داشته باشد، باید رشته ای باشد که کاراکترهای آن در " +"نتیجه به ``None`` نگاشت می شوند." #: library/stdtypes.rst:1987 -msgid "Split the string at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings." +#, fuzzy +msgid "" +"Split the string at the first occurrence of *sep*, and return a 3-tuple " +"containing the part before the separator, the separator itself, and the part" +" after the separator. If the separator is not found, return a 3-tuple " +"containing the string itself, followed by two empty strings." msgstr "" +"رشته را در اولین رخداد *sep* تقسیم کنید و یک 3 تایی حاوی قسمت قبل از " +"جداکننده، خود جداکننده و قسمت بعد از جداکننده را برگردانید. اگر جداکننده " +"پیدا نشد، یک 3 تایی حاوی خود رشته و به دنبال آن دو رشته خالی برگردانید." #: library/stdtypes.rst:1995 -msgid "If the string starts with the *prefix* string, return ``string[len(prefix):]``. Otherwise, return a copy of the original string::" +#, fuzzy +msgid "" +"If the string starts with the *prefix* string, return " +"``string[len(prefix):]``. Otherwise, return a copy of the original string::" msgstr "" +"اگر رشته با رشته *prefix* شروع می شود، ``string[len(prefix):]`` را " +"برگردانید. در غیر این صورت، یک کپی از رشته اصلی را برگردانید::" #: library/stdtypes.rst:1999 -msgid ">>> 'TestHook'.removeprefix('Test')\n" +#, fuzzy +msgid "" +">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" msgstr "" +">>> 'TestHook'.removeprefix('Test')\n" +"'Hook'\n" +">>> 'BaseTestCase'.removeprefix('Test')\n" +"'BaseTestCase'" #: library/stdtypes.rst:2009 -msgid "If the string ends with the *suffix* string and that *suffix* is not empty, return ``string[:-len(suffix)]``. Otherwise, return a copy of the original string::" +#, fuzzy +msgid "" +"If the string ends with the *suffix* string and that *suffix* is not empty, " +"return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " +"string::" msgstr "" +"اگر رشته به رشته *suffix* ختم می شود و *suffix* خالی نیست، " +"``string[:-len(suffix)]`` را برگردانید. در غیر این صورت، یک کپی از رشته اصلی" +" را برگردانید::" #: library/stdtypes.rst:2013 -msgid ">>> 'MiscTests'.removesuffix('Tests')\n" +#, fuzzy +msgid "" +">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" msgstr "" +">>> 'MiscTests'.removesuffix('Tests')\n" +"'Misc'\n" +">>> 'TmpDirMixin'.removesuffix('Tests')\n" +"'TmpDirMixin'" #: library/stdtypes.rst:2023 -msgid "Return a copy of the string with all occurrences of substring *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced." +#, fuzzy +msgid "" +"Return a copy of the string with all occurrences of substring *old* replaced" +" by *new*. If *count* is given, only the first *count* occurrences are " +"replaced. If *count* is not specified or ``-1``, then all occurrences are " +"replaced." msgstr "" +"یک کپی از رشته را با همه موارد زیر رشته *old* به جای *new* برگردانید. اگر " +"*count* داده شود، فقط اولین رخدادهای *count* جایگزین می شوند. اگر *count* یا" +" ``-1`` مشخص نشده باشد، تمام رخدادها جایگزین می شوند." #: library/stdtypes.rst:2027 +#, fuzzy msgid "*count* is now supported as a keyword argument." -msgstr "" +msgstr "*count* اکنون به عنوان آرگومان کلمه کلیدی پشتیبانی می شود." #: library/stdtypes.rst:2033 -msgid "Return the highest index in the string where substring *sub* is found, such that *sub* is contained within ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` on failure." +#, fuzzy +msgid "" +"Return the highest index in the string where substring *sub* is found, such " +"that *sub* is contained within ``s[start:end]``. Optional arguments *start*" +" and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" +"بالاترین شاخص را در رشته ای که زیررشته *sub* یافت می شود، برگردانید، به طوری" +" که *sub* در ``s[start:end]`` قرار دارد. آرگومان های اختیاری *start* و " +"*end* به صورت نمادگذاری برش تفسیر می شوند. ``-1`` را در صورت خرابی " +"برگردانید." #: library/stdtypes.rst:2040 -msgid "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is not found." +#, fuzzy +msgid "" +"Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " +"not found." msgstr "" +"مانند :meth:`rfind` اما زمانی که زیر رشته *sub* یافت نمی شود، " +":exc:`ValueError` را افزایش می دهد." #: library/stdtypes.rst:2046 -msgid "Return the string right justified in a string of length *width*. Padding is done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return the string right justified in a string of length *width*. Padding is " +"done using the specified *fillchar* (default is an ASCII space). The " +"original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" +"رشته ای را که در رشته ای به طول *width* توجیه شده است به سمت راست برگردانید." +" Padding با استفاده از *fillchar* مشخص شده انجام می شود (پیش فرض یک فضای " +"ASCII است). اگر *width* کمتر یا مساوی با ``len(s)`` باشد، رشته اصلی " +"برگردانده می شود." #: library/stdtypes.rst:2053 -msgid "Split the string at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself." +#, fuzzy +msgid "" +"Split the string at the last occurrence of *sep*, and return a 3-tuple " +"containing the part before the separator, the separator itself, and the part" +" after the separator. If the separator is not found, return a 3-tuple " +"containing two empty strings, followed by the string itself." msgstr "" +"رشته را در آخرین رخداد *sep* تقسیم کنید و یک 3 تایی حاوی قسمت قبل از " +"جداکننده، خود جداکننده و قسمت بعد از جداکننده را برگردانید. اگر جداکننده " +"پیدا نشد، یک 3 تایی حاوی دو رشته خالی و به دنبال آن خود رشته برگردانید." #: library/stdtypes.rst:2061 -msgid "Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any whitespace string is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below." -msgstr "" +#, fuzzy +msgid "" +"Return a list of the words in the string, using *sep* as the delimiter " +"string. If *maxsplit* is given, at most *maxsplit* splits are done, the " +"*rightmost* ones. If *sep* is not specified or ``None``, any whitespace " +"string is a separator. Except for splitting from the right, :meth:`rsplit` " +"behaves like :meth:`split` which is described in detail below." +msgstr "" +"فهرستی از کلمات موجود در رشته را با استفاده از *sep* به عنوان رشته جداکننده " +"برگردانید. اگر *maxsplit* داده شود، حداکثر تقسیم *maxsplit* انجام می شود، " +"آنهایی که *rightmost* هستند. اگر *sep* یا ``None`` مشخص نشده باشد، هر رشته " +"فضای خالی یک جداکننده است. به جز تقسیم از راست، :meth:`rsplit` مانند " +":meth:`split` رفتار می کند که در زیر به تفصیل توضیح داده شده است." #: library/stdtypes.rst:2070 -msgid "Return a copy of the string with trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a suffix; rather, all combinations of its values are stripped::" +#, fuzzy +msgid "" +"Return a copy of the string with trailing characters removed. The *chars* " +"argument is a string specifying the set of characters to be removed. If " +"omitted or ``None``, the *chars* argument defaults to removing whitespace. " +"The *chars* argument is not a suffix; rather, all combinations of its values" +" are stripped::" msgstr "" +"یک کپی از رشته با حذف کاراکترهای انتهایی برگردانید. آرگومان *chars* رشته ای" +" است که مجموعه کاراکترهایی را که باید حذف شوند را مشخص می کند. اگر حذف شود " +"یا ``None``، آرگومان *chars* به طور پیش‌فرض فضای خالی را حذف می‌کند. " +"آرگومان *chars* پسوند نیست. بلکه تمام ترکیبات مقادیر آن حذف می شوند::" #: library/stdtypes.rst:2075 -msgid ">>> ' spacious '.rstrip()\n" +#, fuzzy +msgid "" +">>> ' spacious '.rstrip()\n" "' spacious'\n" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" msgstr "" +">>> ' spacious '.rstrip()\n" +"' spacious'\n" +">>> 'mississippi'.rstrip('ipz')\n" +"'mississ'" #: library/stdtypes.rst:2080 -msgid "See :meth:`str.removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::" +#, fuzzy +msgid "" +"See :meth:`str.removesuffix` for a method that will remove a single suffix " +"string rather than all of a set of characters. For example::" msgstr "" +":meth:`str.removesuffix` را برای روشی ببینید که یک رشته پسوند واحد را به جای" +" همه مجموعه ای از کاراکترها حذف می کند. به عنوان مثال::" #: library/stdtypes.rst:2083 -msgid ">>> 'Monty Python'.rstrip(' Python')\n" +#, fuzzy +msgid "" +">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" msgstr "" +">>> 'Monty Python'.rstrip(' Python')\n" +"'M'\n" +">>> 'Monty Python'.removesuffix(' Python')\n" +"'Monty'" #: library/stdtypes.rst:2090 -msgid "Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the number of splits (all possible splits are made)." -msgstr "" +#, fuzzy +msgid "" +"Return a list of the words in the string, using *sep* as the delimiter " +"string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " +"the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not " +"specified or ``-1``, then there is no limit on the number of splits (all " +"possible splits are made)." +msgstr "" +"فهرستی از کلمات موجود در رشته را با استفاده از *sep* به عنوان رشته جداکننده " +"برگردانید. اگر *maxsplit* داده شود، حداکثر تقسیم *maxsplit* انجام می شود " +"(بنابراین, لیست حداکثر دارای عناصر ``maxsplit+1`` خواهد بود). اگر " +"*maxsplit* یا ``-1`` مشخص نشده باشد، محدودیتی در تعداد تقسیم ها وجود ندارد " +"(همه تقسیم های ممکن انجام می شود)." #: library/stdtypes.rst:2096 -msgid "If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns ``['1', '', '2']``). The *sep* argument may consist of multiple characters as a single delimiter (to split with multiple delimiters, use :func:`re.split`). Splitting an empty string with a specified separator returns ``['']``." -msgstr "" - -#: library/stdtypes.rst:2103 -#: library/stdtypes.rst:2121 -#: library/stdtypes.rst:2173 -#: library/stdtypes.rst:2241 -#: library/stdtypes.rst:2309 -#: library/stdtypes.rst:3161 -#: library/stdtypes.rst:3179 -#: library/stdtypes.rst:3270 -#: library/stdtypes.rst:3286 -#: library/stdtypes.rst:3311 -#: library/stdtypes.rst:3325 -#: library/stdtypes.rst:3353 -#: library/stdtypes.rst:3367 -#: library/stdtypes.rst:3385 -#: library/stdtypes.rst:3412 -#: library/stdtypes.rst:3435 -#: library/stdtypes.rst:3462 -#: library/stdtypes.rst:3504 +#, fuzzy +msgid "" +"If *sep* is given, consecutive delimiters are not grouped together and are " +"deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " +"``['1', '', '2']``). The *sep* argument may consist of multiple characters " +"as a single delimiter (to split with multiple delimiters, use " +":func:`re.split`). Splitting an empty string with a specified separator " +"returns ``['']``." +msgstr "" +"اگر *sep* داده شود، جداکننده های متوالی با هم گروه بندی نمی شوند و به نظر می" +" رسد که رشته های خالی را محدود می کنند (برای مثال, ``'1,,2'.split(',')`` " +"``['1', '', '2']`` را برمی گرداند). آرگومان *sep* ممکن است از چندین کاراکتر" +" به عنوان یک جداکننده منفرد تشکیل شده باشد (برای تقسیم با چند جداکننده, از " +":func:`re.split` استفاده کنید). تقسیم یک رشته خالی با جداکننده مشخص شده, " +"``['']`` را برمی گرداند." + +#: library/stdtypes.rst:2103 library/stdtypes.rst:2121 +#: library/stdtypes.rst:2173 library/stdtypes.rst:2241 +#: library/stdtypes.rst:2309 library/stdtypes.rst:3161 +#: library/stdtypes.rst:3179 library/stdtypes.rst:3270 +#: library/stdtypes.rst:3286 library/stdtypes.rst:3311 +#: library/stdtypes.rst:3325 library/stdtypes.rst:3353 +#: library/stdtypes.rst:3367 library/stdtypes.rst:3385 +#: library/stdtypes.rst:3412 library/stdtypes.rst:3435 +#: library/stdtypes.rst:3462 library/stdtypes.rst:3504 #: library/stdtypes.rst:3528 +#, fuzzy msgid "For example::" -msgstr "" +msgstr "به عنوان مثال::" #: library/stdtypes.rst:2105 -msgid ">>> '1,2,3'.split(',')\n" +#, fuzzy +msgid "" +">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" ">>> '1,2,3'.split(',', maxsplit=1)\n" "['1', '2,3']\n" @@ -2069,215 +4197,385 @@ msgid ">>> '1,2,3'.split(',')\n" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" msgstr "" +">>> '1,2,3'.split(',')\n" +"['1', '2', '3']\n" +">>> '1,2,3'.split(',', maxsplit=1)\n" +"['1', '2,3']\n" +">>> '1,2,,3,'.split(',')\n" +"['1', '2', '', '3', '']\n" +">>> '1<>2<>3<4'.split('<>')\n" +"['1', '2', '3<4']" #: library/stdtypes.rst:2114 -msgid "If *sep* is not specified or is ``None``, a different splitting algorithm is applied: runs of consecutive whitespace are regarded as a single separator, and the result will contain no empty strings at the start or end if the string has leading or trailing whitespace. Consequently, splitting an empty string or a string consisting of just whitespace with a ``None`` separator returns ``[]``." -msgstr "" +#, fuzzy +msgid "" +"If *sep* is not specified or is ``None``, a different splitting algorithm is" +" applied: runs of consecutive whitespace are regarded as a single separator," +" and the result will contain no empty strings at the start or end if the " +"string has leading or trailing whitespace. Consequently, splitting an empty" +" string or a string consisting of just whitespace with a ``None`` separator " +"returns ``[]``." +msgstr "" +"اگر *sep* مشخص نشده باشد یا ``None`` باشد، یک الگوریتم تقسیم متفاوت اعمال " +"می‌شود: اجراهای فضای سفید متوالی به عنوان یک جداکننده در نظر گرفته می‌شوند و" +" در صورتی که رشته دارای فضای سفید پیشرو یا انتهایی باشد، نتیجه در ابتدا یا " +"انتهای آن رشته‌ای خالی نخواهد داشت. در نتیجه، تقسیم یک رشته خالی یا رشته ای" +" که فقط از فضای خالی با جداکننده ``None`` تشکیل شده است، ``[]`` را برمی " +"گرداند." #: library/stdtypes.rst:2123 -msgid ">>> '1 2 3'.split()\n" +#, fuzzy +msgid "" +">>> '1 2 3'.split()\n" "['1', '2', '3']\n" ">>> '1 2 3'.split(maxsplit=1)\n" "['1', '2 3']\n" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" msgstr "" +">>> '1 2 3'.split()\n" +"['1', '2', '3']\n" +">>> '1 2 3'.split(maxsplit=1)\n" +"['1', '2 3']\n" +">>> ' 1 2 3 '.split()\n" +"['1', '2', '3']" #: library/stdtypes.rst:2136 -msgid "Return a list of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless *keepends* is given and true." +#, fuzzy +msgid "" +"Return a list of the lines in the string, breaking at line boundaries. Line" +" breaks are not included in the resulting list unless *keepends* is given " +"and true." msgstr "" +"فهرستی از خطوط در رشته را برگردانید که در مرزهای خط شکسته می شوند. شکست خط " +"در لیست حاصل گنجانده نمی شود مگر اینکه *keepends* داده شده و درست باشد." #: library/stdtypes.rst:2140 -msgid "This method splits on the following line boundaries. In particular, the boundaries are a superset of :term:`universal newlines`." +#, fuzzy +msgid "" +"This method splits on the following line boundaries. In particular, the " +"boundaries are a superset of :term:`universal newlines`." msgstr "" +"این روش بر روی مرزهای خط زیر تقسیم می شود. به طور خاص، مرزها ابر مجموعه ای " +"از :term:`universal newlines` هستند." #: library/stdtypes.rst:2144 +#, fuzzy msgid "Representation" -msgstr "" +msgstr "نمایندگی" #: library/stdtypes.rst:2144 +#, fuzzy msgid "Description" -msgstr "" +msgstr "توضیحات" #: library/stdtypes.rst:2146 +#, fuzzy msgid "``\\n``" -msgstr "" +msgstr "``\\n``" #: library/stdtypes.rst:2146 +#, fuzzy msgid "Line Feed" -msgstr "" +msgstr "تغذیه خط" #: library/stdtypes.rst:2148 +#, fuzzy msgid "``\\r``" -msgstr "" +msgstr "``\\r``" #: library/stdtypes.rst:2148 +#, fuzzy msgid "Carriage Return" -msgstr "" +msgstr "کالسکه برگشت" #: library/stdtypes.rst:2150 +#, fuzzy msgid "``\\r\\n``" -msgstr "" +msgstr "``\\r\\n``" #: library/stdtypes.rst:2150 +#, fuzzy msgid "Carriage Return + Line Feed" -msgstr "" +msgstr "کالسکه برگشت + تغذیه خط" #: library/stdtypes.rst:2152 +#, fuzzy msgid "``\\v`` or ``\\x0b``" -msgstr "" +msgstr "``\\v`` یا ``\\x0b``" #: library/stdtypes.rst:2152 +#, fuzzy msgid "Line Tabulation" -msgstr "" +msgstr "جدول بندی خط" #: library/stdtypes.rst:2154 +#, fuzzy msgid "``\\f`` or ``\\x0c``" -msgstr "" +msgstr "``\\f`` یا ``\\x0c``" #: library/stdtypes.rst:2154 +#, fuzzy msgid "Form Feed" -msgstr "" +msgstr "فید فرم" #: library/stdtypes.rst:2156 +#, fuzzy msgid "``\\x1c``" -msgstr "" +msgstr "``\\x1c``" #: library/stdtypes.rst:2156 +#, fuzzy msgid "File Separator" -msgstr "" +msgstr "جداکننده فایل" #: library/stdtypes.rst:2158 +#, fuzzy msgid "``\\x1d``" -msgstr "" +msgstr "``\\x1d``" #: library/stdtypes.rst:2158 +#, fuzzy msgid "Group Separator" -msgstr "" +msgstr "جداکننده گروه" #: library/stdtypes.rst:2160 +#, fuzzy msgid "``\\x1e``" -msgstr "" +msgstr "``\\x1e``" #: library/stdtypes.rst:2160 +#, fuzzy msgid "Record Separator" -msgstr "" +msgstr "جداکننده رکورد" #: library/stdtypes.rst:2162 +#, fuzzy msgid "``\\x85``" -msgstr "" +msgstr "``\\x85``" #: library/stdtypes.rst:2162 +#, fuzzy msgid "Next Line (C1 Control Code)" -msgstr "" +msgstr "خط بعدی (کد کنترل C1)" #: library/stdtypes.rst:2164 +#, fuzzy msgid "``\\u2028``" -msgstr "" +msgstr "``\\u2028``" #: library/stdtypes.rst:2164 +#, fuzzy msgid "Line Separator" -msgstr "" +msgstr "جداکننده خطوط" #: library/stdtypes.rst:2166 +#, fuzzy msgid "``\\u2029``" -msgstr "" +msgstr "``\\u2029``" #: library/stdtypes.rst:2166 +#, fuzzy msgid "Paragraph Separator" -msgstr "" +msgstr "جداکننده پاراگراف" #: library/stdtypes.rst:2171 +#, fuzzy msgid "``\\v`` and ``\\f`` added to list of line boundaries." -msgstr "" +msgstr "``\\v`` و ``\\f`` به لیست مرزهای خطوط اضافه شدند." #: library/stdtypes.rst:2175 -msgid ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +#, fuzzy +msgid "" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgstr "" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"['ab c', '', 'de fg', 'kl']\n" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" #: library/stdtypes.rst:2180 -msgid "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::" +#, fuzzy +msgid "" +"Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " +"method returns an empty list for the empty string, and a terminal line break" +" does not result in an extra line::" msgstr "" +"برخلاف :meth:`~str.split` که یک رشته جداکننده *sep* داده می شود، این روش یک " +"لیست خالی برای رشته خالی برمی گرداند و شکست خط پایانی منجر به یک خط اضافی " +"نمی شود:" #: library/stdtypes.rst:2184 -msgid ">>> \"\".splitlines()\n" +#, fuzzy +msgid "" +">>> \"\".splitlines()\n" "[]\n" ">>> \"One line\\n\".splitlines()\n" "['One line']" msgstr "" +">>> \"\".splitlines()\n" +"[]\n" +">>> \"One line\\n\".splitlines()\n" +"['One line']" #: library/stdtypes.rst:2189 +#, fuzzy msgid "For comparison, ``split('\\n')`` gives::" -msgstr "" +msgstr "برای مقایسه، ``split('\\n')`` می دهد:" #: library/stdtypes.rst:2191 -msgid ">>> ''.split('\\n')\n" +#, fuzzy +msgid "" +">>> ''.split('\\n')\n" "['']\n" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" msgstr "" +">>> ''.split('\\n')\n" +"['']\n" +">>> 'Two lines\\n'.split('\\n')\n" +"['Two lines', '']" #: library/stdtypes.rst:2199 -msgid "Return ``True`` if string starts with the *prefix*, otherwise return ``False``. *prefix* can also be a tuple of prefixes to look for. With optional *start*, test string beginning at that position. With optional *end*, stop comparing string at that position." +#, fuzzy +msgid "" +"Return ``True`` if string starts with the *prefix*, otherwise return " +"``False``. *prefix* can also be a tuple of prefixes to look for. With " +"optional *start*, test string beginning at that position. With optional " +"*end*, stop comparing string at that position." msgstr "" +"اگر رشته با *prefix* شروع شد، ``True`` را برگردانید، در غیر این صورت " +"``False`` را برگردانید. *prefix* همچنین می تواند چندین پیشوند برای جستجو " +"باشد. با *start* اختیاری، رشته را از همان موقعیت شروع کنید. با *end* " +"اختیاری، مقایسه رشته در آن موقعیت را متوقف کنید." #: library/stdtypes.rst:2207 -msgid "Return a copy of the string with the leading and trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix or suffix; rather, all combinations of its values are stripped::" -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the string with the leading and trailing characters " +"removed. The *chars* argument is a string specifying the set of characters " +"to be removed. If omitted or ``None``, the *chars* argument defaults to " +"removing whitespace. The *chars* argument is not a prefix or suffix; rather," +" all combinations of its values are stripped::" +msgstr "" +"یک کپی از رشته را با حذف کاراکترهای اصلی و انتهایی برگردانید. آرگومان " +"*chars* رشته ای است که مجموعه کاراکترهایی را که باید حذف شوند را مشخص می " +"کند. اگر حذف شود یا ``None``، آرگومان *chars* به طور پیش‌فرض فضای خالی را " +"حذف می‌کند. آرگومان *chars* یک پیشوند یا پسوند نیست. بلکه تمام ترکیبات " +"مقادیر آن حذف می شوند::" #: library/stdtypes.rst:2213 -msgid ">>> ' spacious '.strip()\n" +#, fuzzy +msgid "" +">>> ' spacious '.strip()\n" "'spacious'\n" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" msgstr "" +">>> ' spacious '.strip()\n" +"'spacious'\n" +">>> 'www.example.com'.strip('cmowz.')\n" +"'example'" #: library/stdtypes.rst:2218 -msgid "The outermost leading and trailing *chars* argument values are stripped from the string. Characters are removed from the leading end until reaching a string character that is not contained in the set of characters in *chars*. A similar action takes place on the trailing end. For example::" +#, fuzzy +msgid "" +"The outermost leading and trailing *chars* argument values are stripped from" +" the string. Characters are removed from the leading end until reaching a " +"string character that is not contained in the set of characters in *chars*. " +"A similar action takes place on the trailing end. For example::" msgstr "" +"بیرونی ترین مقادیر آرگومان *chars* پیشرو و انتهایی از رشته حذف می شوند. " +"کاراکترها تا رسیدن به یک کاراکتر رشته ای که در مجموعه کاراکترها در *chars* " +"وجود ندارد، از انتهای اصلی حذف می شوند. یک عمل مشابه در انتهای انتهایی انجام" +" می شود. به عنوان مثال::" #: library/stdtypes.rst:2224 -msgid ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +#, fuzzy +msgid "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" msgstr "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +">>> comment_string.strip('.#! ')\n" +"'Section 3.2.1 Issue #32'" #: library/stdtypes.rst:2231 -msgid "Return a copy of the string with uppercase characters converted to lowercase and vice versa. Note that it is not necessarily true that ``s.swapcase().swapcase() == s``." +#, fuzzy +msgid "" +"Return a copy of the string with uppercase characters converted to lowercase" +" and vice versa. Note that it is not necessarily true that " +"``s.swapcase().swapcase() == s``." msgstr "" +"یک کپی از رشته را با حروف بزرگ به حروف کوچک و بالعکس برگردانید. توجه داشته " +"باشید که لزوماً ``s.swapcase().swapcase() == s`` درست نیست." #: library/stdtypes.rst:2238 -msgid "Return a titlecased version of the string where words start with an uppercase character and the remaining characters are lowercase." +#, fuzzy +msgid "" +"Return a titlecased version of the string where words start with an " +"uppercase character and the remaining characters are lowercase." msgstr "" +"یک نسخه با حروف عنوان رشته را برگردانید که در آن کلمات با یک کاراکتر بزرگ " +"شروع می شوند و کاراکترهای باقی مانده با حروف کوچک هستند." #: library/stdtypes.rst:2243 -msgid ">>> 'Hello world'.title()\n" +#, fuzzy +msgid "" +">>> 'Hello world'.title()\n" "'Hello World'" msgstr "" +">>> 'Hello world'.title()\n" +"'Hello World'" -#: library/stdtypes.rst:2246 -#: library/stdtypes.rst:3472 -msgid "The algorithm uses a simple language-independent definition of a word as groups of consecutive letters. The definition works in many contexts but it means that apostrophes in contractions and possessives form word boundaries, which may not be the desired result::" +#: library/stdtypes.rst:2246 library/stdtypes.rst:3472 +#, fuzzy +msgid "" +"The algorithm uses a simple language-independent definition of a word as " +"groups of consecutive letters. The definition works in many contexts but it" +" means that apostrophes in contractions and possessives form word " +"boundaries, which may not be the desired result::" msgstr "" +"این الگوریتم از یک تعریف ساده مستقل از زبان از یک کلمه به عنوان گروه هایی از" +" حروف متوالی استفاده می کند. این تعریف در بسیاری از زمینه ها کار می کند، " +"اما به این معنی است که آپاستروف ها در انقباضات و مالکیت ها مرزهای کلمه را " +"تشکیل می دهند، که ممکن است نتیجه مطلوب نباشد:" #: library/stdtypes.rst:2251 -msgid ">>> \"they're bill's friends from the UK\".title()\n" +#, fuzzy +msgid "" +">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> \"they're bill's friends from the UK\".title()\n" +"\"They'Re Bill'S Friends From The Uk\"" #: library/stdtypes.rst:2254 -msgid "The :func:`string.capwords` function does not have this problem, as it splits words on spaces only." +#, fuzzy +msgid "" +"The :func:`string.capwords` function does not have this problem, as it " +"splits words on spaces only." msgstr "" +"تابع :func:`string.capwords` این مشکل را ندارد، زیرا کلمات را فقط در فاصله " +"ها تقسیم می کند." #: library/stdtypes.rst:2257 -msgid "Alternatively, a workaround for apostrophes can be constructed using regular expressions::" +#, fuzzy +msgid "" +"Alternatively, a workaround for apostrophes can be constructed using regular" +" expressions::" msgstr "" +"روش دیگر، یک راه حل برای آپستروف ها می تواند با استفاده از عبارات منظم ساخته" +" شود:" #: library/stdtypes.rst:2260 -msgid ">>> import re\n" +#, fuzzy +msgid "" +">>> import re\n" ">>> def titlecase(s):\n" "... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" "... lambda mo: mo.group(0).capitalize(),\n" @@ -2286,853 +4584,1659 @@ msgid ">>> import re\n" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0).capitalize(),\n" +"... s)\n" +"...\n" +">>> titlecase(\"they're bill's friends.\")\n" +"\"They're Bill's Friends.\"" #: library/stdtypes.rst:2272 -msgid "Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or :term:`sequence`. When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return ``None``, to delete the character from the return string; or raise a :exc:`LookupError` exception, to map the character to itself." -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the string in which each character has been mapped through " +"the given translation table. The table must be an object that implements " +"indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or " +":term:`sequence`. When indexed by a Unicode ordinal (an integer), the table" +" object can do any of the following: return a Unicode ordinal or a string, " +"to map the character to one or more other characters; return ``None``, to " +"delete the character from the return string; or raise a :exc:`LookupError` " +"exception, to map the character to itself." +msgstr "" +"یک کپی از رشته ای که در آن هر کاراکتر از طریق جدول ترجمه داده شده نگاشت شده " +"است، برگردانید. جدول باید یک شی باشد که نمایه سازی را از طریق " +":meth:`~object.__getitem__`، معمولاً یک :term:`mapping` یا :term:`sequence` " +"پیاده سازی می کند. هنگامی که توسط یک ترتیبی یونیکد (یک عدد صحیح) ایندکس می " +"شود، شی جدول می تواند یکی از کارهای زیر را انجام دهد: یک ترتیب یونیکد یا یک " +"رشته را برگرداند تا کاراکتر را به یک یا چند کاراکتر دیگر نگاشت کند. بازگشت " +"``None``، برای حذف کاراکتر از رشته بازگشت؛ یا یک استثنای :exc:`LookupError` " +"را برای نگاشت کاراکتر به خودش مطرح کنید." #: library/stdtypes.rst:2281 -msgid "You can use :meth:`str.maketrans` to create a translation map from character-to-character mappings in different formats." +#, fuzzy +msgid "" +"You can use :meth:`str.maketrans` to create a translation map from " +"character-to-character mappings in different formats." msgstr "" +"می توانید از :meth:`str.maketrans` برای ایجاد نقشه ترجمه از نگاشت کاراکتر به" +" کاراکتر در قالب های مختلف استفاده کنید." #: library/stdtypes.rst:2284 -msgid "See also the :mod:`codecs` module for a more flexible approach to custom character mappings." +#, fuzzy +msgid "" +"See also the :mod:`codecs` module for a more flexible approach to custom " +"character mappings." msgstr "" +"همچنین ماژول :mod:`codecs` را برای رویکردی انعطاف‌پذیرتر به نگاشت کاراکترهای" +" سفارشی ببینید." #: library/stdtypes.rst:2290 -msgid "Return a copy of the string with all the cased characters [4]_ converted to uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` contains uncased characters or if the Unicode category of the resulting character(s) is not \"Lu\" (Letter, uppercase), but e.g. \"Lt\" (Letter, titlecase)." +#, fuzzy +msgid "" +"Return a copy of the string with all the cased characters [4]_ converted to " +"uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " +"contains uncased characters or if the Unicode category of the resulting " +"character(s) is not \"Lu\" (Letter, uppercase), but e.g. \"Lt\" (Letter, " +"titlecase)." msgstr "" +"یک کپی از رشته را با تمام حروف کوچک [4]_ به حروف بزرگ تبدیل کنید. توجه " +"داشته باشید که ``s.upper().isupper()`` ممکن است ``False`` باشد اگر ``s`` " +"دارای کاراکترهای بدون حروف باشد یا اگر دسته یونیکد کاراکتر(های) حاصل \"Lu\" " +"(حروف, بزرگ) نباشد، اما به عنوان مثال. \"Lt\" (حرف, عنوان)." #: library/stdtypes.rst:2296 -msgid "The uppercasing algorithm used is `described in section 3.13 'Default Case Folding' of the Unicode Standard `__." +#, fuzzy +msgid "" +"The uppercasing algorithm used is `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard " +"`__." msgstr "" +"الگوریتم بزرگ استفاده شده `described in section 3.13 'Default Case Folding' " +"of the Unicode Standard " +"`__ است." #: library/stdtypes.rst:2303 -msgid "Return a copy of the string left filled with ASCII ``'0'`` digits to make a string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled by inserting the padding *after* the sign character rather than before. The original string is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return a copy of the string left filled with ASCII ``'0'`` digits to make a " +"string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled" +" by inserting the padding *after* the sign character rather than before. The" +" original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" +"یک کپی از رشته سمت چپ پر شده با ارقام ASCII ``'0'`` را برگردانید تا یک رشته " +"به طول *width* بسازید. پیشوند علامت پیشرو (``'+'``/``'-'``) با درج نویسه " +"علامت *after* به جای قبل انجام می شود. اگر *width* کمتر یا مساوی با " +"``len(s)`` باشد، رشته اصلی برگردانده می شود." #: library/stdtypes.rst:2311 -msgid ">>> \"42\".zfill(5)\n" +#, fuzzy +msgid "" +">>> \"42\".zfill(5)\n" "'00042'\n" ">>> \"-42\".zfill(5)\n" "'-0042'" msgstr "" +">>> \"42\".zfill(5)\n" +"'00042'\n" +">>> \"-42\".zfill(5)\n" +"'-0042'" #: library/stdtypes.rst:2321 +#, fuzzy msgid "``printf``-style String Formatting" -msgstr "" +msgstr "قالب بندی رشته ای به سبک ``printf``" #: library/stdtypes.rst:2334 -msgid "The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer :ref:`formatted string literals `, the :meth:`str.format` interface, or :ref:`template strings ` may help avoid these errors. Each of these alternatives provides their own trade-offs and benefits of simplicity, flexibility, and/or extensibility." -msgstr "" +#, fuzzy +msgid "" +"The formatting operations described here exhibit a variety of quirks that " +"lead to a number of common errors (such as failing to display tuples and " +"dictionaries correctly). Using the newer :ref:`formatted string literals " +"`, the :meth:`str.format` interface, or :ref:`template strings " +"` may help avoid these errors. Each of these alternatives" +" provides their own trade-offs and benefits of simplicity, flexibility, " +"and/or extensibility." +msgstr "" +"عملیات قالب‌بندی که در اینجا توضیح داده شده است، خصلت‌های مختلفی را نشان " +"می‌دهد که منجر به تعدادی خطای رایج (مانند عدم نمایش صحیح تاپل‌ها و " +"دیکشنری‌ها) می‌شود. استفاده از :ref:`formatted string literals `" +" جدیدتر، رابط :meth:`str.format` یا :ref:`template strings ` ممکن است به جلوگیری از این خطاها کمک کند. هر یک از این گزینه‌ها " +"معاوضه‌ها و مزایای خود را از جمله سادگی، انعطاف‌پذیری و/یا توسعه‌پذیری ارائه" +" می‌کنند." #: library/stdtypes.rst:2342 -msgid "String objects have one unique built-in operation: the ``%`` operator (modulo). This is also known as the string *formatting* or *interpolation* operator. Given ``format % values`` (where *format* is a string), ``%`` conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` function in the C language. For example:" -msgstr "" +#, fuzzy +msgid "" +"String objects have one unique built-in operation: the ``%`` operator " +"(modulo). This is also known as the string *formatting* or *interpolation* " +"operator. Given ``format % values`` (where *format* is a string), ``%`` " +"conversion specifications in *format* are replaced with zero or more " +"elements of *values*. The effect is similar to using the :c:func:`sprintf` " +"function in the C language. For example:" +msgstr "" +"اشیاء رشته ای یک عملیات داخلی منحصر به فرد دارند: عملگر ``%`` (مدول). به این" +" عملگر رشته *formatting* یا *interpolation* نیز می‌گویند. با توجه به " +"``format % values`` (که در آن *format* یک رشته است), مشخصات تبدیل ``%`` در " +"*format* با عناصر صفر یا بیشتر از *values* جایگزین می شود. این اثر مشابه " +"استفاده از تابع :c:func:`sprintf` در زبان C است. به عنوان مثال:" #: library/stdtypes.rst:2349 -msgid ">>> print('%s has %d quote types.' % ('Python', 2))\n" +#, fuzzy +msgid "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." msgstr "" +">>> print('%s دارای %d نوع نقل قول است.' % ('Python', 2))\n" +"پایتون 2 نوع نقل قول دارد." #: library/stdtypes.rst:2354 -msgid "If *format* requires a single argument, *values* may be a single non-tuple object. [5]_ Otherwise, *values* must be a tuple with exactly the number of items specified by the format string, or a single mapping object (for example, a dictionary)." +#, fuzzy +msgid "" +"If *format* requires a single argument, *values* may be a single non-tuple " +"object. [5]_ Otherwise, *values* must be a tuple with exactly the number of" +" items specified by the format string, or a single mapping object (for " +"example, a dictionary)." msgstr "" +"اگر *format* به یک آرگومان واحد نیاز داشته باشد، *values* ممکن است یک شی غیر" +" چندگانه باشد. [5]_ در غیر این صورت، *values* باید یک تاپل با تعداد موارد " +"مشخص شده توسط رشته قالب یا یک شی نگاشت واحد (مثلاً یک فرهنگ لغت) باشد." -#: library/stdtypes.rst:2364 -#: library/stdtypes.rst:3583 -msgid "A conversion specifier contains two or more characters and has the following components, which must occur in this order:" +#: library/stdtypes.rst:2364 library/stdtypes.rst:3583 +#, fuzzy +msgid "" +"A conversion specifier contains two or more characters and has the following" +" components, which must occur in this order:" msgstr "" +"یک مشخص کننده تبدیل شامل دو یا چند کاراکتر است و دارای اجزای زیر است که باید" +" به این ترتیب رخ دهد:" -#: library/stdtypes.rst:2367 -#: library/stdtypes.rst:3586 +#: library/stdtypes.rst:2367 library/stdtypes.rst:3586 +#, fuzzy msgid "The ``'%'`` character, which marks the start of the specifier." -msgstr "" +msgstr "کاراکتر ``'%'`` که شروع مشخص کننده را نشان می دهد." -#: library/stdtypes.rst:2369 -#: library/stdtypes.rst:3588 -msgid "Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``)." +#: library/stdtypes.rst:2369 library/stdtypes.rst:3588 +#, fuzzy +msgid "" +"Mapping key (optional), consisting of a parenthesised sequence of characters" +" (for example, ``(somename)``)." msgstr "" +"کلید نگاشت (اختیاری), متشکل از یک دنباله پرانتز از کاراکترها (به عنوان مثال," +" ``(somename)``)." -#: library/stdtypes.rst:2372 -#: library/stdtypes.rst:3591 -msgid "Conversion flags (optional), which affect the result of some conversion types." +#: library/stdtypes.rst:2372 library/stdtypes.rst:3591 +#, fuzzy +msgid "" +"Conversion flags (optional), which affect the result of some conversion " +"types." msgstr "" +"پرچم های تبدیل (اختیاری), که بر نتیجه برخی از انواع تبدیل تأثیر می گذارد." -#: library/stdtypes.rst:2375 -#: library/stdtypes.rst:3594 -msgid "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision." +#: library/stdtypes.rst:2375 library/stdtypes.rst:3594 +#, fuzzy +msgid "" +"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " +"actual width is read from the next element of the tuple in *values*, and the" +" object to convert comes after the minimum field width and optional " +"precision." msgstr "" +"حداقل عرض میدان (اختیاری). اگر به عنوان ``'*'`` (ستاره) مشخص شود، عرض واقعی" +" از عنصر بعدی تاپل در *values* خوانده می شود و شیء تبدیل پس از حداقل عرض " +"میدان و دقت اختیاری می آید." -#: library/stdtypes.rst:2379 -#: library/stdtypes.rst:3598 -msgid "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the precision." +#: library/stdtypes.rst:2379 library/stdtypes.rst:3598 +#, fuzzy +msgid "" +"Precision (optional), given as a ``'.'`` (dot) followed by the precision. " +"If specified as ``'*'`` (an asterisk), the actual precision is read from the" +" next element of the tuple in *values*, and the value to convert comes after" +" the precision." msgstr "" +"دقت (اختیاری), به عنوان یک ``'.'`` (نقطه) و به دنبال آن دقت. اگر به عنوان " +"``'*'`` (ستاره) مشخص شود، دقت واقعی از عنصر بعدی تاپل در *values* خوانده می " +"شود و مقدار تبدیل پس از دقت می آید." -#: library/stdtypes.rst:2384 -#: library/stdtypes.rst:3603 +#: library/stdtypes.rst:2384 library/stdtypes.rst:3603 +#, fuzzy msgid "Length modifier (optional)." -msgstr "" +msgstr "اصلاح کننده طول (اختیاری)." -#: library/stdtypes.rst:2386 -#: library/stdtypes.rst:3605 +#: library/stdtypes.rst:2386 library/stdtypes.rst:3605 +#, fuzzy msgid "Conversion type." -msgstr "" +msgstr "نوع تبدیل" #: library/stdtypes.rst:2388 -msgid "When the right argument is a dictionary (or other mapping type), then the formats in the string *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:" +#, fuzzy +msgid "" +"When the right argument is a dictionary (or other mapping type), then the " +"formats in the string *must* include a parenthesised mapping key into that " +"dictionary inserted immediately after the ``'%'`` character. The mapping key" +" selects the value to be formatted from the mapping. For example:" msgstr "" +"هنگامی که آرگومان مناسب یک فرهنگ لغت (یا نوع نقشه برداری دیگر) باشد، فرمت " +"های رشته *must* شامل یک کلید نگاشت پرانتز شده در آن فرهنگ لغت است که " +"بلافاصله بعد از کاراکتر ``'%'`` درج می شود. کلید نگاشت مقداری را که باید " +"قالب بندی شود از نقشه برداری انتخاب می کند. به عنوان مثال:" -#: library/stdtypes.rst:2397 -#: library/stdtypes.rst:3616 -msgid "In this case no ``*`` specifiers may occur in a format (since they require a sequential parameter list)." +#: library/stdtypes.rst:2397 library/stdtypes.rst:3616 +#, fuzzy +msgid "" +"In this case no ``*`` specifiers may occur in a format (since they require a" +" sequential parameter list)." msgstr "" +"در این مورد هیچ مشخص کننده ``*`` ممکن است در یک قالب وجود نداشته باشد (زیرا " +"آنها به یک لیست پارامترهای متوالی نیاز دارند)." -#: library/stdtypes.rst:2400 -#: library/stdtypes.rst:3619 +#: library/stdtypes.rst:2400 library/stdtypes.rst:3619 +#, fuzzy msgid "The conversion flag characters are:" -msgstr "" +msgstr "کاراکترهای پرچم تبدیل عبارتند از:" -#: library/stdtypes.rst:2409 -#: library/stdtypes.rst:3628 +#: library/stdtypes.rst:2409 library/stdtypes.rst:3628 +#, fuzzy msgid "Flag" -msgstr "" +msgstr "پرچم" -#: library/stdtypes.rst:2411 -#: library/stdtypes.rst:3630 +#: library/stdtypes.rst:2411 library/stdtypes.rst:3630 +#, fuzzy msgid "``'#'``" -msgstr "" +msgstr "``'#'``" -#: library/stdtypes.rst:2411 -#: library/stdtypes.rst:3630 -msgid "The value conversion will use the \"alternate form\" (where defined below)." +#: library/stdtypes.rst:2411 library/stdtypes.rst:3630 +#, fuzzy +msgid "" +"The value conversion will use the \"alternate form\" (where defined below)." msgstr "" +"تبدیل مقدار از \"فرم جایگزین\" (جایی که در زیر تعریف شده است) استفاده می " +"کند." -#: library/stdtypes.rst:2414 -#: library/stdtypes.rst:3633 +#: library/stdtypes.rst:2414 library/stdtypes.rst:3633 +#, fuzzy msgid "``'0'``" -msgstr "" +msgstr "``'0'``" -#: library/stdtypes.rst:2414 -#: library/stdtypes.rst:3633 +#: library/stdtypes.rst:2414 library/stdtypes.rst:3633 +#, fuzzy msgid "The conversion will be zero padded for numeric values." -msgstr "" +msgstr "برای مقادیر عددی، تبدیل صفر خواهد شد." -#: library/stdtypes.rst:2416 -#: library/stdtypes.rst:3635 +#: library/stdtypes.rst:2416 library/stdtypes.rst:3635 +#, fuzzy msgid "``'-'``" -msgstr "" +msgstr "``'-'``" -#: library/stdtypes.rst:2416 -#: library/stdtypes.rst:3635 -msgid "The converted value is left adjusted (overrides the ``'0'`` conversion if both are given)." +#: library/stdtypes.rst:2416 library/stdtypes.rst:3635 +#, fuzzy +msgid "" +"The converted value is left adjusted (overrides the ``'0'`` conversion if " +"both are given)." msgstr "" +"مقدار تبدیل شده تنظیم می شود (اگر هر دو داده شوند, تبدیل ``'0'`` را لغو می " +"کند)." -#: library/stdtypes.rst:2419 -#: library/stdtypes.rst:3638 +#: library/stdtypes.rst:2419 library/stdtypes.rst:3638 +#, fuzzy msgid "``' '``" -msgstr "" +msgstr "``' '``" -#: library/stdtypes.rst:2419 -#: library/stdtypes.rst:3638 -msgid "(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion." +#: library/stdtypes.rst:2419 library/stdtypes.rst:3638 +#, fuzzy +msgid "" +"(a space) A blank should be left before a positive number (or empty string) " +"produced by a signed conversion." msgstr "" +"(یک فاصله) باید قبل از یک عدد مثبت (یا رشته خالی) که توسط یک تبدیل امضا شده " +"ایجاد می شود، یک خالی گذاشته شود." -#: library/stdtypes.rst:2422 -#: library/stdtypes.rst:3641 +#: library/stdtypes.rst:2422 library/stdtypes.rst:3641 +#, fuzzy msgid "``'+'``" -msgstr "" +msgstr "``'+'``" -#: library/stdtypes.rst:2422 -#: library/stdtypes.rst:3641 -msgid "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides a \"space\" flag)." +#: library/stdtypes.rst:2422 library/stdtypes.rst:3641 +#, fuzzy +msgid "" +"A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides" +" a \"space\" flag)." msgstr "" +"یک کاراکتر علامت (``'+'`` یا ``'-'``) قبل از تبدیل قرار می گیرد (پرچم " +"\"فضا\" را لغو می کند)." -#: library/stdtypes.rst:2426 -#: library/stdtypes.rst:3645 -msgid "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." +#: library/stdtypes.rst:2426 library/stdtypes.rst:3645 +#, fuzzy +msgid "" +"A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as" +" it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" +"یک اصلاح کننده طول (``h``, ``l`` یا ``L``) ممکن است وجود داشته باشد، اما " +"نادیده گرفته می شود زیرا برای پایتون ضروری نیست - به عنوان مثال. ``%ld`` با " +"``%d`` یکسان است." -#: library/stdtypes.rst:2429 -#: library/stdtypes.rst:3648 +#: library/stdtypes.rst:2429 library/stdtypes.rst:3648 +#, fuzzy msgid "The conversion types are:" -msgstr "" +msgstr "انواع تبدیل عبارتند از:" -#: library/stdtypes.rst:2432 -#: library/stdtypes.rst:3651 +#: library/stdtypes.rst:2432 library/stdtypes.rst:3651 +#, fuzzy msgid "Conversion" -msgstr "" +msgstr "تبدیل" -#: library/stdtypes.rst:2434 -#: library/stdtypes.rst:3653 +#: library/stdtypes.rst:2434 library/stdtypes.rst:3653 +#, fuzzy msgid "``'d'``" -msgstr "" +msgstr "``'d'``" -#: library/stdtypes.rst:2434 -#: library/stdtypes.rst:2436 -#: library/stdtypes.rst:3653 -#: library/stdtypes.rst:3655 +#: library/stdtypes.rst:2434 library/stdtypes.rst:2436 +#: library/stdtypes.rst:3653 library/stdtypes.rst:3655 +#, fuzzy msgid "Signed integer decimal." -msgstr "" +msgstr "عدد صحیح اعشاری امضا شده" -#: library/stdtypes.rst:2436 -#: library/stdtypes.rst:3655 +#: library/stdtypes.rst:2436 library/stdtypes.rst:3655 +#, fuzzy msgid "``'i'``" -msgstr "" +msgstr "``'i'``" -#: library/stdtypes.rst:2438 -#: library/stdtypes.rst:3657 +#: library/stdtypes.rst:2438 library/stdtypes.rst:3657 +#, fuzzy msgid "``'o'``" -msgstr "" +msgstr "``'o'``" -#: library/stdtypes.rst:2438 -#: library/stdtypes.rst:3657 +#: library/stdtypes.rst:2438 library/stdtypes.rst:3657 +#, fuzzy msgid "Signed octal value." -msgstr "" +msgstr "مقدار هشتی امضا شده" -#: library/stdtypes.rst:2440 -#: library/stdtypes.rst:3659 +#: library/stdtypes.rst:2440 library/stdtypes.rst:3659 +#, fuzzy msgid "``'u'``" -msgstr "" +msgstr "``'u'``" -#: library/stdtypes.rst:2440 -#: library/stdtypes.rst:3659 +#: library/stdtypes.rst:2440 library/stdtypes.rst:3659 +#, fuzzy msgid "Obsolete type -- it is identical to ``'d'``." -msgstr "" +msgstr "نوع منسوخ -- با ``'d'`` یکسان است." -#: library/stdtypes.rst:2442 -#: library/stdtypes.rst:3661 +#: library/stdtypes.rst:2442 library/stdtypes.rst:3661 +#, fuzzy msgid "``'x'``" -msgstr "" +msgstr "``'x'``" -#: library/stdtypes.rst:2442 -#: library/stdtypes.rst:3661 +#: library/stdtypes.rst:2442 library/stdtypes.rst:3661 +#, fuzzy msgid "Signed hexadecimal (lowercase)." -msgstr "" +msgstr "هگزادسیمال امضا شده (حروف کوچک)." -#: library/stdtypes.rst:2444 -#: library/stdtypes.rst:3663 +#: library/stdtypes.rst:2444 library/stdtypes.rst:3663 +#, fuzzy msgid "``'X'``" -msgstr "" +msgstr "``'X'``" -#: library/stdtypes.rst:2444 -#: library/stdtypes.rst:3663 +#: library/stdtypes.rst:2444 library/stdtypes.rst:3663 +#, fuzzy msgid "Signed hexadecimal (uppercase)." -msgstr "" +msgstr "هگزادسیمال امضا شده (بزرگ)." -#: library/stdtypes.rst:2446 -#: library/stdtypes.rst:3665 +#: library/stdtypes.rst:2446 library/stdtypes.rst:3665 +#, fuzzy msgid "``'e'``" -msgstr "" +msgstr "``'e'``" -#: library/stdtypes.rst:2446 -#: library/stdtypes.rst:3665 +#: library/stdtypes.rst:2446 library/stdtypes.rst:3665 +#, fuzzy msgid "Floating-point exponential format (lowercase)." -msgstr "" +msgstr "فرمت نمایی ممیز شناور (کوچک)." -#: library/stdtypes.rst:2448 -#: library/stdtypes.rst:3667 +#: library/stdtypes.rst:2448 library/stdtypes.rst:3667 +#, fuzzy msgid "``'E'``" -msgstr "" +msgstr "``'E'``" -#: library/stdtypes.rst:2448 -#: library/stdtypes.rst:3667 +#: library/stdtypes.rst:2448 library/stdtypes.rst:3667 +#, fuzzy msgid "Floating-point exponential format (uppercase)." -msgstr "" +msgstr "فرمت نمایی ممیز شناور (بزرگ)." -#: library/stdtypes.rst:2450 -#: library/stdtypes.rst:3669 +#: library/stdtypes.rst:2450 library/stdtypes.rst:3669 +#, fuzzy msgid "``'f'``" -msgstr "" +msgstr "``'f'``" -#: library/stdtypes.rst:2450 -#: library/stdtypes.rst:2452 -#: library/stdtypes.rst:3669 -#: library/stdtypes.rst:3671 +#: library/stdtypes.rst:2450 library/stdtypes.rst:2452 +#: library/stdtypes.rst:3669 library/stdtypes.rst:3671 +#, fuzzy msgid "Floating-point decimal format." -msgstr "" +msgstr "فرمت اعشاری ممیز شناور." -#: library/stdtypes.rst:2452 -#: library/stdtypes.rst:3671 +#: library/stdtypes.rst:2452 library/stdtypes.rst:3671 +#, fuzzy msgid "``'F'``" -msgstr "" +msgstr "``'F'``" -#: library/stdtypes.rst:2454 -#: library/stdtypes.rst:3673 +#: library/stdtypes.rst:2454 library/stdtypes.rst:3673 +#, fuzzy msgid "``'g'``" -msgstr "" +msgstr "``'g'``" -#: library/stdtypes.rst:2454 -#: library/stdtypes.rst:3673 -msgid "Floating-point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise." +#: library/stdtypes.rst:2454 library/stdtypes.rst:3673 +#, fuzzy +msgid "" +"Floating-point format. Uses lowercase exponential format if exponent is less" +" than -4 or not less than precision, decimal format otherwise." msgstr "" +"فرمت ممیز شناور اگر نما کمتر از 4- باشد یا از دقت کمتر نباشد، از قالب نمایی " +"کوچک استفاده می کند، در غیر این صورت از قالب اعشاری استفاده می کند." -#: library/stdtypes.rst:2458 -#: library/stdtypes.rst:3677 +#: library/stdtypes.rst:2458 library/stdtypes.rst:3677 +#, fuzzy msgid "``'G'``" -msgstr "" +msgstr "``'G'``" -#: library/stdtypes.rst:2458 -#: library/stdtypes.rst:3677 -msgid "Floating-point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise." +#: library/stdtypes.rst:2458 library/stdtypes.rst:3677 +#, fuzzy +msgid "" +"Floating-point format. Uses uppercase exponential format if exponent is less" +" than -4 or not less than precision, decimal format otherwise." msgstr "" +"فرمت ممیز شناور اگر نما کمتر از -4 یا کمتر از دقت نباشد، از قالب نمایی بزرگ " +"استفاده می کند، در غیر این صورت از قالب اعشاری استفاده می کند." -#: library/stdtypes.rst:2462 -#: library/stdtypes.rst:3681 +#: library/stdtypes.rst:2462 library/stdtypes.rst:3681 +#, fuzzy msgid "``'c'``" -msgstr "" +msgstr "``'c'``" #: library/stdtypes.rst:2462 +#, fuzzy msgid "Single character (accepts integer or single character string)." -msgstr "" +msgstr "تک کاراکتر (رشته اعداد صحیح یا تک کاراکتری را می پذیرد)." -#: library/stdtypes.rst:2465 -#: library/stdtypes.rst:3694 +#: library/stdtypes.rst:2465 library/stdtypes.rst:3694 +#, fuzzy msgid "``'r'``" -msgstr "" +msgstr "``'r'``" #: library/stdtypes.rst:2465 +#, fuzzy msgid "String (converts any Python object using :func:`repr`)." -msgstr "" +msgstr "رشته (هر شی پایتون را با استفاده از :func:`repr` تبدیل می کند)." -#: library/stdtypes.rst:2468 -#: library/stdtypes.rst:3688 +#: library/stdtypes.rst:2468 library/stdtypes.rst:3688 +#, fuzzy msgid "``'s'``" -msgstr "" +msgstr "``'s'``" #: library/stdtypes.rst:2468 +#, fuzzy msgid "String (converts any Python object using :func:`str`)." -msgstr "" +msgstr "رشته (هر شی پایتون را با استفاده از :func:`str` تبدیل می کند)." -#: library/stdtypes.rst:2471 -#: library/stdtypes.rst:3691 +#: library/stdtypes.rst:2471 library/stdtypes.rst:3691 +#, fuzzy msgid "``'a'``" -msgstr "" +msgstr "``'a'``" #: library/stdtypes.rst:2471 +#, fuzzy msgid "String (converts any Python object using :func:`ascii`)." -msgstr "" +msgstr "رشته (هر شی پایتون را با استفاده از :func:`ascii` تبدیل می کند)." -#: library/stdtypes.rst:2474 -#: library/stdtypes.rst:3697 +#: library/stdtypes.rst:2474 library/stdtypes.rst:3697 +#, fuzzy msgid "``'%'``" -msgstr "" +msgstr "``'%'``" -#: library/stdtypes.rst:2474 -#: library/stdtypes.rst:3697 -msgid "No argument is converted, results in a ``'%'`` character in the result." -msgstr "" +#: library/stdtypes.rst:2474 library/stdtypes.rst:3697 +#, fuzzy +msgid "" +"No argument is converted, results in a ``'%'`` character in the result." +msgstr "هیچ آرگومانی تبدیل نمی شود، در نتیجه یک کاراکتر ``'%'`` ایجاد می شود." -#: library/stdtypes.rst:2481 -#: library/stdtypes.rst:3704 -msgid "The alternate form causes a leading octal specifier (``'0o'``) to be inserted before the first digit." +#: library/stdtypes.rst:2481 library/stdtypes.rst:3704 +#, fuzzy +msgid "" +"The alternate form causes a leading octal specifier (``'0o'``) to be " +"inserted before the first digit." msgstr "" +"شکل متناوب باعث می شود که یک مشخص کننده هشتی پیشرو (``'0o'``) قبل از رقم اول" +" درج شود." -#: library/stdtypes.rst:2485 -#: library/stdtypes.rst:3708 -msgid "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit." +#: library/stdtypes.rst:2485 library/stdtypes.rst:3708 +#, fuzzy +msgid "" +"The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " +"whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " +"first digit." msgstr "" +"فرم جایگزین باعث می شود که یک ``'0x'`` یا ``'0X'`` پیشرو (بسته به اینکه از " +"فرمت ``'x'`` یا ``'X'`` استفاده شده است) قبل از رقم اول درج شود." -#: library/stdtypes.rst:2489 -#: library/stdtypes.rst:3712 -msgid "The alternate form causes the result to always contain a decimal point, even if no digits follow it." +#: library/stdtypes.rst:2489 library/stdtypes.rst:3712 +#, fuzzy +msgid "" +"The alternate form causes the result to always contain a decimal point, even" +" if no digits follow it." msgstr "" +"شکل جایگزین باعث می شود که نتیجه همیشه دارای یک نقطه اعشار باشد، حتی اگر هیچ" +" رقمی از آن پیروی نکند." -#: library/stdtypes.rst:2492 -#: library/stdtypes.rst:3715 -msgid "The precision determines the number of digits after the decimal point and defaults to 6." +#: library/stdtypes.rst:2492 library/stdtypes.rst:3715 +#, fuzzy +msgid "" +"The precision determines the number of digits after the decimal point and " +"defaults to 6." msgstr "" +"دقت تعداد ارقام بعد از نقطه اعشار را تعیین می کند و به طور پیش فرض 6 است." -#: library/stdtypes.rst:2496 -#: library/stdtypes.rst:3719 -msgid "The alternate form causes the result to always contain a decimal point, and trailing zeroes are not removed as they would otherwise be." +#: library/stdtypes.rst:2496 library/stdtypes.rst:3719 +#, fuzzy +msgid "" +"The alternate form causes the result to always contain a decimal point, and " +"trailing zeroes are not removed as they would otherwise be." msgstr "" +"شکل متناوب باعث می شود که نتیجه همیشه دارای یک نقطه اعشار باشد و صفرهای " +"انتهایی آنطور که در غیر این صورت حذف می شدند حذف نمی شوند." -#: library/stdtypes.rst:2499 -#: library/stdtypes.rst:3722 -msgid "The precision determines the number of significant digits before and after the decimal point and defaults to 6." +#: library/stdtypes.rst:2499 library/stdtypes.rst:3722 +#, fuzzy +msgid "" +"The precision determines the number of significant digits before and after " +"the decimal point and defaults to 6." msgstr "" +"دقت، تعداد ارقام مهم قبل و بعد از اعشار را تعیین می کند و 6 را به طور پیش " +"فرض تعیین می کند." -#: library/stdtypes.rst:2503 -#: library/stdtypes.rst:3726 +#: library/stdtypes.rst:2503 library/stdtypes.rst:3726 +#, fuzzy msgid "If precision is ``N``, the output is truncated to ``N`` characters." -msgstr "" +msgstr "اگر دقت ``N`` باشد، خروجی به نویسه ``N`` کوتاه می شود." -#: library/stdtypes.rst:2506 -#: library/stdtypes.rst:3735 +#: library/stdtypes.rst:2506 library/stdtypes.rst:3735 +#, fuzzy msgid "See :pep:`237`." -msgstr "" +msgstr ":pep:`237` را ببینید." #: library/stdtypes.rst:2508 -msgid "Since Python strings have an explicit length, ``%s`` conversions do not assume that ``'\\0'`` is the end of the string." +#, fuzzy +msgid "" +"Since Python strings have an explicit length, ``%s`` conversions do not " +"assume that ``'\\0'`` is the end of the string." msgstr "" +"از آنجایی که رشته‌های پایتون دارای طول صریح هستند، تبدیل‌های ``%s`` فرض " +"نمی‌کنند که ``'\\0'`` انتهای رشته است." #: library/stdtypes.rst:2513 -msgid "``%f`` conversions for numbers whose absolute value is over 1e50 are no longer replaced by ``%g`` conversions." +#, fuzzy +msgid "" +"``%f`` conversions for numbers whose absolute value is over 1e50 are no " +"longer replaced by ``%g`` conversions." msgstr "" +"تبدیل‌های ``%f`` برای اعدادی که قدر مطلق آنها بیش از 1e50 است، دیگر با " +"تبدیل‌های ``%g`` جایگزین نمی‌شوند." #: library/stdtypes.rst:2524 -msgid "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview`" +#, fuzzy +msgid "" +"Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, " +":class:`memoryview`" msgstr "" +"انواع توالی باینری --- :class:`bytes`, :class:`bytearray`, " +":class:`memoryview`" #: library/stdtypes.rst:2532 -msgid "The core built-in types for manipulating binary data are :class:`bytes` and :class:`bytearray`. They are supported by :class:`memoryview` which uses the :ref:`buffer protocol ` to access the memory of other binary objects without needing to make a copy." +#, fuzzy +msgid "" +"The core built-in types for manipulating binary data are :class:`bytes` and " +":class:`bytearray`. They are supported by :class:`memoryview` which uses the" +" :ref:`buffer protocol ` to access the memory of other binary" +" objects without needing to make a copy." msgstr "" +"انواع داخلی داخلی برای دستکاری داده های باینری :class:`bytes` و " +":class:`bytearray` هستند. آنها توسط :class:`memoryview` پشتیبانی می شوند که " +"از :ref:`buffer protocol ` برای دسترسی به حافظه سایر اشیاء " +"باینری بدون نیاز به کپی استفاده می کند." #: library/stdtypes.rst:2537 -msgid "The :mod:`array` module supports efficient storage of basic data types like 32-bit integers and IEEE754 double-precision floating values." +#, fuzzy +msgid "" +"The :mod:`array` module supports efficient storage of basic data types like " +"32-bit integers and IEEE754 double-precision floating values." msgstr "" +"ماژول :mod:`array` از ذخیره سازی کارآمد انواع داده های پایه مانند اعداد صحیح" +" 32 بیتی و مقادیر شناور با دقت دوگانه IEEE754 پشتیبانی می کند." #: library/stdtypes.rst:2543 +#, fuzzy msgid "Bytes Objects" -msgstr "" +msgstr "اشیاء بایت" #: library/stdtypes.rst:2547 -msgid "Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other ways." +#, fuzzy +msgid "" +"Bytes objects are immutable sequences of single bytes. Since many major " +"binary protocols are based on the ASCII text encoding, bytes objects offer " +"several methods that are only valid when working with ASCII compatible data " +"and are closely related to string objects in a variety of other ways." msgstr "" +"اشیاء بایت دنباله های تغییرناپذیری از تک بایت ها هستند. از آنجایی که بسیاری " +"از پروتکل‌های دودویی اصلی مبتنی بر رمزگذاری متن ASCII هستند، اشیاء بایت " +"روش‌های مختلفی را ارائه می‌دهند که فقط در هنگام کار با داده‌های سازگار با " +"ASCII معتبر هستند و از طرق مختلف دیگر با اشیاء رشته‌ای مرتبط هستند." #: library/stdtypes.rst:2554 -msgid "Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a ``b`` prefix is added:" +#, fuzzy +msgid "" +"Firstly, the syntax for bytes literals is largely the same as that for " +"string literals, except that a ``b`` prefix is added:" msgstr "" +"اولاً، نحو برای بایت‌ها تا حد زیادی شبیه به حرف‌های رشته‌ای است، با این " +"تفاوت که پیشوند ``b`` اضافه می‌شود:" #: library/stdtypes.rst:2557 +#, fuzzy msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" -msgstr "" +msgstr "نقل قول تک: ``b'still allows embedded \"double\" quotes'``" #: library/stdtypes.rst:2558 +#, fuzzy msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" -msgstr "" +msgstr "دو نقل قول: ``b\"still allows embedded 'single' quotes\"``" #: library/stdtypes.rst:2559 +#, fuzzy msgid "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" -msgstr "" +msgstr "نقل قول سه گانه: ``b'''3 single quotes'''``، ``b\"\"\"3 double quotes\"\"\"``" #: library/stdtypes.rst:2561 -msgid "Only ASCII characters are permitted in bytes literals (regardless of the declared source code encoding). Any binary values over 127 must be entered into bytes literals using the appropriate escape sequence." +#, fuzzy +msgid "" +"Only ASCII characters are permitted in bytes literals (regardless of the " +"declared source code encoding). Any binary values over 127 must be entered " +"into bytes literals using the appropriate escape sequence." msgstr "" +"فقط کاراکترهای ASCII به معنای واقعی کلمه مجاز هستند (صرف نظر از رمزگذاری کد " +"منبع اعلام شده). هر مقدار باینری بیش از 127 باید با استفاده از دنباله فرار " +"مناسب در بایت ها وارد شود." #: library/stdtypes.rst:2565 -msgid "As with string literals, bytes literals may also use a ``r`` prefix to disable processing of escape sequences. See :ref:`strings` for more about the various forms of bytes literal, including supported escape sequences." +#, fuzzy +msgid "" +"As with string literals, bytes literals may also use a ``r`` prefix to " +"disable processing of escape sequences. See :ref:`strings` for more about " +"the various forms of bytes literal, including supported escape sequences." msgstr "" +"همانند رشته‌های literal، بایت‌ها نیز ممکن است از پیشوند ``r`` برای غیرفعال " +"کردن پردازش دنباله‌های فرار استفاده کنند. برای اطلاعات بیشتر در مورد اشکال " +"مختلف بایت ها، از جمله توالی های فرار پشتیبانی شده، به :ref:`strings` مراجعه" +" کنید." #: library/stdtypes.rst:2569 -msgid "While bytes literals and representations are based on ASCII text, bytes objects actually behave like immutable sequences of integers, with each value in the sequence restricted such that ``0 <= x < 256`` (attempts to violate this restriction will trigger :exc:`ValueError`). This is done deliberately to emphasise that while many binary formats include ASCII based elements and can be usefully manipulated with some text-oriented algorithms, this is not generally the case for arbitrary binary data (blindly applying text processing algorithms to binary data formats that are not ASCII compatible will usually lead to data corruption)." -msgstr "" +#, fuzzy +msgid "" +"While bytes literals and representations are based on ASCII text, bytes " +"objects actually behave like immutable sequences of integers, with each " +"value in the sequence restricted such that ``0 <= x < 256`` (attempts to " +"violate this restriction will trigger :exc:`ValueError`). This is done " +"deliberately to emphasise that while many binary formats include ASCII based" +" elements and can be usefully manipulated with some text-oriented " +"algorithms, this is not generally the case for arbitrary binary data " +"(blindly applying text processing algorithms to binary data formats that are" +" not ASCII compatible will usually lead to data corruption)." +msgstr "" +"در حالی که واژه‌ها و نمایش‌های بایت‌ها بر اساس متن ASCII هستند، اشیاء " +"بایت‌ها در واقع مانند دنباله‌های غیرقابل تغییر اعداد صحیح رفتار می‌کنند، با " +"هر مقدار در دنباله محدود به‌گونه‌ای که ``0 <= x < 256`` (تلاش برای نقض این " +"محدودیت باعث تحریک :exc:`ValueError` می‌شود). این کار عمداً برای تأکید بر " +"این نکته انجام می‌شود که در حالی که بسیاری از فرمت‌های باینری شامل عناصر " +"مبتنی بر ASCII هستند و می‌توان آن‌ها را با برخی از الگوریتم‌های متن‌محور " +"به‌طور مفید دستکاری کرد، این معمولاً برای داده‌های باینری دلخواه صدق نمی‌کند" +" (استفاده کورکورانه از الگوریتم‌های پردازش متن برای قالب‌های داده باینری که " +"با ASCII سازگار نیستند, معمولاً منجر به خراب شدن داده‌ها می‌شود)." #: library/stdtypes.rst:2579 -msgid "In addition to the literal forms, bytes objects can be created in a number of other ways:" +#, fuzzy +msgid "" +"In addition to the literal forms, bytes objects can be created in a number " +"of other ways:" msgstr "" +"علاوه بر اشکال تحت اللفظی، اشیاء بایت را می توان به روش های دیگری نیز ایجاد " +"کرد:" #: library/stdtypes.rst:2582 +#, fuzzy msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" -msgstr "" +msgstr "یک شی بایت پر از صفر با طول مشخص: ``bytes(10)``" #: library/stdtypes.rst:2583 +#, fuzzy msgid "From an iterable of integers: ``bytes(range(20))``" -msgstr "" +msgstr "از یک تکرارپذیر از اعداد صحیح: ``bytes(range(20))``" #: library/stdtypes.rst:2584 +#, fuzzy msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" -msgstr "" +msgstr "کپی کردن داده های باینری موجود از طریق پروتکل بافر: ``bytes(obj)``" #: library/stdtypes.rst:2586 +#, fuzzy msgid "Also see the :ref:`bytes ` built-in." -msgstr "" +msgstr "همچنین :ref:`bytes ` داخلی را ببینید." #: library/stdtypes.rst:2588 -msgid "Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal numbers are a commonly used format for describing binary data. Accordingly, the bytes type has an additional class method to read data in that format:" +#, fuzzy +msgid "" +"Since 2 hexadecimal digits correspond precisely to a single byte, " +"hexadecimal numbers are a commonly used format for describing binary data. " +"Accordingly, the bytes type has an additional class method to read data in " +"that format:" msgstr "" +"از آنجایی که 2 رقم هگزادسیمال دقیقاً با یک بایت مطابقت دارد، اعداد " +"هگزادسیمال فرمت رایجی برای توصیف داده های باینری هستند. بر این اساس، نوع " +"بایت دارای یک متد کلاس اضافی برای خواندن داده ها در آن قالب است:" #: library/stdtypes.rst:2594 -msgid "This :class:`bytes` class method returns a bytes object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored." +#, fuzzy +msgid "" +"This :class:`bytes` class method returns a bytes object, decoding the given " +"string object. The string must contain two hexadecimal digits per byte, " +"with ASCII whitespace being ignored." msgstr "" +"این متد کلاس :class:`bytes` یک شی بایت را برمی گرداند و شی رشته داده شده را " +"رمزگشایی می کند. رشته باید دارای دو رقم هگزا دسیمال در هر بایت باشد و فضای " +"سفید ASCII نادیده گرفته شود." #: library/stdtypes.rst:2601 -msgid ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just spaces." +#, fuzzy +msgid "" +":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just" +" spaces." msgstr "" +"اکنون :meth:`bytes.fromhex` از تمام فضاهای سفید ASCII در رشته صرفنظر می کند،" +" نه فقط فضاها." #: library/stdtypes.rst:2605 -msgid "A reverse conversion function exists to transform a bytes object into its hexadecimal representation." +#, fuzzy +msgid "" +"A reverse conversion function exists to transform a bytes object into its " +"hexadecimal representation." msgstr "" +"یک تابع تبدیل معکوس برای تبدیل یک شی بایت به نمایش هگزادسیمال آن وجود دارد." -#: library/stdtypes.rst:2610 -#: library/stdtypes.rst:2695 -msgid "Return a string object containing two hexadecimal digits for each byte in the instance." +#: library/stdtypes.rst:2610 library/stdtypes.rst:2695 +#, fuzzy +msgid "" +"Return a string object containing two hexadecimal digits for each byte in " +"the instance." msgstr "" +"یک شی رشته حاوی دو رقم هگزا دسیمال برای هر بایت موجود در نمونه برگردانید." #: library/stdtypes.rst:2616 -msgid "If you want to make the hex string easier to read, you can specify a single character separator *sep* parameter to include in the output. By default, this separator will be included between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values calculate the separator position from the right, negative values from the left." -msgstr "" +#, fuzzy +msgid "" +"If you want to make the hex string easier to read, you can specify a single " +"character separator *sep* parameter to include in the output. By default, " +"this separator will be included between each byte. A second optional " +"*bytes_per_sep* parameter controls the spacing. Positive values calculate " +"the separator position from the right, negative values from the left." +msgstr "" +"اگر می‌خواهید خوانش رشته هگزا را آسان‌تر کنید، می‌توانید یک پارامتر جداکننده" +" نویسه *sep* را برای درج در خروجی مشخص کنید. به طور پیش فرض، این جداکننده " +"بین هر بایت قرار می گیرد. دومین پارامتر اختیاری *bytes_per_sep* فاصله را " +"کنترل می کند. مقادیر مثبت موقعیت جداکننده را از سمت راست و مقادیر منفی از " +"سمت چپ محاسبه می کنند." #: library/stdtypes.rst:2633 -msgid ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output." +#, fuzzy +msgid "" +":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters" +" to insert separators between bytes in the hex output." msgstr "" +":meth:`bytes.hex` اکنون از پارامترهای اختیاری *sep* و *bytes_per_sep* برای " +"قرار دادن جداکننده ها بین بایت ها در خروجی هگز پشتیبانی می کند." #: library/stdtypes.rst:2637 -msgid "Since bytes objects are sequences of integers (akin to a tuple), for a bytes object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1)" +#, fuzzy +msgid "" +"Since bytes objects are sequences of integers (akin to a tuple), for a bytes" +" object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " +"object of length 1. (This contrasts with text strings, where both indexing " +"and slicing will produce a string of length 1)" msgstr "" +"از آنجایی که اشیاء بایت دنباله ای از اعداد صحیح هستند (مشابه یک تاپلی), برای" +" یک شی بایتی *b*، ``b[0]`` یک عدد صحیح خواهد بود، در حالی که ``b[0:1]`` یک " +"شی بایت به طول 1 خواهد بود. (این در تضاد با رشته های متنی است, جایی که هر دو" +" نمایه سازی و برش رشته ای به طول 1 تولید می کنند)" #: library/stdtypes.rst:2642 -msgid "The representation of bytes objects uses the literal format (``b'...'``) since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a list of integers using ``list(b)``." +#, fuzzy +msgid "" +"The representation of bytes objects uses the literal format (``b'...'``) " +"since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " +"always convert a bytes object into a list of integers using ``list(b)``." msgstr "" +"نمایش اشیاء بایت از فرمت تحت اللفظی (``b'...'``) استفاده می کند زیرا اغلب " +"مفیدتر از مثال است. ``bytes([46, 46, 46])``. همیشه می توانید با استفاده از " +"``list(b)`` یک شی بایت را به لیستی از اعداد صحیح تبدیل کنید." #: library/stdtypes.rst:2650 +#, fuzzy msgid "Bytearray Objects" -msgstr "" +msgstr "اشیاء بایت آرایه" #: library/stdtypes.rst:2654 -msgid ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` objects." +#, fuzzy +msgid "" +":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " +"objects." msgstr "" +"اشیاء :class:`bytearray` همتای قابل تغییر برای اشیاء :class:`bytes` هستند." #: library/stdtypes.rst:2659 -msgid "There is no dedicated literal syntax for bytearray objects, instead they are always created by calling the constructor:" +#, fuzzy +msgid "" +"There is no dedicated literal syntax for bytearray objects, instead they are" +" always created by calling the constructor:" msgstr "" +"هیچ نحو اختصاصی اختصاصی برای اشیاء بایت آرایه وجود ندارد، در عوض آنها همیشه " +"با فراخوانی سازنده ایجاد می شوند:" #: library/stdtypes.rst:2662 +#, fuzzy msgid "Creating an empty instance: ``bytearray()``" -msgstr "" +msgstr "ایجاد یک نمونه خالی: ``bytearray()``" #: library/stdtypes.rst:2663 +#, fuzzy msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" -msgstr "" +msgstr "ایجاد یک نمونه پر از صفر با طول معین: ``bytearray(10)``" #: library/stdtypes.rst:2664 +#, fuzzy msgid "From an iterable of integers: ``bytearray(range(20))``" -msgstr "" +msgstr "از یک تکرارپذیر از اعداد صحیح: ``bytearray(range(20))``" #: library/stdtypes.rst:2665 -msgid "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" +#, fuzzy +msgid "" +"Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" +"کپی کردن داده های باینری موجود از طریق پروتکل بافر: ``bytearray(b'Hi!')``" #: library/stdtypes.rst:2667 -msgid "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray operations described in :ref:`bytes-methods`." +#, fuzzy +msgid "" +"As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " +"operations described in :ref:`bytes-methods`." msgstr "" +"از آنجایی که اشیاء بایت آرایه قابل تغییر هستند، از عملیات توالی " +":ref:`mutable ` علاوه بر بایت های رایج و عملیات بایت آرایه" +" که در :ref:`bytes-methods` توضیح داده شده است، پشتیبانی می کنند." #: library/stdtypes.rst:2671 +#, fuzzy msgid "Also see the :ref:`bytearray ` built-in." -msgstr "" +msgstr "همچنین :ref:`bytearray ` داخلی را ببینید." #: library/stdtypes.rst:2673 -msgid "Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal numbers are a commonly used format for describing binary data. Accordingly, the bytearray type has an additional class method to read data in that format:" +#, fuzzy +msgid "" +"Since 2 hexadecimal digits correspond precisely to a single byte, " +"hexadecimal numbers are a commonly used format for describing binary data. " +"Accordingly, the bytearray type has an additional class method to read data " +"in that format:" msgstr "" +"از آنجایی که 2 رقم هگزادسیمال دقیقاً با یک بایت مطابقت دارد، اعداد " +"هگزادسیمال فرمت رایجی برای توصیف داده های باینری هستند. بر این اساس، نوع " +"بایت آرایه یک متد کلاس اضافی برای خواندن داده ها در آن قالب دارد:" #: library/stdtypes.rst:2679 -msgid "This :class:`bytearray` class method returns bytearray object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored." +#, fuzzy +msgid "" +"This :class:`bytearray` class method returns bytearray object, decoding the " +"given string object. The string must contain two hexadecimal digits per " +"byte, with ASCII whitespace being ignored." msgstr "" +"این متد کلاس :class:`bytearray` شی بایت آرایه را برمی گرداند و شی رشته داده " +"شده را رمزگشایی می کند. رشته باید شامل دو رقم هگزا دسیمال در هر بایت باشد و" +" فضای سفید ASCII نادیده گرفته شود." #: library/stdtypes.rst:2686 -msgid ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not just spaces." +#, fuzzy +msgid "" +":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " +"just spaces." msgstr "" +"اکنون :meth:`bytearray.fromhex` از تمام فضاهای سفید ASCII در رشته صرفنظر می " +"کند، نه فقط فضاها." #: library/stdtypes.rst:2690 -msgid "A reverse conversion function exists to transform a bytearray object into its hexadecimal representation." +#, fuzzy +msgid "" +"A reverse conversion function exists to transform a bytearray object into " +"its hexadecimal representation." msgstr "" +"یک تابع تبدیل معکوس برای تبدیل یک شی بایت آرایه به نمایش هگزادسیمال آن وجود " +"دارد." #: library/stdtypes.rst:2703 -msgid "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output." +#, fuzzy +msgid "" +"Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " +"*sep* and *bytes_per_sep* parameters to insert separators between bytes in " +"the hex output." msgstr "" +"مشابه :meth:`bytes.hex`، :meth:`bytearray.hex` اکنون از پارامترهای اختیاری " +"*sep* و *bytes_per_sep* برای قرار دادن جداکننده ها بین بایت ها در خروجی هگز " +"پشتیبانی می کند." #: library/stdtypes.rst:2708 -msgid "Since bytearray objects are sequences of integers (akin to a list), for a bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytearray object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1)" +#, fuzzy +msgid "" +"Since bytearray objects are sequences of integers (akin to a list), for a " +"bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " +"a bytearray object of length 1. (This contrasts with text strings, where " +"both indexing and slicing will produce a string of length 1)" msgstr "" +"از آنجا که اشیاء بایت آرایه دنباله ای از اعداد صحیح هستند (مشابه یک لیست), " +"برای یک شی بایت آرایه *b*، ``b[0]`` یک عدد صحیح خواهد بود، در حالی که " +"``b[0:1]`` یک شی آرایه بایتی به طول 1 خواهد بود." #: library/stdtypes.rst:2713 -msgid "The representation of bytearray objects uses the bytes literal format (``bytearray(b'...')``) since it is often more useful than e.g. ``bytearray([46, 46, 46])``. You can always convert a bytearray object into a list of integers using ``list(b)``." +#, fuzzy +msgid "" +"The representation of bytearray objects uses the bytes literal format " +"(``bytearray(b'...')``) since it is often more useful than e.g. " +"``bytearray([46, 46, 46])``. You can always convert a bytearray object into" +" a list of integers using ``list(b)``." msgstr "" +"نمایش اشیاء بایت آرایه از فرمت تحت اللفظی بایت (``bytearray(b'...')``) " +"استفاده می‌کند، زیرا اغلب مفیدتر از مانند مثال است. ``bytearray([46, 46, " +"46])``. همیشه می توانید یک شی بایت آرایه را با استفاده از ``list(b)`` به " +"لیستی از اعداد صحیح تبدیل کنید." #: library/stdtypes.rst:2722 +#, fuzzy msgid "Bytes and Bytearray Operations" -msgstr "" +msgstr "بایت ها و عملیات بیت آرایه" #: library/stdtypes.rst:2727 -msgid "Both bytes and bytearray objects support the :ref:`common ` sequence operations. They interoperate not just with operands of the same type, but with any :term:`bytes-like object`. Due to this flexibility, they can be freely mixed in operations without causing errors. However, the return type of the result may depend on the order of operands." -msgstr "" +#, fuzzy +msgid "" +"Both bytes and bytearray objects support the :ref:`common `" +" sequence operations. They interoperate not just with operands of the same " +"type, but with any :term:`bytes-like object`. Due to this flexibility, they " +"can be freely mixed in operations without causing errors. However, the " +"return type of the result may depend on the order of operands." +msgstr "" +"هم بایت ها و هم اشیاء بایت آرایه از عملیات توالی :ref:`common ` پشتیبانی می کنند. آنها نه تنها با عملوندهای هم نوع، بلکه با هر " +":term:`bytes-like object` تعامل دارند. با توجه به این انعطاف، می توان آنها " +"را آزادانه در عملیات بدون ایجاد خطا مخلوط کرد. با این حال، نوع برگشتی نتیجه " +"ممکن است به ترتیب عملوندها بستگی داشته باشد." #: library/stdtypes.rst:2735 -msgid "The methods on bytes and bytearray objects don't accept strings as their arguments, just as the methods on strings don't accept bytes as their arguments. For example, you have to write::" +#, fuzzy +msgid "" +"The methods on bytes and bytearray objects don't accept strings as their " +"arguments, just as the methods on strings don't accept bytes as their " +"arguments. For example, you have to write::" msgstr "" +"متدهای روی بایت ها و اشیاء بایت آرگومان رشته ها را نمی پذیرند، همانطور که " +"متدهای روی رشته ها بایت ها را به عنوان آرگومان های خود نمی پذیرند. برای " +"مثال باید بنویسید:" #: library/stdtypes.rst:2739 -msgid "a = \"abc\"\n" +#, fuzzy +msgid "" +"a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" msgstr "" +"a = \"abc\"\n" +"b = a.replace(\"a\", \"f\")" #: library/stdtypes.rst:2742 +#, fuzzy msgid "and::" -msgstr "" +msgstr "و::" #: library/stdtypes.rst:2744 -msgid "a = b\"abc\"\n" +#, fuzzy +msgid "" +"a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" msgstr "" +"a = b\"abc\"\n" +"b = a.replace(b\"a\", b\"f\")" #: library/stdtypes.rst:2747 -msgid "Some bytes and bytearray operations assume the use of ASCII compatible binary formats, and hence should be avoided when working with arbitrary binary data. These restrictions are covered below." +#, fuzzy +msgid "" +"Some bytes and bytearray operations assume the use of ASCII compatible " +"binary formats, and hence should be avoided when working with arbitrary " +"binary data. These restrictions are covered below." msgstr "" +"برخی از بایت‌ها و عملیات بایت آرایه استفاده از فرمت‌های باینری سازگار با " +"ASCII را فرض می‌کنند و بنابراین هنگام کار با داده‌های باینری دلخواه باید از " +"آنها اجتناب شود. این محدودیت ها در زیر پوشش داده شده است." #: library/stdtypes.rst:2752 -msgid "Using these ASCII based operations to manipulate binary data that is not stored in an ASCII based format may lead to data corruption." +#, fuzzy +msgid "" +"Using these ASCII based operations to manipulate binary data that is not " +"stored in an ASCII based format may lead to data corruption." msgstr "" +"استفاده از این عملیات مبتنی بر ASCII برای دستکاری داده های باینری که در قالب" +" ASCII ذخیره نشده اند ممکن است منجر به خراب شدن داده ها شود." #: library/stdtypes.rst:2755 -msgid "The following methods on bytes and bytearray objects can be used with arbitrary binary data." +#, fuzzy +msgid "" +"The following methods on bytes and bytearray objects can be used with " +"arbitrary binary data." msgstr "" +"روش های زیر بر روی بایت ها و اشیاء آرایه بایتی را می توان با داده های باینری" +" دلخواه استفاده کرد." #: library/stdtypes.rst:2761 -msgid "Return the number of non-overlapping occurrences of subsequence *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation." +#, fuzzy +msgid "" +"Return the number of non-overlapping occurrences of subsequence *sub* in the" +" range [*start*, *end*]. Optional arguments *start* and *end* are " +"interpreted as in slice notation." msgstr "" +"تعداد رخدادهای غیر همپوشانی دنباله *sub* را در محدوده [*start*, *end*] " +"برگردانید. آرگومان های اختیاری *start* و *end* به صورت نمادگذاری برش تفسیر " +"می شوند." -#: library/stdtypes.rst:2765 -#: library/stdtypes.rst:2870 -#: library/stdtypes.rst:2892 -#: library/stdtypes.rst:2958 +#: library/stdtypes.rst:2765 library/stdtypes.rst:2870 +#: library/stdtypes.rst:2892 library/stdtypes.rst:2958 #: library/stdtypes.rst:2971 -msgid "The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255." +#, fuzzy +msgid "" +"The subsequence to search for may be any :term:`bytes-like object` or an " +"integer in the range 0 to 255." msgstr "" +"دنباله ای که باید جستجو شود ممکن است هر :term:`bytes-like object` یا یک عدد " +"صحیح در محدوده 0 تا 255 باشد." #: library/stdtypes.rst:2768 -msgid "If *sub* is empty, returns the number of empty slices between characters which is the length of the bytes object plus one." +#, fuzzy +msgid "" +"If *sub* is empty, returns the number of empty slices between characters " +"which is the length of the bytes object plus one." msgstr "" +"اگر *sub* خالی باشد، تعداد برش های خالی بین کاراکترها را برمی گرداند که طول " +"شی بایت به اضافه یک است." -#: library/stdtypes.rst:2771 -#: library/stdtypes.rst:2882 -#: library/stdtypes.rst:2895 -#: library/stdtypes.rst:2961 +#: library/stdtypes.rst:2771 library/stdtypes.rst:2882 +#: library/stdtypes.rst:2895 library/stdtypes.rst:2961 #: library/stdtypes.rst:2974 +#, fuzzy msgid "Also accept an integer in the range 0 to 255 as the subsequence." -msgstr "" +msgstr "همچنین یک عدد صحیح در محدوده 0 تا 255 را به عنوان دنباله قبول کنید." #: library/stdtypes.rst:2778 -msgid "If the binary data starts with the *prefix* string, return ``bytes[len(prefix):]``. Otherwise, return a copy of the original binary data::" +#, fuzzy +msgid "" +"If the binary data starts with the *prefix* string, return " +"``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " +"data::" msgstr "" +"اگر داده های باینری با رشته *prefix* شروع می شود، ``bytes[len(prefix):]`` را" +" برگردانید. در غیر این صورت، یک کپی از داده های باینری اصلی را برگردانید::" #: library/stdtypes.rst:2782 -msgid ">>> b'TestHook'.removeprefix(b'Test')\n" +#, fuzzy +msgid "" +">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" msgstr "" +">>> b'TestHook'.removeprefix(b'Test')\n" +"b'Hook'\n" +">>> b'BaseTestCase'.removeprefix(b'Test')\n" +"b'BaseTestCase'" #: library/stdtypes.rst:2787 +#, fuzzy msgid "The *prefix* may be any :term:`bytes-like object`." -msgstr "" - -#: library/stdtypes.rst:2791 -#: library/stdtypes.rst:2813 -#: library/stdtypes.rst:2946 -#: library/stdtypes.rst:3039 -#: library/stdtypes.rst:3053 -#: library/stdtypes.rst:3084 -#: library/stdtypes.rst:3098 -#: library/stdtypes.rst:3140 -#: library/stdtypes.rst:3211 -#: library/stdtypes.rst:3229 -#: library/stdtypes.rst:3257 -#: library/stdtypes.rst:3396 -#: library/stdtypes.rst:3451 -#: library/stdtypes.rst:3494 -#: library/stdtypes.rst:3515 -#: library/stdtypes.rst:3537 +msgstr "*prefix* ممکن است هر :term:`bytes-like object` باشد." + +#: library/stdtypes.rst:2791 library/stdtypes.rst:2813 +#: library/stdtypes.rst:2946 library/stdtypes.rst:3039 +#: library/stdtypes.rst:3053 library/stdtypes.rst:3084 +#: library/stdtypes.rst:3098 library/stdtypes.rst:3140 +#: library/stdtypes.rst:3211 library/stdtypes.rst:3229 +#: library/stdtypes.rst:3257 library/stdtypes.rst:3396 +#: library/stdtypes.rst:3451 library/stdtypes.rst:3494 +#: library/stdtypes.rst:3515 library/stdtypes.rst:3537 #: library/stdtypes.rst:3739 -msgid "The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made." +#, fuzzy +msgid "" +"The bytearray version of this method does *not* operate in place - it always" +" produces a new object, even if no changes were made." msgstr "" +"نسخه بایت آرایه این روش *not* در جای خود کار می کند - همیشه یک شی جدید تولید" +" می کند، حتی اگر هیچ تغییری ایجاد نشده باشد." #: library/stdtypes.rst:2800 -msgid "If the binary data ends with the *suffix* string and that *suffix* is not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the original binary data::" +#, fuzzy +msgid "" +"If the binary data ends with the *suffix* string and that *suffix* is not " +"empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " +"original binary data::" msgstr "" +"اگر داده های باینری به رشته *suffix* ختم می شود و *suffix* خالی نیست، " +"``bytes[:-len(suffix)]`` را برگردانید. در غیر این صورت، یک کپی از داده های " +"باینری اصلی را برگردانید::" #: library/stdtypes.rst:2804 -msgid ">>> b'MiscTests'.removesuffix(b'Tests')\n" +#, fuzzy +msgid "" +">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" msgstr "" +">>> b'MiscTests'.removesuffix(b'Tests')\n" +"b'Misc'\n" +">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" +"b'TmpDirMixin'" #: library/stdtypes.rst:2809 +#, fuzzy msgid "The *suffix* may be any :term:`bytes-like object`." -msgstr "" +msgstr "*suffix* ممکن است هر :term:`bytes-like object` باشد." #: library/stdtypes.rst:2822 +#, fuzzy msgid "Return the bytes decoded to a :class:`str`." -msgstr "" +msgstr "بایت های رمزگشایی شده را به :class:`str` برگردانید." #: library/stdtypes.rst:2827 -msgid "*errors* controls how decoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details." +#, fuzzy +msgid "" +"*errors* controls how decoding errors are handled. If ``'strict'`` (the " +"default), a :exc:`UnicodeError` exception is raised. Other possible values " +"are ``'ignore'``, ``'replace'``, and any other name registered via " +":func:`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" +"*errors* نحوه رسیدگی به خطاهای رمزگشایی را کنترل می کند. اگر ``'strict'`` " +"(پیش فرض), یک استثنا :exc:`UnicodeError` مطرح می شود. مقادیر احتمالی دیگر " +"``'ignore'``، ``'replace'`` و هر نام دیگری که از طریق " +":func:`codecs.register_error` ثبت شده است می باشد. برای جزئیات بیشتر به " +":ref:`error-handlers` مراجعه کنید." #: library/stdtypes.rst:2833 -msgid "For performance reasons, the value of *errors* is not checked for validity unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build ` is used." +#, fuzzy +msgid "" +"For performance reasons, the value of *errors* is not checked for validity " +"unless a decoding error actually occurs, :ref:`devmode` is enabled or a " +":ref:`debug build ` is used." msgstr "" +"به دلایل عملکرد، مقدار *errors* از نظر اعتبار بررسی نمی شود، مگر اینکه " +"واقعاً یک خطای رمزگشایی رخ دهد، :ref:`devmode` فعال شود یا از :ref:`debug " +"build ` استفاده شود." #: library/stdtypes.rst:2839 -msgid "Passing the *encoding* argument to :class:`str` allows decoding any :term:`bytes-like object` directly, without needing to make a temporary :class:`!bytes` or :class:`!bytearray` object." +#, fuzzy +msgid "" +"Passing the *encoding* argument to :class:`str` allows decoding any " +":term:`bytes-like object` directly, without needing to make a temporary " +":class:`!bytes` or :class:`!bytearray` object." msgstr "" +"ارسال آرگومان *encoding* به :class:`str` امکان رمزگشایی مستقیم هر " +":term:`bytes-like object` را بدون نیاز به ایجاد یک شی موقت :class:`!bytes` " +"یا :class:`!bytearray` می دهد." #: library/stdtypes.rst:2854 -msgid "Return ``True`` if the binary data ends with the specified *suffix*, otherwise return ``False``. *suffix* can also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position." +#, fuzzy +msgid "" +"Return ``True`` if the binary data ends with the specified *suffix*, " +"otherwise return ``False``. *suffix* can also be a tuple of suffixes to " +"look for. With optional *start*, test beginning at that position. With " +"optional *end*, stop comparing at that position." msgstr "" +"اگر داده های باینری به *suffix* مشخص شده ختم شود، ``True`` را برگردانید، در " +"غیر این صورت ``False`` را برگردانید. *suffix* همچنین می تواند چندین پسوند " +"باشد که باید به دنبال آن باشید. با *start* اختیاری، آزمایش را از همان " +"موقعیت شروع کنید. با *end* اختیاری، مقایسه را در آن موقعیت متوقف کنید." #: library/stdtypes.rst:2859 +#, fuzzy msgid "The suffix(es) to search for may be any :term:`bytes-like object`." -msgstr "" +msgstr "پسوند(های) مورد جستجو ممکن است هر :term:`bytes-like object` باشد." #: library/stdtypes.rst:2865 -msgid "Return the lowest index in the data where the subsequence *sub* is found, such that *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found." +#, fuzzy +msgid "" +"Return the lowest index in the data where the subsequence *sub* is found, " +"such that *sub* is contained in the slice ``s[start:end]``. Optional " +"arguments *start* and *end* are interpreted as in slice notation. Return " +"``-1`` if *sub* is not found." msgstr "" +"کمترین شاخص را در داده‌هایی که دنباله *sub* یافت می‌شود، برگردانید، به طوری " +"که *sub* در برش ``s[start:end]`` وجود دارد. آرگومان های اختیاری *start* و " +"*end* به صورت نمادگذاری برش تفسیر می شوند. اگر *sub* یافت نشد، ``-1`` را " +"برگردانید." #: library/stdtypes.rst:2875 -msgid "The :meth:`~bytes.find` method should be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::" +#, fuzzy +msgid "" +"The :meth:`~bytes.find` method should be used only if you need to know the " +"position of *sub*. To check if *sub* is a substring or not, use the " +":keyword:`in` operator::" msgstr "" +"روش :meth:`~bytes.find` فقط در صورتی باید استفاده شود که باید موقعیت *sub* " +"را بدانید. برای بررسی اینکه آیا *sub* یک رشته فرعی است یا نه، از عملگر " +":keyword:`in` استفاده کنید:" #: library/stdtypes.rst:2879 -msgid ">>> b'Py' in b'Python'\n" +#, fuzzy +msgid "" +">>> b'Py' in b'Python'\n" "True" msgstr "" +">>> b'Py' in b'Python'\n" +"True" #: library/stdtypes.rst:2889 -msgid "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence is not found." +#, fuzzy +msgid "" +"Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " +"is not found." msgstr "" +"مانند :meth:`~bytes.find`، اما زمانی که دنباله بعدی پیدا نشد، " +":exc:`ValueError` را بالا ببرید." #: library/stdtypes.rst:2902 -msgid "Return a bytes or bytearray object which is the concatenation of the binary data sequences in *iterable*. A :exc:`TypeError` will be raised if there are any values in *iterable* that are not :term:`bytes-like objects `, including :class:`str` objects. The separator between elements is the contents of the bytes or bytearray object providing this method." -msgstr "" +#, fuzzy +msgid "" +"Return a bytes or bytearray object which is the concatenation of the binary " +"data sequences in *iterable*. A :exc:`TypeError` will be raised if there " +"are any values in *iterable* that are not :term:`bytes-like objects `, including :class:`str` objects. The separator between " +"elements is the contents of the bytes or bytearray object providing this " +"method." +msgstr "" +"یک بایت یا شی بایت آرایه که الحاق توالی داده های باینری در *iterable* است را" +" برگردانید. اگر مقادیری در *iterable* وجود داشته باشد که :term:`bytes-like " +"objects ` نیستند، از جمله اشیاء :class:`str`، یک " +":exc:`TypeError` بالا می رود. جداکننده بین عناصر محتویات بایت ها یا شی بایت" +" آرایه است که این روش را ارائه می دهد." #: library/stdtypes.rst:2913 -msgid "This static method returns a translation table usable for :meth:`bytes.translate` that will map each character in *from* into the character at the same position in *to*; *from* and *to* must both be :term:`bytes-like objects ` and have the same length." +#, fuzzy +msgid "" +"This static method returns a translation table usable for " +":meth:`bytes.translate` that will map each character in *from* into the " +"character at the same position in *to*; *from* and *to* must both be " +":term:`bytes-like objects ` and have the same length." msgstr "" +"این روش استاتیک یک جدول ترجمه قابل استفاده برای :meth:`bytes.translate` را " +"برمی گرداند که هر کاراکتر در *from* را به کاراکتر در همان موقعیت در *to* " +"نگاشت می کند. *from* و *to* هر دو باید :term:`bytes-like objects ` باشند و طول یکسانی داشته باشند." #: library/stdtypes.rst:2924 -msgid "Split the sequence at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects." -msgstr "" - -#: library/stdtypes.rst:2931 -#: library/stdtypes.rst:2988 +#, fuzzy +msgid "" +"Split the sequence at the first occurrence of *sep*, and return a 3-tuple " +"containing the part before the separator, the separator itself or its " +"bytearray copy, and the part after the separator. If the separator is not " +"found, return a 3-tuple containing a copy of the original sequence, followed" +" by two empty bytes or bytearray objects." +msgstr "" +"دنباله را در اولین رخداد *sep* تقسیم کنید و یک 3 تایی حاوی قسمت قبل از " +"جداکننده، خود جداکننده یا کپی آرایه بایتی آن و قسمت بعد از جداکننده را " +"برگردانید. اگر جداکننده پیدا نشد، یک 3 تایی حاوی یک کپی از دنباله اصلی و به " +"دنبال آن دو بایت خالی یا شی بایت آرایه برگردانید." + +#: library/stdtypes.rst:2931 library/stdtypes.rst:2988 +#, fuzzy msgid "The separator to search for may be any :term:`bytes-like object`." -msgstr "" +msgstr "جداکننده برای جستجو ممکن است هر :term:`bytes-like object` باشد." #: library/stdtypes.rst:2937 -msgid "Return a copy of the sequence with all occurrences of subsequence *old* replaced by *new*. If the optional argument *count* is given, only the first *count* occurrences are replaced." +#, fuzzy +msgid "" +"Return a copy of the sequence with all occurrences of subsequence *old* " +"replaced by *new*. If the optional argument *count* is given, only the " +"first *count* occurrences are replaced." msgstr "" +"یک کپی از دنباله را با همه تکرارهای بعدی *old* با *new* برگردانید. اگر " +"آرگومان اختیاری *count* داده شود، تنها اولین رخدادهای *count* جایگزین می " +"شوند." #: library/stdtypes.rst:2941 -msgid "The subsequence to search for and its replacement may be any :term:`bytes-like object`." +#, fuzzy +msgid "" +"The subsequence to search for and its replacement may be any :term:`bytes-" +"like object`." msgstr "" +"دنباله جستجو و جایگزینی آن ممکن است هر :term:`bytes-like object` باشد." #: library/stdtypes.rst:2953 -msgid "Return the highest index in the sequence where the subsequence *sub* is found, such that *sub* is contained within ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` on failure." +#, fuzzy +msgid "" +"Return the highest index in the sequence where the subsequence *sub* is " +"found, such that *sub* is contained within ``s[start:end]``. Optional " +"arguments *start* and *end* are interpreted as in slice notation. Return " +"``-1`` on failure." msgstr "" +"بالاترین شاخص را در دنباله ای که دنباله فرعی *sub* یافت می شود، برگردانید، " +"به طوری که *sub* در ``s[start:end]`` قرار دارد. آرگومان های اختیاری *start*" +" و *end* به صورت نمادگذاری برش تفسیر می شوند. ``-1`` را در صورت خرابی " +"برگردانید." #: library/stdtypes.rst:2968 -msgid "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence *sub* is not found." +#, fuzzy +msgid "" +"Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " +"*sub* is not found." msgstr "" +"مانند :meth:`~bytes.rfind` اما وقتی دنباله *sub* یافت نشد :exc:`ValueError` " +"را افزایش می دهد." #: library/stdtypes.rst:2981 -msgid "Split the sequence at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty bytes or bytearray objects, followed by a copy of the original sequence." +#, fuzzy +msgid "" +"Split the sequence at the last occurrence of *sep*, and return a 3-tuple " +"containing the part before the separator, the separator itself or its " +"bytearray copy, and the part after the separator. If the separator is not " +"found, return a 3-tuple containing two empty bytes or bytearray objects, " +"followed by a copy of the original sequence." msgstr "" +"دنباله را در آخرین رخداد *sep* تقسیم کنید و یک 3 تایی حاوی قسمت قبل از " +"جداکننده، خود جداکننده یا کپی آرایه بایتی آن و قسمت بعد از جداکننده را " +"برگردانید. اگر جداکننده پیدا نشد، یک 3 تاپل حاوی دو بایت خالی یا شی بایت " +"آرایه و به دنبال آن یک کپی از دنباله اصلی برگردانید." #: library/stdtypes.rst:2994 -msgid "Return ``True`` if the binary data starts with the specified *prefix*, otherwise return ``False``. *prefix* can also be a tuple of prefixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position." +#, fuzzy +msgid "" +"Return ``True`` if the binary data starts with the specified *prefix*, " +"otherwise return ``False``. *prefix* can also be a tuple of prefixes to " +"look for. With optional *start*, test beginning at that position. With " +"optional *end*, stop comparing at that position." msgstr "" +"اگر داده های باینری با *prefix* مشخص شده شروع شد، ``True`` را برگردانید، در " +"غیر این صورت ``False`` را برگردانید. *prefix* همچنین می تواند چندین پیشوند " +"برای جستجو باشد. با *start* اختیاری، آزمایش را از همان موقعیت شروع کنید. " +"با *end* اختیاری، مقایسه را در آن موقعیت متوقف کنید." #: library/stdtypes.rst:2999 +#, fuzzy msgid "The prefix(es) to search for may be any :term:`bytes-like object`." -msgstr "" +msgstr "پیشوند(های) مورد جستجو ممکن است هر :term:`bytes-like object` باشد." #: library/stdtypes.rst:3005 -msgid "Return a copy of the bytes or bytearray object where all bytes occurring in the optional argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes object of length 256." +#, fuzzy +msgid "" +"Return a copy of the bytes or bytearray object where all bytes occurring in " +"the optional argument *delete* are removed, and the remaining bytes have " +"been mapped through the given translation table, which must be a bytes " +"object of length 256." msgstr "" +"یک کپی از بایت‌ها یا شی بایت آرایه را برگردانید که در آن همه بایت‌های موجود " +"در آرگومان اختیاری *delete* حذف می‌شوند و بایت‌های باقی‌مانده از طریق جدول " +"ترجمه داده شده نگاشت شده‌اند، که باید یک شی بایت به طول 256 باشد." #: library/stdtypes.rst:3010 -msgid "You can use the :func:`bytes.maketrans` method to create a translation table." +#, fuzzy +msgid "" +"You can use the :func:`bytes.maketrans` method to create a translation " +"table." msgstr "" +"برای ایجاد جدول ترجمه می توانید از روش :func:`bytes.maketrans` استفاده کنید." #: library/stdtypes.rst:3013 -msgid "Set the *table* argument to ``None`` for translations that only delete characters::" +#, fuzzy +msgid "" +"Set the *table* argument to ``None`` for translations that only delete " +"characters::" msgstr "" +"برای ترجمه هایی که فقط کاراکترها را حذف می کنند، آرگومان *table* را روی " +"``None`` تنظیم کنید:" #: library/stdtypes.rst:3016 -msgid ">>> b'read this short text'.translate(None, b'aeiou')\n" +#, fuzzy +msgid "" +">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" msgstr "" +">>> b'read this short text'.translate(None, b'aeiou')\n" +"b'rd ths shrt txt'" #: library/stdtypes.rst:3019 +#, fuzzy msgid "*delete* is now supported as a keyword argument." -msgstr "" +msgstr "*delete* اکنون به عنوان آرگومان کلمه کلیدی پشتیبانی می شود." #: library/stdtypes.rst:3023 -msgid "The following methods on bytes and bytearray objects have default behaviours that assume the use of ASCII compatible binary formats, but can still be used with arbitrary binary data by passing appropriate arguments. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects." -msgstr "" +#, fuzzy +msgid "" +"The following methods on bytes and bytearray objects have default behaviours" +" that assume the use of ASCII compatible binary formats, but can still be " +"used with arbitrary binary data by passing appropriate arguments. Note that " +"all of the bytearray methods in this section do *not* operate in place, and " +"instead produce new objects." +msgstr "" +"روش‌های زیر روی بایت‌ها و اشیاء بایت آرایه رفتارهای پیش‌فرضی دارند که " +"استفاده از فرمت‌های باینری سازگار با ASCII را فرض می‌کنند، اما همچنان " +"می‌توانند با داده‌های باینری دلخواه با ارسال آرگومان‌های مناسب استفاده شوند." +" توجه داشته باشید که تمام متدهای بایت آرایه در این بخش *not* در جای خود عمل " +"می کنند و در عوض اشیاء جدیدی تولید می کنند." #: library/stdtypes.rst:3032 -msgid "Return a copy of the object centered in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return a copy of the object centered in a sequence of length *width*. " +"Padding is done using the specified *fillbyte* (default is an ASCII space). " +"For :class:`bytes` objects, the original sequence is returned if *width* is " +"less than or equal to ``len(s)``." msgstr "" +"یک کپی از شی در مرکز دنباله ای به طول *width* برگردانید. padding با استفاده " +"از *fillbyte* مشخص شده انجام می شود (پیش فرض یک فضای ASCII است). برای اشیاء " +":class:`bytes`، اگر *width* کمتر یا مساوی با ``len(s)`` باشد، دنباله اصلی " +"برگردانده می شود." #: library/stdtypes.rst:3046 -msgid "Return a copy of the object left justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return a copy of the object left justified in a sequence of length *width*. " +"Padding is done using the specified *fillbyte* (default is an ASCII space). " +"For :class:`bytes` objects, the original sequence is returned if *width* is " +"less than or equal to ``len(s)``." msgstr "" +"یک کپی از شی را که در دنباله ای به طول *width* توجیه شده است، برگردانید. " +"Padding با استفاده از *fillbyte* مشخص شده انجام می شود (پیش فرض یک فضای " +"ASCII است). برای اشیاء :class:`bytes`، اگر *width* کمتر یا مساوی با " +"``len(s)`` باشد، دنباله اصلی برگردانده می شود." #: library/stdtypes.rst:3060 -msgid "Return a copy of the sequence with specified leading bytes removed. The *chars* argument is a binary sequence specifying the set of byte values to be removed - the name refers to the fact this method is usually used with ASCII characters. If omitted or ``None``, the *chars* argument defaults to removing ASCII whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped::" -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the sequence with specified leading bytes removed. The " +"*chars* argument is a binary sequence specifying the set of byte values to " +"be removed - the name refers to the fact this method is usually used with " +"ASCII characters. If omitted or ``None``, the *chars* argument defaults to " +"removing ASCII whitespace. The *chars* argument is not a prefix; rather, " +"all combinations of its values are stripped::" +msgstr "" +"یک کپی از دنباله را با حذف بایت های اصلی مشخص شده برگردانید. آرگومان " +"*chars* یک دنباله باینری است که مجموعه ای از مقادیر بایت را مشخص می کند که " +"باید حذف شوند - این نام به این واقعیت اشاره دارد که این روش معمولاً با " +"کاراکترهای ASCII استفاده می شود. در صورت حذف یا ``None``، آرگومان *chars* " +"به طور پیش‌فرض فضای سفید ASCII را حذف می‌کند. آرگومان *chars* یک پیشوند " +"نیست. بلکه تمام ترکیبات مقادیر آن حذف می شوند::" #: library/stdtypes.rst:3067 -msgid ">>> b' spacious '.lstrip()\n" +#, fuzzy +msgid "" +">>> b' spacious '.lstrip()\n" "b'spacious '\n" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" msgstr "" +">>> b' spacious '.lstrip()\n" +"b'spacious '\n" +">>> b'www.example.com'.lstrip(b'cmowz.')\n" +"b'example.com'" #: library/stdtypes.rst:3072 -msgid "The binary sequence of byte values to remove may be any :term:`bytes-like object`. See :meth:`~bytes.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::" +#, fuzzy +msgid "" +"The binary sequence of byte values to remove may be any :term:`bytes-like " +"object`. See :meth:`~bytes.removeprefix` for a method that will remove a " +"single prefix string rather than all of a set of characters. For example::" msgstr "" +"توالی دودویی مقادیر بایت برای حذف ممکن است هر :term:`bytes-like object` " +"باشد. :meth:`~bytes.removeprefix` را برای روشی ببینید که یک رشته پیشوند واحد" +" را به جای همه مجموعه ای از کاراکترها حذف می کند. به عنوان مثال::" #: library/stdtypes.rst:3077 -msgid ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +#, fuzzy +msgid "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" msgstr "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +"b'ee!'\n" +">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" +"b'three!'" #: library/stdtypes.rst:3091 -msgid "Return a copy of the object right justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(s)``." +#, fuzzy +msgid "" +"Return a copy of the object right justified in a sequence of length *width*." +" Padding is done using the specified *fillbyte* (default is an ASCII space)." +" For :class:`bytes` objects, the original sequence is returned if *width* is" +" less than or equal to ``len(s)``." msgstr "" +"یک کپی از سمت راست شیء توجیه شده در دنباله ای به طول *width* را برگردانید. " +"padding با استفاده از *fillbyte* مشخص شده انجام می شود (پیش فرض یک فضای " +"ASCII است). برای اشیاء :class:`bytes`، اگر *width* کمتر یا مساوی با " +"``len(s)`` باشد، دنباله اصلی برگردانده می شود." #: library/stdtypes.rst:3105 -msgid "Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any subsequence consisting solely of ASCII whitespace is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below." -msgstr "" +#, fuzzy +msgid "" +"Split the binary sequence into subsequences of the same type, using *sep* as" +" the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are" +" done, the *rightmost* ones. If *sep* is not specified or ``None``, any " +"subsequence consisting solely of ASCII whitespace is a separator. Except for" +" splitting from the right, :meth:`rsplit` behaves like :meth:`split` which " +"is described in detail below." +msgstr "" +"با استفاده از *sep* به عنوان رشته جداکننده، دنباله باینری را به دنباله های " +"فرعی از همان نوع تقسیم کنید. اگر *maxsplit* داده شود، حداکثر تقسیم " +"*maxsplit* انجام می شود، آنهایی که *rightmost* هستند. اگر *sep* یا ``None``" +" مشخص نشده باشد، هر دنباله ای که صرفاً از فضای سفید ASCII تشکیل شده باشد، " +"جداکننده است. به جز تقسیم از راست، :meth:`rsplit` مانند :meth:`split` رفتار " +"می کند که در زیر به تفصیل توضیح داده شده است." #: library/stdtypes.rst:3116 -msgid "Return a copy of the sequence with specified trailing bytes removed. The *chars* argument is a binary sequence specifying the set of byte values to be removed - the name refers to the fact this method is usually used with ASCII characters. If omitted or ``None``, the *chars* argument defaults to removing ASCII whitespace. The *chars* argument is not a suffix; rather, all combinations of its values are stripped::" -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the sequence with specified trailing bytes removed. The " +"*chars* argument is a binary sequence specifying the set of byte values to " +"be removed - the name refers to the fact this method is usually used with " +"ASCII characters. If omitted or ``None``, the *chars* argument defaults to " +"removing ASCII whitespace. The *chars* argument is not a suffix; rather, " +"all combinations of its values are stripped::" +msgstr "" +"یک کپی از دنباله را با حذف بایت های انتهایی مشخص شده برگردانید. آرگومان " +"*chars* یک دنباله باینری است که مجموعه ای از مقادیر بایت را مشخص می کند که " +"باید حذف شوند - این نام به این واقعیت اشاره دارد که این روش معمولاً با " +"کاراکترهای ASCII استفاده می شود. در صورت حذف یا ``None``، آرگومان *chars* " +"به طور پیش‌فرض فضای سفید ASCII را حذف می‌کند. آرگومان *chars* پسوند نیست. " +"بلکه تمام ترکیبات مقادیر آن حذف می شوند::" #: library/stdtypes.rst:3123 -msgid ">>> b' spacious '.rstrip()\n" +#, fuzzy +msgid "" +">>> b' spacious '.rstrip()\n" "b' spacious'\n" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" msgstr "" +">>> b' spacious '.rstrip()\n" +"b' spacious'\n" +">>> b'mississippi'.rstrip(b'ipz')\n" +"b'mississ'" #: library/stdtypes.rst:3128 -msgid "The binary sequence of byte values to remove may be any :term:`bytes-like object`. See :meth:`~bytes.removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::" +#, fuzzy +msgid "" +"The binary sequence of byte values to remove may be any :term:`bytes-like " +"object`. See :meth:`~bytes.removesuffix` for a method that will remove a " +"single suffix string rather than all of a set of characters. For example::" msgstr "" +"توالی دودویی مقادیر بایت برای حذف ممکن است هر :term:`bytes-like object` " +"باشد. :meth:`~bytes.removesuffix` را برای روشی ببینید که یک رشته پسوند واحد " +"را به جای همه مجموعه ای از کاراکترها حذف می کند. به عنوان مثال::" #: library/stdtypes.rst:3133 -msgid ">>> b'Monty Python'.rstrip(b' Python')\n" +#, fuzzy +msgid "" +">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" msgstr "" +">>> b'Monty Python'.rstrip(b' Python')\n" +"b'M'\n" +">>> b'Monty Python'.removesuffix(b' Python')\n" +"b'Monty'" #: library/stdtypes.rst:3147 -msgid "Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given and non-negative, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or is ``-1``, then there is no limit on the number of splits (all possible splits are made)." -msgstr "" +#, fuzzy +msgid "" +"Split the binary sequence into subsequences of the same type, using *sep* as" +" the delimiter string. If *maxsplit* is given and non-negative, at most " +"*maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` " +"elements). If *maxsplit* is not specified or is ``-1``, then there is no " +"limit on the number of splits (all possible splits are made)." +msgstr "" +"با استفاده از *sep* به عنوان رشته جداکننده، دنباله باینری را به دنباله های " +"فرعی از همان نوع تقسیم کنید. اگر *maxsplit* داده شود و غیر منفی باشد، حداکثر" +" تقسیم *maxsplit* انجام می شود (بنابراین, لیست حداکثر دارای عناصر " +"``maxsplit+1`` خواهد بود). اگر *maxsplit* مشخص نشده باشد یا ``-1`` باشد، " +"محدودیتی در تعداد تقسیم ها وجود ندارد (همه تقسیم های ممکن انجام می شود)." #: library/stdtypes.rst:3153 -msgid "If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` returns ``[b'1', b'', b'2']``). The *sep* argument may consist of a multibyte sequence as a single delimiter. Splitting an empty sequence with a specified separator returns ``[b'']`` or ``[bytearray(b'')]`` depending on the type of object being split. The *sep* argument may be any :term:`bytes-like object`." -msgstr "" +#, fuzzy +msgid "" +"If *sep* is given, consecutive delimiters are not grouped together and are " +"deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " +"returns ``[b'1', b'', b'2']``). The *sep* argument may consist of a " +"multibyte sequence as a single delimiter. Splitting an empty sequence with a" +" specified separator returns ``[b'']`` or ``[bytearray(b'')]`` depending on " +"the type of object being split. The *sep* argument may be any :term:`bytes-" +"like object`." +msgstr "" +"اگر *sep* داده شود، جداکننده‌های متوالی با هم گروه‌بندی نمی‌شوند و به نظر " +"می‌رسد که دنباله‌های خالی را محدود می‌کنند (برای مثال, " +"``b'1,,2'.split(b',')`` ``[b'1', b'', b'2']`` را برمی‌گرداند). آرگومان " +"*sep* ممکن است از یک دنباله چند بایتی به عنوان یک جداکننده منفرد تشکیل شده " +"باشد. تقسیم یک دنباله خالی با یک جداکننده مشخص, ``[b'']`` یا " +"``[bytearray(b'')]`` را بسته به نوع شیئی که تقسیم می شود، برمی گرداند. " +"آرگومان *sep* ممکن است هر :term:`bytes-like object` باشد." #: library/stdtypes.rst:3163 -msgid ">>> b'1,2,3'.split(b',')\n" +#, fuzzy +msgid "" +">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" ">>> b'1,2,3'.split(b',', maxsplit=1)\n" "[b'1', b'2,3']\n" @@ -3141,204 +6245,484 @@ msgid ">>> b'1,2,3'.split(b',')\n" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" msgstr "" +">>> b'1,2,3'.split(b',')\n" +"[b'1', b'2', b'3']\n" +">>> b'1,2,3'.split(b',', maxsplit=1)\n" +"[b'1', b'2,3']\n" +">>> b'1,2,,3,'.split(b',')\n" +"[b'1', b'2', b'', b'3', b'']\n" +">>> b'1<>2<>3<4'.split(b'<>')\n" +"[b'1', b'2', b'3<4']" #: library/stdtypes.rst:3172 -msgid "If *sep* is not specified or is ``None``, a different splitting algorithm is applied: runs of consecutive ASCII whitespace are regarded as a single separator, and the result will contain no empty strings at the start or end if the sequence has leading or trailing whitespace. Consequently, splitting an empty sequence or a sequence consisting solely of ASCII whitespace without a specified separator returns ``[]``." -msgstr "" +#, fuzzy +msgid "" +"If *sep* is not specified or is ``None``, a different splitting algorithm is" +" applied: runs of consecutive ASCII whitespace are regarded as a single " +"separator, and the result will contain no empty strings at the start or end " +"if the sequence has leading or trailing whitespace. Consequently, splitting" +" an empty sequence or a sequence consisting solely of ASCII whitespace " +"without a specified separator returns ``[]``." +msgstr "" +"اگر *sep* مشخص نشده باشد یا ``None`` باشد، یک الگوریتم تقسیم متفاوت اعمال " +"می‌شود: اجرای فضای سفید متوالی ASCII به عنوان یک جداکننده در نظر گرفته " +"می‌شود و اگر دنباله دارای فضای سفید پیشرو یا انتهایی باشد، نتیجه در ابتدا یا" +" انتهای آن رشته‌های خالی نخواهد داشت. در نتیجه، تقسیم یک دنباله خالی یا یک " +"دنباله متشکل از فضای سفید ASCII بدون جداکننده مشخص، ``[]`` را برمی‌گرداند." #: library/stdtypes.rst:3182 -msgid ">>> b'1 2 3'.split()\n" +#, fuzzy +msgid "" +">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" ">>> b'1 2 3'.split(maxsplit=1)\n" "[b'1', b'2 3']\n" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" msgstr "" +">>> b'1 2 3'.split()\n" +"[b'1', b'2', b'3']\n" +">>> b'1 2 3'.split(maxsplit=1)\n" +"[b'1', b'2 3']\n" +">>> b' 1 2 3 '.split()\n" +"[b'1', b'2', b'3']" #: library/stdtypes.rst:3193 -msgid "Return a copy of the sequence with specified leading and trailing bytes removed. The *chars* argument is a binary sequence specifying the set of byte values to be removed - the name refers to the fact this method is usually used with ASCII characters. If omitted or ``None``, the *chars* argument defaults to removing ASCII whitespace. The *chars* argument is not a prefix or suffix; rather, all combinations of its values are stripped::" -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the sequence with specified leading and trailing bytes " +"removed. The *chars* argument is a binary sequence specifying the set of " +"byte values to be removed - the name refers to the fact this method is " +"usually used with ASCII characters. If omitted or ``None``, the *chars* " +"argument defaults to removing ASCII whitespace. The *chars* argument is not " +"a prefix or suffix; rather, all combinations of its values are stripped::" +msgstr "" +"یک کپی از دنباله را با حذف بایت های اصلی و انتهایی مشخص شده برگردانید. " +"آرگومان *chars* یک دنباله باینری است که مجموعه ای از مقادیر بایت را مشخص می " +"کند که باید حذف شوند - این نام به این واقعیت اشاره دارد که این روش معمولاً " +"با کاراکترهای ASCII استفاده می شود. در صورت حذف یا ``None``، آرگومان " +"*chars* به طور پیش‌فرض فضای سفید ASCII را حذف می‌کند. آرگومان *chars* یک " +"پیشوند یا پسوند نیست. بلکه تمام ترکیبات مقادیر آن حذف می شوند::" #: library/stdtypes.rst:3201 -msgid ">>> b' spacious '.strip()\n" +#, fuzzy +msgid "" +">>> b' spacious '.strip()\n" "b'spacious'\n" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" msgstr "" +">>> b' spacious '.strip()\n" +"b'spacious'\n" +">>> b'www.example.com'.strip(b'cmowz.')\n" +"b'example'" #: library/stdtypes.rst:3206 -msgid "The binary sequence of byte values to remove may be any :term:`bytes-like object`." +#, fuzzy +msgid "" +"The binary sequence of byte values to remove may be any :term:`bytes-like " +"object`." msgstr "" +"توالی دودویی مقادیر بایت برای حذف ممکن است هر :term:`bytes-like object` " +"باشد." #: library/stdtypes.rst:3215 -msgid "The following methods on bytes and bytearray objects assume the use of ASCII compatible binary formats and should not be applied to arbitrary binary data. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects." +#, fuzzy +msgid "" +"The following methods on bytes and bytearray objects assume the use of ASCII" +" compatible binary formats and should not be applied to arbitrary binary " +"data. Note that all of the bytearray methods in this section do *not* " +"operate in place, and instead produce new objects." msgstr "" +"روش‌های زیر روی بایت‌ها و اشیاء بایت آرایه استفاده از فرمت‌های باینری سازگار" +" با ASCII را فرض می‌کنند و نباید برای داده‌های باینری دلخواه اعمال شوند. " +"توجه داشته باشید که تمام متدهای بایت آرایه در این بخش *not* در جای خود عمل " +"می کنند و در عوض اشیاء جدیدی تولید می کنند." #: library/stdtypes.rst:3223 -msgid "Return a copy of the sequence with each byte interpreted as an ASCII character, and the first byte capitalized and the rest lowercased. Non-ASCII byte values are passed through unchanged." +#, fuzzy +msgid "" +"Return a copy of the sequence with each byte interpreted as an ASCII " +"character, and the first byte capitalized and the rest lowercased. Non-ASCII" +" byte values are passed through unchanged." msgstr "" +"یک کپی از دنباله را با هر بایت به عنوان یک کاراکتر ASCII برگردانید و اولین " +"بایت با حروف بزرگ و بقیه با حروف کوچک نوشته شود. مقادیر بایت غیر ASCII بدون " +"تغییر منتقل می شوند." #: library/stdtypes.rst:3236 -msgid "Return a copy of the sequence where all ASCII tab characters are replaced by one or more ASCII spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* bytes (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the sequence, the current column is set to zero and the sequence is examined byte by byte. If the byte is an ASCII tab character (``b'\\t'``), one or more space characters are inserted in the result until the current column is equal to the next tab position. (The tab character itself is not copied.) If the current byte is an ASCII newline (``b'\\n'``) or carriage return (``b'\\r'``), it is copied and the current column is reset to zero. Any other byte value is copied unchanged and the current column is incremented by one regardless of how the byte value is represented when printed::" -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the sequence where all ASCII tab characters are replaced by" +" one or more ASCII spaces, depending on the current column and the given tab" +" size. Tab positions occur every *tabsize* bytes (default is 8, giving tab " +"positions at columns 0, 8, 16 and so on). To expand the sequence, the " +"current column is set to zero and the sequence is examined byte by byte. If" +" the byte is an ASCII tab character (``b'\\t'``), one or more space " +"characters are inserted in the result until the current column is equal to " +"the next tab position. (The tab character itself is not copied.) If the " +"current byte is an ASCII newline (``b'\\n'``) or carriage return " +"(``b'\\r'``), it is copied and the current column is reset to zero. Any " +"other byte value is copied unchanged and the current column is incremented " +"by one regardless of how the byte value is represented when printed::" +msgstr "" +"یک کپی از دنباله ای را برگردانید که در آن همه کاراکترهای برگه ASCII با یک یا" +" چند فاصله ASCII جایگزین می شوند، بسته به ستون فعلی و اندازه برگه داده شده." +" موقعیت های برگه در هر *tabsize* بایت رخ می دهد (پیش فرض 8 است که موقعیت " +"های برگه را در ستون های 0, 8, 16 و غیره می دهد). برای گسترش دنباله، ستون " +"فعلی صفر می شود و دنباله بایت به بایت بررسی می شود. اگر بایت یک کاراکتر " +"برگه ASCII (``b'\\t'``) باشد، یک یا چند کاراکتر فاصله در نتیجه درج می شود تا" +" زمانی که ستون فعلی با موقعیت زبانه بعدی برابر شود. (خود کاراکتر برگه کپی " +"نشده است.) اگر بایت فعلی یک خط جدید ASCII (``b'\\n'``) یا بازگشتی حامل " +"(``b'\\r'``) باشد، کپی می شود و ستون فعلی به صفر بازنشانی می شود. هر مقدار " +"بایت دیگر بدون تغییر کپی می شود و ستون فعلی یک عدد افزایش می یابد، صرف نظر " +"از نحوه نمایش مقدار بایت هنگام چاپ:" #: library/stdtypes.rst:3250 -msgid ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +#, fuzzy +msgid "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" msgstr "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +"b'01 012 0123 01234'\n" +">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"b'01 012 0123 01234'" #: library/stdtypes.rst:3264 -msgid "Return ``True`` if all bytes in the sequence are alphabetical ASCII characters or ASCII decimal digits and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``." -msgstr "" +#, fuzzy +msgid "" +"Return ``True`` if all bytes in the sequence are alphabetical ASCII " +"characters or ASCII decimal digits and the sequence is not empty, ``False`` " +"otherwise. Alphabetic ASCII characters are those byte values in the sequence" +" ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal " +"digits are those byte values in the sequence ``b'0123456789'``." +msgstr "" +"اگر تمام بایت‌های دنباله حروف الفبای اسکی یا ارقام اعشاری ASCII هستند و " +"دنباله خالی نیست، ``True`` را برگردانید، در غیر این صورت ``False``. " +"کاراکترهای ASCII الفبایی آن مقادیر بایت در دنباله " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` هستند. ارقام " +"اعشاری ASCII آن مقادیر بایت در دنباله ``b'0123456789'`` هستند." #: library/stdtypes.rst:3272 -msgid ">>> b'ABCabc1'.isalnum()\n" +#, fuzzy +msgid "" +">>> b'ABCabc1'.isalnum()\n" "True\n" ">>> b'ABC abc1'.isalnum()\n" "False" msgstr "" +">>> b'ABCabc1'.isalnum()\n" +"True\n" +">>> b'ABC abc1'.isalnum()\n" +"False" #: library/stdtypes.rst:3281 -msgid "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." +#, fuzzy +msgid "" +"Return ``True`` if all bytes in the sequence are alphabetic ASCII characters" +" and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " +"characters are those byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" +"اگر همه بایت‌های دنباله حروف الفبای ASCII هستند و دنباله خالی نیست، ``True``" +" را برگردانید، در غیر این صورت ``False`` را برگردانید. کاراکترهای ASCII " +"حروف الفبا آن مقادیر بایت در دنباله " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` هستند." #: library/stdtypes.rst:3288 -msgid ">>> b'ABCabc'.isalpha()\n" +#, fuzzy +msgid "" +">>> b'ABCabc'.isalpha()\n" "True\n" ">>> b'ABCabc1'.isalpha()\n" "False" msgstr "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" #: library/stdtypes.rst:3297 -msgid "Return ``True`` if the sequence is empty or all bytes in the sequence are ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." +#, fuzzy +msgid "" +"Return ``True`` if the sequence is empty or all bytes in the sequence are " +"ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" +"اگر دنباله خالی است یا تمام بایت های دنباله ASCII هستند، ``True`` را " +"برگردانید در غیر این صورت ``False``. بایت های ASCII در محدوده 0-0x7F هستند." #: library/stdtypes.rst:3307 -msgid "Return ``True`` if all bytes in the sequence are ASCII decimal digits and the sequence is not empty, ``False`` otherwise. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``." +#, fuzzy +msgid "" +"Return ``True`` if all bytes in the sequence are ASCII decimal digits and " +"the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " +"those byte values in the sequence ``b'0123456789'``." msgstr "" +"اگر تمام بایت های دنباله ارقام اعشاری ASCII هستند و دنباله خالی نیست، " +"``True`` را برگردانید، در غیر این صورت ``False`` را برگردانید. ارقام اعشاری " +"ASCII آن مقادیر بایت در دنباله ``b'0123456789'`` هستند." #: library/stdtypes.rst:3313 -msgid ">>> b'1234'.isdigit()\n" +#, fuzzy +msgid "" +">>> b'1234'.isdigit()\n" "True\n" ">>> b'1.23'.isdigit()\n" "False" msgstr "" +">>> b'1234'.isdigit()\n" +"True\n" +">>> b'1.23'.isdigit()\n" +"False" #: library/stdtypes.rst:3322 -msgid "Return ``True`` if there is at least one lowercase ASCII character in the sequence and no uppercase ASCII characters, ``False`` otherwise." +#, fuzzy +msgid "" +"Return ``True`` if there is at least one lowercase ASCII character in the " +"sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" +"اگر حداقل یک نویسه ASCII کوچک در دنباله وجود دارد و هیچ نویسه ASCII بزرگ " +"وجود ندارد، ``True`` را برگردانید، در غیر این صورت ``False``." #: library/stdtypes.rst:3327 -msgid ">>> b'hello world'.islower()\n" +#, fuzzy +msgid "" +">>> b'hello world'.islower()\n" "True\n" ">>> b'Hello world'.islower()\n" "False" msgstr "" +">>> b'hello world'.islower()\n" +"True\n" +">>> b'Hello world'.islower()\n" +"False" -#: library/stdtypes.rst:3332 -#: library/stdtypes.rst:3374 -#: library/stdtypes.rst:3390 -#: library/stdtypes.rst:3440 +#: library/stdtypes.rst:3332 library/stdtypes.rst:3374 +#: library/stdtypes.rst:3390 library/stdtypes.rst:3440 #: library/stdtypes.rst:3509 -msgid "Lowercase ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." +#, fuzzy +msgid "" +"Lowercase ASCII characters are those byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte" +" values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" +"حروف کوچک ASCII مقادیر بایتی در دنباله ``b'abcdefghijklmnopqrstuvwxyz'`` " +"هستند. کاراکترهای ASCII بزرگ آن مقادیر بایت در دنباله " +"``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`` هستند." #: library/stdtypes.rst:3340 -msgid "Return ``True`` if all bytes in the sequence are ASCII whitespace and the sequence is not empty, ``False`` otherwise. ASCII whitespace characters are those byte values in the sequence ``b' \\t\\n\\r\\x0b\\f'`` (space, tab, newline, carriage return, vertical tab, form feed)." +#, fuzzy +msgid "" +"Return ``True`` if all bytes in the sequence are ASCII whitespace and the " +"sequence is not empty, ``False`` otherwise. ASCII whitespace characters are" +" those byte values in the sequence ``b' \\t\\n\\r\\x0b\\f'`` (space, tab, " +"newline, carriage return, vertical tab, form feed)." msgstr "" +"اگر تمام بایت‌های دنباله فضای خالی ASCII هستند و دنباله خالی نیست، ``True`` " +"را برگردانید، در غیر این صورت ``False`` را برگردانید. کاراکترهای فضای خالی " +"ASCII آن مقادیر بایت در دنباله ``b' \\t\\n\\r\\x0b\\f'`` هستند (فضا, برگه, " +"خط جدید, بازگشت بار, برگه عمودی, فید فرم)." #: library/stdtypes.rst:3349 -msgid "Return ``True`` if the sequence is ASCII titlecase and the sequence is not empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the definition of \"titlecase\"." +#, fuzzy +msgid "" +"Return ``True`` if the sequence is ASCII titlecase and the sequence is not " +"empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " +"definition of \"titlecase\"." msgstr "" +"اگر دنباله ASCII titlecase است و دنباله خالی نیست، ``True`` را برگردانید، در" +" غیر این صورت ``False`` را برگردانید. برای جزئیات بیشتر در مورد تعریف " +"\"titlecase\" به :meth:`bytes.title` مراجعه کنید." #: library/stdtypes.rst:3355 -msgid ">>> b'Hello World'.istitle()\n" +#, fuzzy +msgid "" +">>> b'Hello World'.istitle()\n" "True\n" ">>> b'Hello world'.istitle()\n" "False" msgstr "" +">>> b'Hello World'.istitle()\n" +"True\n" +">>> b'Hello world'.istitle()\n" +"False" #: library/stdtypes.rst:3364 -msgid "Return ``True`` if there is at least one uppercase alphabetic ASCII character in the sequence and no lowercase ASCII characters, ``False`` otherwise." +#, fuzzy +msgid "" +"Return ``True`` if there is at least one uppercase alphabetic ASCII " +"character in the sequence and no lowercase ASCII characters, ``False`` " +"otherwise." msgstr "" +"اگر حداقل یک نویسه ASCII حروف الفبای بزرگ در دنباله وجود دارد و هیچ نویسه " +"ASCII کوچک وجود ندارد، ``True`` را برگردانید، در غیر این صورت ``False``." #: library/stdtypes.rst:3369 -msgid ">>> b'HELLO WORLD'.isupper()\n" +#, fuzzy +msgid "" +">>> b'HELLO WORLD'.isupper()\n" "True\n" ">>> b'Hello world'.isupper()\n" "False" msgstr "" +">>> b'HELLO WORLD'.isupper()\n" +"True\n" +">>> b'Hello world'.isupper()\n" +"False" #: library/stdtypes.rst:3382 -msgid "Return a copy of the sequence with all the uppercase ASCII characters converted to their corresponding lowercase counterpart." +#, fuzzy +msgid "" +"Return a copy of the sequence with all the uppercase ASCII characters " +"converted to their corresponding lowercase counterpart." msgstr "" +"یک کپی از دنباله را با تمام کاراکترهای ASCII بزرگ به همتای کوچک مربوطه خود " +"برگردانید." #: library/stdtypes.rst:3387 -msgid ">>> b'Hello World'.lower()\n" +#, fuzzy +msgid "" +">>> b'Hello World'.lower()\n" "b'hello world'" msgstr "" +">>> b'Hello World'.lower()\n" +"b'hello world'" #: library/stdtypes.rst:3407 -msgid "Return a list of the lines in the binary sequence, breaking at ASCII line boundaries. This method uses the :term:`universal newlines` approach to splitting lines. Line breaks are not included in the resulting list unless *keepends* is given and true." +#, fuzzy +msgid "" +"Return a list of the lines in the binary sequence, breaking at ASCII line " +"boundaries. This method uses the :term:`universal newlines` approach to " +"splitting lines. Line breaks are not included in the resulting list unless " +"*keepends* is given and true." msgstr "" +"فهرستی از خطوط در دنباله باینری را برگردانید که در مرزهای خطوط ASCII شکسته " +"می شوند. این روش از رویکرد :term:`universal newlines` برای تقسیم خطوط " +"استفاده می کند. شکست خط در لیست حاصل گنجانده نمی شود مگر اینکه *keepends* " +"داده شده و درست باشد." #: library/stdtypes.rst:3414 -msgid ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +#, fuzzy +msgid "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgstr "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"[b'ab c', b'', b'de fg', b'kl']\n" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" #: library/stdtypes.rst:3419 -msgid "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::" +#, fuzzy +msgid "" +"Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " +"method returns an empty list for the empty string, and a terminal line break" +" does not result in an extra line::" msgstr "" +"برخلاف :meth:`~bytes.split` که یک رشته جداکننده *sep* داده می شود، این روش " +"یک لیست خالی برای رشته خالی برمی گرداند و شکست خط پایانی منجر به یک خط اضافی" +" نمی شود:" #: library/stdtypes.rst:3423 -msgid ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +#, fuzzy +msgid "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" msgstr "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +"([b''], [b'Two lines', b''])\n" +">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" +"([], [b'One line'])" #: library/stdtypes.rst:3432 -msgid "Return a copy of the sequence with all the lowercase ASCII characters converted to their corresponding uppercase counterpart and vice-versa." +#, fuzzy +msgid "" +"Return a copy of the sequence with all the lowercase ASCII characters " +"converted to their corresponding uppercase counterpart and vice-versa." msgstr "" +"یک کپی از دنباله را با تمام نویسه‌های ASCII کوچک به همتای بزرگ مربوطه خود و " +"بالعکس برگردانید." #: library/stdtypes.rst:3437 -msgid ">>> b'Hello World'.swapcase()\n" +#, fuzzy +msgid "" +">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" msgstr "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" #: library/stdtypes.rst:3444 -msgid "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase().swapcase() == bin`` for the binary versions. Case conversions are symmetrical in ASCII, even though that is not generally true for arbitrary Unicode code points." +#, fuzzy +msgid "" +"Unlike :func:`str.swapcase`, it is always the case that " +"``bin.swapcase().swapcase() == bin`` for the binary versions. Case " +"conversions are symmetrical in ASCII, even though that is not generally true" +" for arbitrary Unicode code points." msgstr "" +"برخلاف :func:`str.swapcase`، همیشه ``bin.swapcase().swapcase() == bin`` برای" +" نسخه های باینری وجود دارد. تبدیل‌های Case در ASCII متقارن هستند، حتی اگر " +"این به طور کلی برای نقاط کد دلخواه یونیکد صادق نیست." #: library/stdtypes.rst:3458 -msgid "Return a titlecased version of the binary sequence where words start with an uppercase ASCII character and the remaining characters are lowercase. Uncased byte values are left unmodified." +#, fuzzy +msgid "" +"Return a titlecased version of the binary sequence where words start with an" +" uppercase ASCII character and the remaining characters are lowercase. " +"Uncased byte values are left unmodified." msgstr "" +"یک نسخه با حروف عنوان از دنباله باینری که در آن کلمات با یک کاراکتر ASCII " +"بزرگ شروع می‌شوند و کاراکترهای باقیمانده با حروف کوچک هستند، برگردانید. " +"مقادیر بایت بدون حروف بدون تغییر رها می شوند." #: library/stdtypes.rst:3464 -msgid ">>> b'Hello world'.title()\n" +#, fuzzy +msgid "" +">>> b'Hello world'.title()\n" "b'Hello World'" msgstr "" +">>> b'Hello world'.title()\n" +"b'Hello World'" #: library/stdtypes.rst:3467 -msgid "Lowercase ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte values are uncased." +#, fuzzy +msgid "" +"Lowercase ASCII characters are those byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte" +" values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte " +"values are uncased." msgstr "" +"حروف کوچک ASCII مقادیر بایتی در دنباله ``b'abcdefghijklmnopqrstuvwxyz'`` " +"هستند. کاراکترهای ASCII بزرگ آن مقادیر بایت در دنباله " +"``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`` هستند. سایر مقادیر بایت بدون حروف هستند." #: library/stdtypes.rst:3477 -msgid ">>> b\"they're bill's friends from the UK\".title()\n" +#, fuzzy +msgid "" +">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> b\"they're bill's friends from the UK\".title()\n" +"b\"They'Re Bill'S Friends From The Uk\"" #: library/stdtypes.rst:3480 -msgid "A workaround for apostrophes can be constructed using regular expressions::" +#, fuzzy +msgid "" +"A workaround for apostrophes can be constructed using regular expressions::" msgstr "" +"یک راه حل برای آپوستروف ها می تواند با استفاده از عبارات منظم ساخته شود:" #: library/stdtypes.rst:3482 -msgid ">>> import re\n" +#, fuzzy +msgid "" +">>> import re\n" ">>> def titlecase(s):\n" "... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" "... lambda mo: mo.group(0)[0:1].upper() +\n" @@ -3348,121 +6732,270 @@ msgid ">>> import re\n" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0)[0:1].upper() +\n" +"... mo.group(0)[1:].lower(),\n" +"... s)\n" +"...\n" +">>> titlecase(b\"they're bill's friends.\")\n" +"b\"They're Bill's Friends.\"" #: library/stdtypes.rst:3501 -msgid "Return a copy of the sequence with all the lowercase ASCII characters converted to their corresponding uppercase counterpart." +#, fuzzy +msgid "" +"Return a copy of the sequence with all the lowercase ASCII characters " +"converted to their corresponding uppercase counterpart." msgstr "" +"یک کپی از دنباله را با تمام کاراکترهای ASCII کوچک به همتای بزرگ مربوطه خود " +"برگردانید." #: library/stdtypes.rst:3506 -msgid ">>> b'Hello World'.upper()\n" +#, fuzzy +msgid "" +">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" msgstr "" +">>> b'Hello World'.upper()\n" +"b'HELLO WORLD'" #: library/stdtypes.rst:3522 -msgid "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is handled by inserting the padding *after* the sign character rather than before. For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(seq)``." -msgstr "" +#, fuzzy +msgid "" +"Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make" +" a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is" +" handled by inserting the padding *after* the sign character rather than " +"before. For :class:`bytes` objects, the original sequence is returned if " +"*width* is less than or equal to ``len(seq)``." +msgstr "" +"یک کپی از دنباله سمت چپ پر شده با ارقام ASCII ``b'0'`` را برگردانید تا " +"دنباله ای به طول *width* بسازید. پیشوند علامت پیشرو (``b'+'``/``b'-'``) با " +"درج نویسه علامت *after* به جای قبل انجام می شود. برای اشیاء :class:`bytes`، " +"اگر *width* کمتر یا مساوی با ``len(seq)`` باشد، دنباله اصلی برگردانده می " +"شود." #: library/stdtypes.rst:3530 -msgid ">>> b\"42\".zfill(5)\n" +#, fuzzy +msgid "" +">>> b\"42\".zfill(5)\n" "b'00042'\n" ">>> b\"-42\".zfill(5)\n" "b'-0042'" msgstr "" +">>> b\"42\".zfill(5)\n" +"b'00042'\n" +">>> b\"-42\".zfill(5)\n" +"b'-0042'" #: library/stdtypes.rst:3544 +#, fuzzy msgid "``printf``-style Bytes Formatting" -msgstr "" +msgstr "قالب بندی بایت به سبک ``printf``" #: library/stdtypes.rst:3561 -msgid "The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). If the value being printed may be a tuple or dictionary, wrap it in a tuple." +#, fuzzy +msgid "" +"The formatting operations described here exhibit a variety of quirks that " +"lead to a number of common errors (such as failing to display tuples and " +"dictionaries correctly). If the value being printed may be a tuple or " +"dictionary, wrap it in a tuple." msgstr "" +"عملیات قالب‌بندی که در اینجا توضیح داده شده است، خصلت‌های مختلفی را نشان " +"می‌دهد که منجر به تعدادی خطای رایج (مانند عدم نمایش صحیح تاپل‌ها و " +"دیکشنری‌ها) می‌شود. اگر مقدار چاپ شده ممکن است یک تاپل یا فرهنگ لغت باشد، " +"آن را در یک تاپلی بپیچید." #: library/stdtypes.rst:3566 -msgid "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: the ``%`` operator (modulo). This is also known as the bytes *formatting* or *interpolation* operator. Given ``format % values`` (where *format* is a bytes object), ``%`` conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` in the C language." -msgstr "" +#, fuzzy +msgid "" +"Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " +"the ``%`` operator (modulo). This is also known as the bytes *formatting* or" +" *interpolation* operator. Given ``format % values`` (where *format* is a " +"bytes object), ``%`` conversion specifications in *format* are replaced with" +" zero or more elements of *values*. The effect is similar to using the " +":c:func:`sprintf` in the C language." +msgstr "" +"اشیاء بایت (``bytes``/``bytearray``) یک عملیات داخلی منحصر به فرد دارند: " +"عملگر ``%`` (ماژول). این عملگر بایت *formatting* یا *interpolation* نیز " +"شناخته می شود. با توجه به ``format % values`` (که در آن *format* یک شی بایت " +"است), مشخصات تبدیل ``%`` در *format* با عناصر صفر یا بیشتر از *values* " +"جایگزین می شود. این اثر مشابه استفاده از :c:func:`sprintf` در زبان C است." #: library/stdtypes.rst:3573 -msgid "If *format* requires a single argument, *values* may be a single non-tuple object. [5]_ Otherwise, *values* must be a tuple with exactly the number of items specified by the format bytes object, or a single mapping object (for example, a dictionary)." +#, fuzzy +msgid "" +"If *format* requires a single argument, *values* may be a single non-tuple " +"object. [5]_ Otherwise, *values* must be a tuple with exactly the number of" +" items specified by the format bytes object, or a single mapping object (for" +" example, a dictionary)." msgstr "" +"اگر *format* به یک آرگومان واحد نیاز داشته باشد، *values* ممکن است یک شی غیر" +" چندگانه باشد. [5]_ در غیر این صورت، *values* باید یک تاپل با تعداد آیتم های" +" مشخص شده توسط شی قالب بایت یا یک شی نگاشت واحد (مثلاً یک فرهنگ لغت) باشد." #: library/stdtypes.rst:3607 -msgid "When the right argument is a dictionary (or other mapping type), then the formats in the bytes object *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:" +#, fuzzy +msgid "" +"When the right argument is a dictionary (or other mapping type), then the " +"formats in the bytes object *must* include a parenthesised mapping key into " +"that dictionary inserted immediately after the ``'%'`` character. The " +"mapping key selects the value to be formatted from the mapping. For " +"example:" msgstr "" +"هنگامی که آرگومان مناسب یک فرهنگ لغت (یا نوع نقشه برداری دیگر) باشد، فرمت " +"های موجود در شی بایت *must* شامل یک کلید نگاشت پرانتز در آن فرهنگ لغت است که" +" بلافاصله بعد از کاراکتر ``'%'`` درج شده است. کلید نگاشت مقداری را که باید " +"قالب بندی شود از نقشه برداری انتخاب می کند. به عنوان مثال:" #: library/stdtypes.rst:3681 +#, fuzzy msgid "Single byte (accepts integer or single byte objects)." -msgstr "" +msgstr "تک بایت (اشیاء عدد صحیح یا تک بایت را می پذیرد)." #: library/stdtypes.rst:3684 +#, fuzzy msgid "``'b'``" -msgstr "" +msgstr "``'b'``" #: library/stdtypes.rst:3684 -msgid "Bytes (any object that follows the :ref:`buffer protocol ` or has :meth:`~object.__bytes__`)." +#, fuzzy +msgid "" +"Bytes (any object that follows the :ref:`buffer protocol ` or" +" has :meth:`~object.__bytes__`)." msgstr "" +"بایت ها (هر شیئی که از :ref:`buffer protocol ` پیروی می کند " +"یا دارای :meth:`~object.__bytes__` است)." #: library/stdtypes.rst:3688 -msgid "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code bases." +#, fuzzy +msgid "" +"``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " +"bases." msgstr "" +"``'s'`` نام مستعار ``'b'`` است و فقط باید برای پایه کد Python2/3 استفاده " +"شود." #: library/stdtypes.rst:3691 -msgid "Bytes (converts any Python object using ``repr(obj).encode('ascii', 'backslashreplace')``)." +#, fuzzy +msgid "" +"Bytes (converts any Python object using ``repr(obj).encode('ascii', " +"'backslashreplace')``)." msgstr "" +"بایت ها (هر شی پایتون را با استفاده از ``repr(obj).encode('ascii', " +"'backslashreplace')`` تبدیل می کند)." #: library/stdtypes.rst:3694 -msgid "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code bases." +#, fuzzy +msgid "" +"``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " +"bases." msgstr "" +"``'r'`` نام مستعار ``'a'`` است و فقط باید برای پایه کد Python2/3 استفاده " +"شود." #: library/stdtypes.rst:3694 +#, fuzzy msgid "\\(7)" -msgstr "" +msgstr "\\ (7)" #: library/stdtypes.rst:3729 -msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." -msgstr "" +#, fuzzy +msgid "" +"``b'%s'`` is deprecated, but will not be removed during the 3.x series." +msgstr "``b'%s'`` منسوخ شده است، اما در طول سری 3.x حذف نخواهد شد." #: library/stdtypes.rst:3732 -msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." -msgstr "" +#, fuzzy +msgid "" +"``b'%r'`` is deprecated, but will not be removed during the 3.x series." +msgstr "``b'%r'`` منسوخ شده است، اما در طول سری 3.x حذف نخواهد شد." #: library/stdtypes.rst:3744 +#, fuzzy msgid ":pep:`461` - Adding % formatting to bytes and bytearray" -msgstr "" +msgstr ":pep:`461` - اضافه کردن درصد قالب بندی به بایت ها و آرایه بایت" #: library/stdtypes.rst:3751 +#, fuzzy msgid "Memory Views" -msgstr "" +msgstr "نماهای حافظه" #: library/stdtypes.rst:3753 -msgid ":class:`memoryview` objects allow Python code to access the internal data of an object that supports the :ref:`buffer protocol ` without copying." +#, fuzzy +msgid "" +":class:`memoryview` objects allow Python code to access the internal data of" +" an object that supports the :ref:`buffer protocol ` without " +"copying." msgstr "" +"اشیاء :class:`memoryview` به کد پایتون اجازه می دهد تا به داده های داخلی یک " +"شی که از :ref:`buffer protocol ` پشتیبانی می کند بدون کپی " +"دسترسی پیدا کند." #: library/stdtypes.rst:3759 -msgid "Create a :class:`memoryview` that references *object*. *object* must support the buffer protocol. Built-in objects that support the buffer protocol include :class:`bytes` and :class:`bytearray`." +#, fuzzy +msgid "" +"Create a :class:`memoryview` that references *object*. *object* must " +"support the buffer protocol. Built-in objects that support the buffer " +"protocol include :class:`bytes` and :class:`bytearray`." msgstr "" +"یک :class:`memoryview` ایجاد کنید که به *object* اشاره کند. *object* باید " +"از پروتکل بافر پشتیبانی کند. اشیاء داخلی که از پروتکل بافر پشتیبانی می کنند" +" عبارتند از :class:`bytes` و :class:`bytearray`." #: library/stdtypes.rst:3763 -msgid "A :class:`memoryview` has the notion of an *element*, which is the atomic memory unit handled by the originating *object*. For many simple types such as :class:`bytes` and :class:`bytearray`, an element is a single byte, but other types such as :class:`array.array` may have bigger elements." +#, fuzzy +msgid "" +"A :class:`memoryview` has the notion of an *element*, which is the atomic " +"memory unit handled by the originating *object*. For many simple types such" +" as :class:`bytes` and :class:`bytearray`, an element is a single byte, but " +"other types such as :class:`array.array` may have bigger elements." msgstr "" +":class:`memoryview` مفهوم *element* را دارد که واحد حافظه اتمی است که توسط " +"*object* مبدا اداره می شود. برای بسیاری از انواع ساده مانند :class:`bytes` " +"و :class:`bytearray`، یک عنصر یک بایت است، اما انواع دیگر مانند " +":class:`array.array` ممکن است عناصر بزرگتری داشته باشند." #: library/stdtypes.rst:3768 -msgid "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this is equal to the number of elements in the view." +#, fuzzy +msgid "" +"``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " +"is the nested list representation of the view. If ``view.ndim = 1``, this is" +" equal to the number of elements in the view." msgstr "" +"``len(view)`` برابر با طول :class:`~memoryview.tolist` است که نمایش لیست " +"تودرتوی نما است. اگر ``view.ndim = 1``، این برابر با تعداد عناصر در نما است." #: library/stdtypes.rst:3772 -msgid "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of returning 1." +#, fuzzy +msgid "" +"If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " +"returning 1." msgstr "" +"اگر ``view.ndim == 0``، ``len(view)`` اکنون به جای برگرداندن 1، " +":exc:`TypeError` را افزایش می دهد." #: library/stdtypes.rst:3775 -msgid "The :class:`~memoryview.itemsize` attribute will give you the number of bytes in a single element." +#, fuzzy +msgid "" +"The :class:`~memoryview.itemsize` attribute will give you the number of " +"bytes in a single element." msgstr "" +"ویژگی :class:`~memoryview.itemsize` تعداد بایت های یک عنصر را به شما می دهد." #: library/stdtypes.rst:3778 -msgid "A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview::" +#, fuzzy +msgid "" +"A :class:`memoryview` supports slicing and indexing to expose its data. One-" +"dimensional slicing will result in a subview::" msgstr "" +":class:`memoryview` از برش و نمایه سازی برای نمایش داده های خود پشتیبانی می " +"کند. برش تک بعدی منجر به یک نمای فرعی می شود:" #: library/stdtypes.rst:3781 -msgid ">>> v = memoryview(b'abcefg')\n" +#, fuzzy +msgid "" +">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" "98\n" ">>> v[-1]\n" @@ -3472,17 +7005,43 @@ msgid ">>> v = memoryview(b'abcefg')\n" ">>> bytes(v[1:4])\n" "b'bce'" msgstr "" +">>> v = نمای حافظه (b'abcefg')\n" +">>> v[1]\n" +"98\n" +">>> v[-1]\n" +"103\n" +">>> v[1:4]\n" +"<حافظه در 0x7f3ddc9f4350>\n" +">>> بایت (v[1:4])\n" +"قبل از میلاد" #: library/stdtypes.rst:3791 -msgid "If :class:`~memoryview.format` is one of the native format specifiers from the :mod:`struct` module, indexing with an integer or a tuple of integers is also supported and returns a single *element* with the correct type. One-dimensional memoryviews can be indexed with an integer or a one-integer tuple. Multi-dimensional memoryviews can be indexed with tuples of exactly *ndim* integers where *ndim* is the number of dimensions. Zero-dimensional memoryviews can be indexed with the empty tuple." -msgstr "" +#, fuzzy +msgid "" +"If :class:`~memoryview.format` is one of the native format specifiers from " +"the :mod:`struct` module, indexing with an integer or a tuple of integers is" +" also supported and returns a single *element* with the correct type. One-" +"dimensional memoryviews can be indexed with an integer or a one-integer " +"tuple. Multi-dimensional memoryviews can be indexed with tuples of exactly " +"*ndim* integers where *ndim* is the number of dimensions. Zero-dimensional " +"memoryviews can be indexed with the empty tuple." +msgstr "" +"اگر :class:`~memoryview.format` یکی از مشخص‌کننده‌های قالب بومی از ماژول " +":mod:`struct` باشد، نمایه‌سازی با یک عدد صحیح یا چند عدد صحیح نیز پشتیبانی " +"می‌شود و یک *element* را با نوع صحیح برمی‌گرداند. مموری‌نماهای یک بعدی را " +"می‌توان با یک عدد صحیح یا یک تاپل یک عدد صحیح نمایه کرد. مموری‌نماهای چند " +"بعدی را می‌توان با چند اعداد صحیح *ndim* که در آن *ndim* تعداد ابعاد است، " +"فهرست‌بندی کرد. نماهای حافظه صفر بعدی را می توان با تاپل خالی ایندکس کرد." #: library/stdtypes.rst:3800 +#, fuzzy msgid "Here is an example with a non-byte format::" -msgstr "" +msgstr "در اینجا یک مثال با فرمت غیر بایتی آورده شده است:" #: library/stdtypes.rst:3802 -msgid ">>> import array\n" +#, fuzzy +msgid "" +">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" ">>> m = memoryview(a)\n" ">>> m[0]\n" @@ -3492,13 +7051,29 @@ msgid ">>> import array\n" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" msgstr "" +">>> import array\n" +">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" +">>> m = memoryview(a)\n" +">>> m[0]\n" +"-11111111\n" +">>> m[-1]\n" +"44444444\n" +">>> m[::2].tolist()\n" +"[-11111111, -33333333]" #: library/stdtypes.rst:3812 -msgid "If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed::" +#, fuzzy +msgid "" +"If the underlying object is writable, the memoryview supports one-" +"dimensional slice assignment. Resizing is not allowed::" msgstr "" +"اگر شی زیرین قابل نوشتن باشد، مموری ویو از تخصیص برش یک بعدی پشتیبانی می " +"کند. تغییر اندازه مجاز نیست::" #: library/stdtypes.rst:3815 -msgid ">>> data = bytearray(b'abcefg')\n" +#, fuzzy +msgid "" +">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" ">>> v.readonly\n" "False\n" @@ -3516,13 +7091,39 @@ msgid ">>> data = bytearray(b'abcefg')\n" ">>> data\n" "bytearray(b'z1spam')" msgstr "" +">>> داده = آرایه بایت (b'abcefg')\n" +">>> v = نمای حافظه (داده)\n" +">>> v.readonly\n" +"نادرست\n" +">>> v[0] = ord(b'z')\n" +">>> داده ها\n" +"بایت آرایه (b'zbcefg')\n" +">>> v[1:4] = b'123'\n" +">>> داده ها\n" +"آرایه بایت (b'z123fg')\n" +">>> v[2:3] = b'spam'\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"ValueError: انتساب memoryview: lvalue و rvalue ساختارهای متفاوتی دارند\n" +">>> v[2:6] = b'spam'\n" +">>> داده ها\n" +"بایت آرایه (b'z1spam')" #: library/stdtypes.rst:3833 -msgid "One-dimensional memoryviews of :term:`hashable` (read-only) types with formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``::" +#, fuzzy +msgid "" +"One-dimensional memoryviews of :term:`hashable` (read-only) types with " +"formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " +"== hash(m.tobytes())``::" msgstr "" +"مموری‌های تک بعدی انواع :term:`hashable` (فقط خواندنی) با فرمت‌های «B»، «b» " +"یا «c» نیز قابل هش هستند. هش به صورت ``hash(m) == hash(m.tobytes())`` تعریف " +"می شود:" #: library/stdtypes.rst:3837 -msgid ">>> v = memoryview(b'abcefg')\n" +#, fuzzy +msgid "" +">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" "True\n" ">>> hash(v[2:4]) == hash(b'ce')\n" @@ -3530,33 +7131,67 @@ msgid ">>> v = memoryview(b'abcefg')\n" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> hash(v) == hash(b'abcefg')\n" +"True\n" +">>> hash(v[2:4]) == hash(b'ce')\n" +"True\n" +">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" +"True" #: library/stdtypes.rst:3845 -msgid "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews with formats 'B', 'b' or 'c' are now :term:`hashable`." +#, fuzzy +msgid "" +"One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " +"with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" +"اکنون می توان نماهای حافظه یک بعدی را برش داد. نماهای حافظه یک بعدی با فرمت " +"های «B»، «b» یا «c» اکنون :term:`hashable` هستند." #: library/stdtypes.rst:3849 -msgid "memoryview is now registered automatically with :class:`collections.abc.Sequence`" +#, fuzzy +msgid "" +"memoryview is now registered automatically with " +":class:`collections.abc.Sequence`" msgstr "" +"Memoryview اکنون به طور خودکار با :class:`collections.abc.Sequence` ثبت می " +"شود" #: library/stdtypes.rst:3853 +#, fuzzy msgid "memoryviews can now be indexed with tuple of integers." -msgstr "" +msgstr "Memoryviews اکنون می تواند با چند عدد صحیح ایندکس شود." #: library/stdtypes.rst:3856 +#, fuzzy msgid ":class:`memoryview` has several methods:" -msgstr "" +msgstr ":class:`memoryview` چندین روش دارد:" #: library/stdtypes.rst:3860 -msgid "A memoryview and a :pep:`3118` exporter are equal if their shapes are equivalent and if all corresponding values are equal when the operands' respective format codes are interpreted using :mod:`struct` syntax." +#, fuzzy +msgid "" +"A memoryview and a :pep:`3118` exporter are equal if their shapes are " +"equivalent and if all corresponding values are equal when the operands' " +"respective format codes are interpreted using :mod:`struct` syntax." msgstr "" +"یک مموری ویو و یک صادرکننده :pep:`3118` در صورتی که اشکال آنها معادل باشد و " +"اگر همه مقادیر متناظر با کدهای قالب مربوطه عملوندها با استفاده از نحو " +":mod:`struct` تفسیر شوند، برابر هستند." #: library/stdtypes.rst:3864 -msgid "For the subset of :mod:`struct` format strings currently supported by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" +#, fuzzy +msgid "" +"For the subset of :mod:`struct` format strings currently supported by " +":meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" +"برای زیر مجموعه رشته های قالب :mod:`struct` که در حال حاضر توسط " +":meth:`tolist` پشتیبانی می شود، ``v`` و ``w`` برابر هستند اگر ``v.tolist() " +"== w.tolist()``::" #: library/stdtypes.rst:3867 -msgid ">>> import array\n" +#, fuzzy +msgid "" +">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" ">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" ">>> c = array.array('b', [5, 3, 1])\n" @@ -3572,13 +7207,37 @@ msgid ">>> import array\n" ">>> z.tolist() == c.tolist()\n" "True" msgstr "" +">>> import array\n" +">>> a = array.array('I', [1, 2, 3, 4, 5])\n" +">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" +">>> c = array.array('b', [5, 3, 1])\n" +">>> x = memoryview(a)\n" +">>> y = memoryview(b)\n" +">>> x == a == y == b\n" +"True\n" +">>> x.tolist() == a.tolist() == y.tolist() == b.tolist()\n" +"True\n" +">>> z = y[::-2]\n" +">>> z == c\n" +"True\n" +">>> z.tolist() == c.tolist()\n" +"True" #: library/stdtypes.rst:3883 -msgid "If either format string is not supported by the :mod:`struct` module, then the objects will always compare as unequal (even if the format strings and buffer contents are identical)::" +#, fuzzy +msgid "" +"If either format string is not supported by the :mod:`struct` module, then " +"the objects will always compare as unequal (even if the format strings and " +"buffer contents are identical)::" msgstr "" +"اگر هر یک از رشته های قالب توسط ماژول :mod:`struct` پشتیبانی نمی شود، آنگاه " +"اشیاء همیشه به عنوان نابرابر مقایسه می شوند (حتی اگر رشته های قالب و محتوای " +"بافر یکسان باشند):" #: library/stdtypes.rst:3887 -msgid ">>> from ctypes import BigEndianStructure, c_long\n" +#, fuzzy +msgid "" +">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" "... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" "...\n" @@ -3590,55 +7249,126 @@ msgid ">>> from ctypes import BigEndianStructure, c_long\n" ">>> a == b\n" "False" msgstr "" +">>> from ctypes import BigEndianStructure, c_long\n" +">>> class BEPoint(BigEndianStructure):\n" +"... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" +"...\n" +">>> point = BEPoint(100, 200)\n" +">>> a = memoryview(point)\n" +">>> b = memoryview(point)\n" +">>> a == point\n" +"False\n" +">>> a == b\n" +"False" #: library/stdtypes.rst:3899 -msgid "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects." +#, fuzzy +msgid "" +"Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " +"== w`` for memoryview objects." msgstr "" +"توجه داشته باشید که مانند اعداد ممیز شناور، ``v is w`` *not* به معنای ``v ==" +" w`` برای اشیاء مموری دید است." #: library/stdtypes.rst:3902 -msgid "Previous versions compared the raw memory disregarding the item format and the logical array structure." +#, fuzzy +msgid "" +"Previous versions compared the raw memory disregarding the item format and " +"the logical array structure." msgstr "" +"نسخه های قبلی حافظه خام را بدون توجه به فرمت آیتم و ساختار آرایه منطقی " +"مقایسه کردند." #: library/stdtypes.rst:3908 -msgid "Return the data in the buffer as a bytestring. This is equivalent to calling the :class:`bytes` constructor on the memoryview. ::" +#, fuzzy +msgid "" +"Return the data in the buffer as a bytestring. This is equivalent to " +"calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" +"داده ها را در بافر به عنوان بایت تست برگردانید. این معادل فراخوانی سازنده " +":class:`bytes` در مموری ویو است. ::" #: library/stdtypes.rst:3911 -msgid ">>> m = memoryview(b\"abc\")\n" +#, fuzzy +msgid "" +">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" "b'abc'\n" ">>> bytes(m)\n" "b'abc'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.tobytes()\n" +"b'abc'\n" +">>> bytes(m)\n" +"b'abc'" #: library/stdtypes.rst:3917 -msgid "For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. :meth:`tobytes` supports all format strings, including those that are not in :mod:`struct` module syntax." +#, fuzzy +msgid "" +"For non-contiguous arrays the result is equal to the flattened list " +"representation with all elements converted to bytes. :meth:`tobytes` " +"supports all format strings, including those that are not in :mod:`struct` " +"module syntax." msgstr "" +"برای آرایه های غیر پیوسته، نتیجه برابر است با نمایش لیست مسطح با تمام عناصر " +"تبدیل به بایت. :meth:`tobytes` از تمام رشته های قالب، از جمله رشته هایی که " +"در نحو ماژول :mod:`struct` نیستند، پشتیبانی می کند." #: library/stdtypes.rst:3922 -msgid "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the original array is converted to C or Fortran order. For contiguous views, 'A' returns an exact copy of the physical memory. In particular, in-memory Fortran order is preserved. For non-contiguous views, the data is converted to C first. *order=None* is the same as *order='C'*." -msgstr "" +#, fuzzy +msgid "" +"*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the" +" original array is converted to C or Fortran order. For contiguous views, " +"'A' returns an exact copy of the physical memory. In particular, in-memory " +"Fortran order is preserved. For non-contiguous views, the data is converted " +"to C first. *order=None* is the same as *order='C'*." +msgstr "" +"*order* می تواند {'C', 'F', 'A'} باشد. وقتی *order* 'C' یا 'F' باشد، داده " +"های آرایه اصلی به ترتیب C یا Fortran تبدیل می شوند. برای نماهای پیوسته، 'A' " +"یک کپی دقیق از حافظه فیزیکی را برمی گرداند. به طور خاص، نظم فرترن در حافظه " +"حفظ می شود. برای نماهای غیر پیوسته، ابتدا داده ها به C تبدیل می شوند. " +"*order=None* همان *order='C'* است." #: library/stdtypes.rst:3931 -msgid "Return a string object containing two hexadecimal digits for each byte in the buffer. ::" +#, fuzzy +msgid "" +"Return a string object containing two hexadecimal digits for each byte in " +"the buffer. ::" msgstr "" +"یک شی رشته حاوی دو رقم هگزادسیمال برای هر بایت در بافر را برگردانید. ::" #: library/stdtypes.rst:3934 -msgid ">>> m = memoryview(b\"abc\")\n" +#, fuzzy +msgid "" +">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" "'616263'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.hex()\n" +"'616263'" #: library/stdtypes.rst:3940 -msgid "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output." +#, fuzzy +msgid "" +"Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " +"*sep* and *bytes_per_sep* parameters to insert separators between bytes in " +"the hex output." msgstr "" +"مشابه :meth:`bytes.hex`، :meth:`memoryview.hex` اکنون از پارامترهای اختیاری " +"*sep* و *bytes_per_sep* برای قرار دادن جداکننده ها بین بایت ها در خروجی هگز " +"پشتیبانی می کند." #: library/stdtypes.rst:3947 +#, fuzzy msgid "Return the data in the buffer as a list of elements. ::" -msgstr "" +msgstr "داده ها را در بافر به عنوان لیستی از عناصر برگردانید. ::" #: library/stdtypes.rst:3949 -msgid ">>> memoryview(b'abc').tolist()\n" +#, fuzzy +msgid "" +">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" ">>> import array\n" ">>> a = array.array('d', [1.1, 2.2, 3.3])\n" @@ -3646,17 +7376,36 @@ msgid ">>> memoryview(b'abc').tolist()\n" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> memoryview(b'abc').tolist()\n" +"[97, 98, 99]\n" +">>> import array\n" +">>> a = array.array('d', [1.1, 2.2, 3.3])\n" +">>> m = memoryview(a)\n" +">>> m.tolist()\n" +"[1.1, 2.2, 3.3]" #: library/stdtypes.rst:3957 -msgid ":meth:`tolist` now supports all single character native formats in :mod:`struct` module syntax as well as multi-dimensional representations." +#, fuzzy +msgid "" +":meth:`tolist` now supports all single character native formats in " +":mod:`struct` module syntax as well as multi-dimensional representations." msgstr "" +":meth:`tolist` اکنون از تمام فرمت های بومی تک کاراکتری در نحو ماژول " +":mod:`struct` و همچنین نمایش های چند بعدی پشتیبانی می کند." #: library/stdtypes.rst:3964 -msgid "Return a readonly version of the memoryview object. The original memoryview object is unchanged. ::" +#, fuzzy +msgid "" +"Return a readonly version of the memoryview object. The original memoryview" +" object is unchanged. ::" msgstr "" +"یک نسخه فقط خواندنی از شی memoryview را برگردانید. شیء اصلی memoryview بدون" +" تغییر است. ::" #: library/stdtypes.rst:3967 -msgid ">>> m = memoryview(bytearray(b'abc'))\n" +#, fuzzy +msgid "" +">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" ">>> mm.tolist()\n" "[97, 98, 99]\n" @@ -3668,30 +7417,74 @@ msgid ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm.tolist()\n" "[43, 98, 99]" msgstr "" +">>> m = مموری نمایش (بایت آرایه (b'abc'))\n" +">>> mm = m.toreadonly()\n" +">>> mm.tolist()\n" +"[97, 98, 99]\n" +">>> میلی متر[0] = 42\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: نمی توان حافظه فقط خواندنی را تغییر داد\n" +">>> m[0] = 43\n" +">>> mm.tolist()\n" +"[43, 98, 99]" #: library/stdtypes.rst:3983 -msgid "Release the underlying buffer exposed by the memoryview object. Many objects take special actions when a view is held on them (for example, a :class:`bytearray` would temporarily forbid resizing); therefore, calling release() is handy to remove these restrictions (and free any dangling resources) as soon as possible." -msgstr "" +#, fuzzy +msgid "" +"Release the underlying buffer exposed by the memoryview object. Many " +"objects take special actions when a view is held on them (for example, a " +":class:`bytearray` would temporarily forbid resizing); therefore, calling " +"release() is handy to remove these restrictions (and free any dangling " +"resources) as soon as possible." +msgstr "" +"بافر زیرین را که توسط شی memoryview در معرض دید قرار می گیرد، رها کنید. " +"بسیاری از اشیاء هنگامی که یک نما روی آنها نگه داشته می شود اقدامات ویژه ای " +"انجام می دهند (به عنوان مثال, یک :class:`bytearray` تغییر اندازه را به طور " +"موقت ممنوع می کند). بنابراین، فراخوانی ()release برای حذف این محدودیت‌ها (و " +"آزاد کردن منابع آویزان) در اسرع وقت مفید است." #: library/stdtypes.rst:3989 -msgid "After this method has been called, any further operation on the view raises a :class:`ValueError` (except :meth:`release` itself which can be called multiple times)::" +#, fuzzy +msgid "" +"After this method has been called, any further operation on the view raises " +"a :class:`ValueError` (except :meth:`release` itself which can be called " +"multiple times)::" msgstr "" +"پس از فراخوانی این متد، هر عملیات دیگری در view یک :class:`ValueError` را " +"افزایش می دهد (به جز خود :meth:`release` که می تواند چندین بار فراخوانی " +"شود):" #: library/stdtypes.rst:3993 -msgid ">>> m = memoryview(b'abc')\n" +#, fuzzy +msgid "" +">>> m = memoryview(b'abc')\n" ">>> m.release()\n" ">>> m[0]\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> m = مموری نمای (b'abc')\n" +">>> m.release()\n" +">>> m[0]\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"ValueError: عملیات بر روی شیء منتشر شده memoryview ممنوع است" #: library/stdtypes.rst:4000 -msgid "The context management protocol can be used for a similar effect, using the ``with`` statement::" +#, fuzzy +msgid "" +"The context management protocol can be used for a similar effect, using the " +"``with`` statement::" msgstr "" +"پروتکل مدیریت زمینه را می توان برای اثر مشابه با استفاده از دستور ``with`` " +"استفاده کرد:" #: library/stdtypes.rst:4003 -msgid ">>> with memoryview(b'abc') as m:\n" +#, fuzzy +msgid "" +">>> with memoryview(b'abc') as m:\n" "... m[0]\n" "...\n" "97\n" @@ -3700,21 +7493,51 @@ msgid ">>> with memoryview(b'abc') as m:\n" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> با نمای حافظه (b'abc') به عنوان m:\n" +"... m[0]\n" +"...\n" +"97\n" +">>> m[0]\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"ValueError: عملیات بر روی شیء منتشر شده memoryview ممنوع است" #: library/stdtypes.rst:4016 -msgid "Cast a memoryview to a new format or shape. *shape* defaults to ``[byte_length//new_itemsize]``, which means that the result view will be one-dimensional. The return value is a new memoryview, but the buffer itself is not copied. Supported casts are 1D -> C-:term:`contiguous` and C-contiguous -> 1D." +#, fuzzy +msgid "" +"Cast a memoryview to a new format or shape. *shape* defaults to " +"``[byte_length//new_itemsize]``, which means that the result view will be " +"one-dimensional. The return value is a new memoryview, but the buffer itself" +" is not copied. Supported casts are 1D -> C-:term:`contiguous` and " +"C-contiguous -> 1D." msgstr "" +"یک مموری ویو را به قالب یا شکل جدید ارسال کنید. *shape* به طور پیش فرض روی " +"``[byte_length//new_itemsize]`` است، به این معنی که نمای نتیجه یک بعدی خواهد" +" بود. مقدار بازگشتی یک مموری نمای جدید است، اما خود بافر کپی نمی شود. " +"بازیگران پشتیبانی شده 1D -> C-:term:`contiguous` و C-contiguous -> 1D هستند." #: library/stdtypes.rst:4022 -msgid "The destination format is restricted to a single element native format in :mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or 'c'). The byte length of the result must be the same as the original length. Note that all byte lengths may depend on the operating system." +#, fuzzy +msgid "" +"The destination format is restricted to a single element native format in " +":mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " +"'c'). The byte length of the result must be the same as the original length." +" Note that all byte lengths may depend on the operating system." msgstr "" +"فرمت مقصد به یک قالب بومی یک عنصر در نحو :mod:`struct` محدود شده است. یکی از" +" فرمت ها باید قالب بایتی باشد ('B', 'b' یا 'c'). طول بایت نتیجه باید با طول " +"اصلی یکسان باشد. توجه داشته باشید که طول تمام بایت ها ممکن است به سیستم عامل" +" بستگی داشته باشد." #: library/stdtypes.rst:4028 +#, fuzzy msgid "Cast 1D/long to 1D/unsigned bytes::" -msgstr "" +msgstr "بایت های 1 بعدی/طولانی تا 1 بعدی/بدون علامت ارسال کنید::" #: library/stdtypes.rst:4030 -msgid ">>> import array\n" +#, fuzzy +msgid "" +">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" ">>> x = memoryview(a)\n" ">>> x.format\n" @@ -3735,13 +7558,36 @@ msgid ">>> import array\n" ">>> y.nbytes\n" "24" msgstr "" +">>> import array\n" +">>> a = array.array('l', [1,2,3])\n" +">>> x = memoryview(a)\n" +">>> x.format\n" +"'l'\n" +">>> x.itemsize\n" +"8\n" +">>> len(x)\n" +"3\n" +">>> x.nbytes\n" +"24\n" +">>> y = x.cast('B')\n" +">>> y.format\n" +"'B'\n" +">>> y.itemsize\n" +"1\n" +">>> len(y)\n" +"24\n" +">>> y.nbytes\n" +"24" #: library/stdtypes.rst:4051 +#, fuzzy msgid "Cast 1D/unsigned bytes to 1D/char::" -msgstr "" +msgstr "بایت های 1 بعدی/بدون علامت به 1D/char ارسال کنید::" #: library/stdtypes.rst:4053 -msgid ">>> b = bytearray(b'zyz')\n" +#, fuzzy +msgid "" +">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" ">>> x[0] = b'a'\n" "Traceback (most recent call last):\n" @@ -3752,13 +7598,26 @@ msgid ">>> b = bytearray(b'zyz')\n" ">>> b\n" "bytearray(b'ayz')" msgstr "" +">>> b = آرایه بایت (b'zyz')\n" +">>> x = نمای حافظه (ب)\n" +">>> x[0] = b'a'\n" +"ردیابی (آخرین تماس اخیر):\n" +" ...\n" +"TypeError: memoryview: نوع نامعتبر برای قالب \"B\"\n" +">>> y = x.cast('c')\n" +">>> y[0] = b'a'\n" +">>> ب\n" +"بایت آرایه (بعیز)" #: library/stdtypes.rst:4064 +#, fuzzy msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" -msgstr "" +msgstr "ارسال 1 بعدی/بایت به 3 بعدی/اینت به 1 بعدی/نویسه امضا شده::" #: library/stdtypes.rst:4066 -msgid ">>> import struct\n" +#, fuzzy +msgid "" +">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" ">>> x = memoryview(buf)\n" ">>> y = x.cast('i', shape=[2,2,3])\n" @@ -3782,13 +7641,39 @@ msgid ">>> import struct\n" ">>> z.nbytes\n" "48" msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('i', shape=[2,2,3])\n" +">>> y.tolist()\n" +"[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]\n" +">>> y.format\n" +"'i'\n" +">>> y.itemsize\n" +"4\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> z = y.cast('b')\n" +">>> z.format\n" +"'b'\n" +">>> z.itemsize\n" +"1\n" +">>> len(z)\n" +"48\n" +">>> z.nbytes\n" +"48" #: library/stdtypes.rst:4090 +#, fuzzy msgid "Cast 1D/unsigned long to 2D/unsigned long::" -msgstr "" +msgstr "بازیگران 1 بعدی / بدون علامت طولانی به 2 بعدی / بدون علامت طولانی::" #: library/stdtypes.rst:4092 -msgid ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +#, fuzzy +msgid "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" ">>> y = x.cast('L', shape=[2,3])\n" ">>> len(y)\n" @@ -3798,32 +7683,59 @@ msgid ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" msgstr "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('L', shape=[2,3])\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> y.tolist()\n" +"[[0, 1, 2], [3, 4, 5]]" #: library/stdtypes.rst:4104 +#, fuzzy msgid "The source format is no longer restricted when casting to a byte view." -msgstr "" +msgstr "هنگام ارسال به نمای بایت، قالب منبع دیگر محدود نمی شود." #: library/stdtypes.rst:4107 +#, fuzzy msgid "There are also several readonly attributes available:" -msgstr "" +msgstr "چندین ویژگی فقط خواندنی نیز وجود دارد:" #: library/stdtypes.rst:4111 +#, fuzzy msgid "The underlying object of the memoryview::" -msgstr "" +msgstr "هدف اصلی مموری ویو:" #: library/stdtypes.rst:4113 -msgid ">>> b = bytearray(b'xyz')\n" +#, fuzzy +msgid "" +">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" ">>> m.obj is b\n" "True" msgstr "" +">>> b = bytearray(b'xyz')\n" +">>> m = memoryview(b)\n" +">>> m.obj is b\n" +"True" #: library/stdtypes.rst:4122 -msgid "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous representation. It is not necessarily equal to ``len(m)``::" +#, fuzzy +msgid "" +"``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " +"amount of space in bytes that the array would use in a contiguous " +"representation. It is not necessarily equal to ``len(m)``::" msgstr "" +"``nbytes == product(shape) * itemsize == len(m.tobytes())``. این مقدار فضایی" +" بر حسب بایت است که آرایه در یک نمایش پیوسته از آن استفاده می کند. لزوما " +"برابر با ``len(m)`` نیست::" #: library/stdtypes.rst:4126 -msgid ">>> import array\n" +#, fuzzy +msgid "" +">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" ">>> m = memoryview(a)\n" ">>> len(m)\n" @@ -3838,13 +7750,30 @@ msgid ">>> import array\n" ">>> len(y.tobytes())\n" "12" msgstr "" +">>> import array\n" +">>> a = array.array('i', [1,2,3,4,5])\n" +">>> m = memoryview(a)\n" +">>> len(m)\n" +"5\n" +">>> m.nbytes\n" +"20\n" +">>> y = m[::2]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"12\n" +">>> len(y.tobytes())\n" +"12" #: library/stdtypes.rst:4141 +#, fuzzy msgid "Multi-dimensional arrays::" -msgstr "" +msgstr "آرایه های چند بعدی::" #: library/stdtypes.rst:4143 -msgid ">>> import struct\n" +#, fuzzy +msgid "" +">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" ">>> x = memoryview(buf)\n" ">>> y = x.cast('d', shape=[3,4])\n" @@ -3855,25 +7784,52 @@ msgid ">>> import struct\n" ">>> y.nbytes\n" "96" msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('d', shape=[3,4])\n" +">>> y.tolist()\n" +"[[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"96" #: library/stdtypes.rst:4158 +#, fuzzy msgid "A bool indicating whether the memory is read only." -msgstr "" +msgstr "یک بوول که نشان می دهد آیا حافظه فقط خواندنی است یا خیر." #: library/stdtypes.rst:4162 -msgid "A string containing the format (in :mod:`struct` module style) for each element in the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats." +#, fuzzy +msgid "" +"A string containing the format (in :mod:`struct` module style) for each " +"element in the view. A memoryview can be created from exporters with " +"arbitrary format strings, but some methods (e.g. :meth:`tolist`) are " +"restricted to native single element formats." msgstr "" +"یک رشته حاوی قالب (به سبک ماژول :mod:`struct`) برای هر عنصر در نما. مموری " +"ویو را می توان از صادرکنندگان با رشته های قالب دلخواه ایجاد کرد، اما برخی " +"روش ها (مانند :meth:`tolist`) به فرمت های تک عنصری بومی محدود می شوند." #: library/stdtypes.rst:4167 -msgid "format ``'B'`` is now handled according to the struct module syntax. This means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." +#, fuzzy +msgid "" +"format ``'B'`` is now handled according to the struct module syntax. This " +"means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" +"فرمت ``'B'`` اکنون بر اساس نحو ماژول ساختار مدیریت می شود. این بدان معنی است" +" که ``memoryview(b'abc')[0] == b'abc'[0] == 97``." #: library/stdtypes.rst:4173 +#, fuzzy msgid "The size in bytes of each element of the memoryview::" -msgstr "" +msgstr "اندازه هر عنصر مموری ویو بر حسب بایت:" #: library/stdtypes.rst:4175 -msgid ">>> import array, struct\n" +#, fuzzy +msgid "" +">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" ">>> m.itemsize\n" "2\n" @@ -3882,262 +7838,569 @@ msgid ">>> import array, struct\n" ">>> struct.calcsize('H') == m.itemsize\n" "True" msgstr "" +">>> import array, struct\n" +">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" +">>> m.itemsize\n" +"2\n" +">>> m[0]\n" +"32000\n" +">>> struct.calcsize('H') == m.itemsize\n" +"True" #: library/stdtypes.rst:4186 -msgid "An integer indicating how many dimensions of a multi-dimensional array the memory represents." +#, fuzzy +msgid "" +"An integer indicating how many dimensions of a multi-dimensional array the " +"memory represents." msgstr "" +"یک عدد صحیح که نشان می دهد حافظه چند بعد از یک آرایه چند بعدی را نشان می " +"دهد." #: library/stdtypes.rst:4191 -msgid "A tuple of integers the length of :attr:`ndim` giving the shape of the memory as an N-dimensional array." +#, fuzzy +msgid "" +"A tuple of integers the length of :attr:`ndim` giving the shape of the " +"memory as an N-dimensional array." msgstr "" +"چند اعداد صحیح به طول :attr:`ndim` شکل حافظه را به عنوان یک آرایه N بعدی می " +"دهد." -#: library/stdtypes.rst:4194 -#: library/stdtypes.rst:4202 +#: library/stdtypes.rst:4194 library/stdtypes.rst:4202 +#, fuzzy msgid "An empty tuple instead of ``None`` when ndim = 0." -msgstr "" +msgstr "یک تاپل خالی به جای ``None`` وقتی ndim = 0 است." #: library/stdtypes.rst:4199 -msgid "A tuple of integers the length of :attr:`ndim` giving the size in bytes to access each element for each dimension of the array." +#, fuzzy +msgid "" +"A tuple of integers the length of :attr:`ndim` giving the size in bytes to " +"access each element for each dimension of the array." msgstr "" +"چند اعداد صحیح به طول :attr:`ndim` که اندازه را بر حسب بایت برای دسترسی به " +"هر عنصر برای هر بعد آرایه می دهد." #: library/stdtypes.rst:4207 +#, fuzzy msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" +"به صورت داخلی برای آرایه های به سبک PIL استفاده می شود. ارزش فقط اطلاعاتی " +"است." #: library/stdtypes.rst:4211 +#, fuzzy msgid "A bool indicating whether the memory is C-:term:`contiguous`." -msgstr "" +msgstr "یک بولی که نشان می دهد حافظه C-:term:`contiguous` است یا خیر." #: library/stdtypes.rst:4217 +#, fuzzy msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." -msgstr "" +msgstr "یک بولی که نشان می دهد حافظه Fortran :term:`contiguous` است یا خیر." #: library/stdtypes.rst:4223 +#, fuzzy msgid "A bool indicating whether the memory is :term:`contiguous`." -msgstr "" +msgstr "یک بولی که نشان می دهد حافظه :term:`contiguous` است یا خیر." #: library/stdtypes.rst:4231 +#, fuzzy msgid "Set Types --- :class:`set`, :class:`frozenset`" -msgstr "" +msgstr "انواع مجموعه --- :class:`set`, :class:`frozenset`" #: library/stdtypes.rst:4235 -msgid "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` objects. Common uses include membership testing, removing duplicates from a sequence, and computing mathematical operations such as intersection, union, difference, and symmetric difference. (For other containers see the built-in :class:`dict`, :class:`list`, and :class:`tuple` classes, and the :mod:`collections` module.)" -msgstr "" +#, fuzzy +msgid "" +"A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " +"objects. Common uses include membership testing, removing duplicates from a " +"sequence, and computing mathematical operations such as intersection, union," +" difference, and symmetric difference. (For other containers see the built-" +"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and the " +":mod:`collections` module.)" +msgstr "" +"یک شی :dfn:`set` مجموعه ای نامرتب از اشیاء متمایز :term:`hashable` است. " +"کاربردهای رایج شامل تست عضویت، حذف موارد تکراری از یک دنباله و محاسبه عملیات" +" ریاضی مانند تقاطع، اتحاد، تفاوت و تفاوت متقارن است. (برای سایر کانتینرها به" +" کلاس های داخلی :class:`dict`, :class:`list`, و :class:`tuple` و ماژول " +":mod:`collections` مراجعه کنید.)" #: library/stdtypes.rst:4242 -msgid "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x in set``. Being an unordered collection, sets do not record element position or order of insertion. Accordingly, sets do not support indexing, slicing, or other sequence-like behavior." +#, fuzzy +msgid "" +"Like other collections, sets support ``x in set``, ``len(set)``, and ``for x" +" in set``. Being an unordered collection, sets do not record element " +"position or order of insertion. Accordingly, sets do not support indexing, " +"slicing, or other sequence-like behavior." msgstr "" +"مانند سایر مجموعه ها، مجموعه ها از ``x in set``، ``len(set)`` و ``for x in " +"set`` پشتیبانی می کنند. مجموعه‌ها از آنجایی که مجموعه‌ای نامرتب هستند، " +"موقعیت یا ترتیب درج عنصر را ثبت نمی‌کنند. بر این اساس، مجموعه ها از نمایه " +"سازی، برش یا سایر رفتارهای توالی مانند پشتیبانی نمی کنند." #: library/stdtypes.rst:4247 -msgid "There are currently two built-in set types, :class:`set` and :class:`frozenset`. The :class:`set` type is mutable --- the contents can be changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since it is mutable, it has no hash value and cannot be used as either a dictionary key or as an element of another set. The :class:`frozenset` type is immutable and :term:`hashable` --- its contents cannot be altered after it is created; it can therefore be used as a dictionary key or as an element of another set." -msgstr "" +#, fuzzy +msgid "" +"There are currently two built-in set types, :class:`set` and " +":class:`frozenset`. The :class:`set` type is mutable --- the contents can be" +" changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since" +" it is mutable, it has no hash value and cannot be used as either a " +"dictionary key or as an element of another set. The :class:`frozenset` type" +" is immutable and :term:`hashable` --- its contents cannot be altered after " +"it is created; it can therefore be used as a dictionary key or as an element" +" of another set." +msgstr "" +"در حال حاضر دو نوع مجموعه داخلی وجود دارد، :class:`set` و " +":class:`frozenset`. نوع :class:`set` قابل تغییر است --- محتویات را می توان " +"با استفاده از روش هایی مانند :meth:`~set.add` و :meth:`~set.remove` تغییر " +"داد. از آنجایی که قابل تغییر است، هیچ مقدار هش ندارد و نمی تواند به عنوان " +"کلید فرهنگ لغت یا به عنوان عنصری از مجموعه دیگری استفاده شود. نوع " +":class:`frozenset` تغییرناپذیر است و :term:`hashable` --- محتویات آن را نمی " +"توان پس از ایجاد تغییر داد. بنابراین می توان از آن به عنوان کلید فرهنگ لغت " +"یا به عنوان عنصری از مجموعه دیگری استفاده کرد." #: library/stdtypes.rst:4255 -msgid "Non-empty sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor." +#, fuzzy +msgid "" +"Non-empty sets (not frozensets) can be created by placing a comma-separated " +"list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " +"addition to the :class:`set` constructor." msgstr "" +"مجموعه‌های غیر خالی (نه مجموعه‌های منجمد) را می‌توان با قرار دادن فهرستی از " +"عناصر جدا شده با کاما در داخل پرانتزها ایجاد کرد، برای مثال: ``{'jack', " +"'sjoerd'}``، علاوه بر سازنده :class:`set`." #: library/stdtypes.rst:4259 +#, fuzzy msgid "The constructors for both classes work the same:" -msgstr "" +msgstr "سازنده های هر دو کلاس یکسان کار می کنند:" #: library/stdtypes.rst:4264 -msgid "Return a new set or frozenset object whose elements are taken from *iterable*. The elements of a set must be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is returned." +#, fuzzy +msgid "" +"Return a new set or frozenset object whose elements are taken from " +"*iterable*. The elements of a set must be :term:`hashable`. To represent " +"sets of sets, the inner sets must be :class:`frozenset` objects. If " +"*iterable* is not specified, a new empty set is returned." msgstr "" +"یک مجموعه جدید یا شیء منجمد شده که عناصر آن از *iterable* گرفته شده است را " +"برگردانید. عناصر یک مجموعه باید :term:`hashable` باشد. برای نمایش مجموعه " +"ای از مجموعه ها، مجموعه های داخلی باید اشیاء :class:`frozenset` باشند. اگر " +"*iterable* مشخص نشده باشد، یک مجموعه خالی جدید برگردانده می شود." #: library/stdtypes.rst:4270 +#, fuzzy msgid "Sets can be created by several means:" -msgstr "" +msgstr "مجموعه ها را می توان به روش های مختلفی ایجاد کرد:" #: library/stdtypes.rst:4272 -msgid "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" +#, fuzzy +msgid "" +"Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" +"از یک لیست جدا شده با کاما از عناصر درون پرانتز استفاده کنید: ``{'jack', " +"'sjoerd'}``" #: library/stdtypes.rst:4273 -msgid "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" +#, fuzzy +msgid "" +"Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" +"از یک مجموعه درک استفاده کنید: ``{c for c in 'abracadabra' if c not in " +"'abc'}``" #: library/stdtypes.rst:4274 -msgid "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])``" +#, fuzzy +msgid "" +"Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " +"'foo'])``" msgstr "" +"از سازنده نوع استفاده کنید: ``set()``، ``set('foobar')``، ``set(['a', 'b', " +"'foo'])``" #: library/stdtypes.rst:4276 -msgid "Instances of :class:`set` and :class:`frozenset` provide the following operations:" +#, fuzzy +msgid "" +"Instances of :class:`set` and :class:`frozenset` provide the following " +"operations:" msgstr "" +"نمونه های :class:`set` و :class:`frozenset` عملیات زیر را ارائه می دهند:" #: library/stdtypes.rst:4281 +#, fuzzy msgid "Return the number of elements in set *s* (cardinality of *s*)." -msgstr "" +msgstr "تعداد عناصر موجود در مجموعه *s* را برگردانید (کاردینالیته *s*)." #: library/stdtypes.rst:4285 +#, fuzzy msgid "Test *x* for membership in *s*." -msgstr "" +msgstr "*x* را برای عضویت در *s* تست کنید." #: library/stdtypes.rst:4289 +#, fuzzy msgid "Test *x* for non-membership in *s*." -msgstr "" +msgstr "*x* را برای عدم عضویت در *s* آزمایش کنید." #: library/stdtypes.rst:4293 -msgid "Return ``True`` if the set has no elements in common with *other*. Sets are disjoint if and only if their intersection is the empty set." +#, fuzzy +msgid "" +"Return ``True`` if the set has no elements in common with *other*. Sets are" +" disjoint if and only if their intersection is the empty set." msgstr "" +"اگر مجموعه هیچ عنصر مشترکی با *other* ندارد، ``True`` را برگردانید. " +"مجموعه‌ها متفرق هستند اگر و تنها در صورتی که تقاطع آنها مجموعه خالی باشد." #: library/stdtypes.rst:4299 +#, fuzzy msgid "Test whether every element in the set is in *other*." -msgstr "" +msgstr "تست کنید که آیا هر عنصر در مجموعه در *other* است یا خیر." #: library/stdtypes.rst:4303 -msgid "Test whether the set is a proper subset of *other*, that is, ``set <= other and set != other``." +#, fuzzy +msgid "" +"Test whether the set is a proper subset of *other*, that is, ``set <= other " +"and set != other``." msgstr "" +"تست کنید که آیا مجموعه زیرمجموعه مناسب *other*، یعنی ``set <= other and set " +"!= other`` است یا خیر." #: library/stdtypes.rst:4309 +#, fuzzy msgid "Test whether every element in *other* is in the set." -msgstr "" +msgstr "تست کنید که آیا هر عنصر در *other* در مجموعه است یا خیر." #: library/stdtypes.rst:4313 -msgid "Test whether the set is a proper superset of *other*, that is, ``set >= other and set != other``." +#, fuzzy +msgid "" +"Test whether the set is a proper superset of *other*, that is, ``set >= " +"other and set != other``." msgstr "" +"تست کنید که آیا مجموعه فوق مجموعه مناسب *other*، یعنی ``set >= other and set" +" != other`` است یا خیر." #: library/stdtypes.rst:4319 +#, fuzzy msgid "Return a new set with elements from the set and all others." -msgstr "" +msgstr "یک مجموعه جدید با عناصر مجموعه و سایر موارد را برگردانید." #: library/stdtypes.rst:4324 +#, fuzzy msgid "Return a new set with elements common to the set and all others." -msgstr "" +msgstr "یک مجموعه جدید با عناصر مشترک در مجموعه و سایر موارد را برگردانید." #: library/stdtypes.rst:4329 +#, fuzzy msgid "Return a new set with elements in the set that are not in the others." msgstr "" +"مجموعه جدیدی را با عناصر موجود در مجموعه که در سایرین وجود ندارد، برگردانید." #: library/stdtypes.rst:4334 -msgid "Return a new set with elements in either the set or *other* but not both." +#, fuzzy +msgid "" +"Return a new set with elements in either the set or *other* but not both." msgstr "" +"یک مجموعه جدید را با عناصر در مجموعه یا *other* برگردانید اما نه هر دو." #: library/stdtypes.rst:4338 +#, fuzzy msgid "Return a shallow copy of the set." -msgstr "" +msgstr "یک کپی کم عمق از مجموعه را برگردانید." #: library/stdtypes.rst:4341 -msgid "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:`issuperset` methods will accept any iterable as an argument. In contrast, their operator based counterparts require their arguments to be sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of the more readable ``set('abc').intersection('cbs')``." -msgstr "" +#, fuzzy +msgid "" +"Note, the non-operator versions of :meth:`union`, :meth:`intersection`, " +":meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and " +":meth:`issuperset` methods will accept any iterable as an argument. In " +"contrast, their operator based counterparts require their arguments to be " +"sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` " +"in favor of the more readable ``set('abc').intersection('cbs')``." +msgstr "" +"توجه داشته باشید، نسخه‌های غیر عامل متدهای :meth:`union`، " +":meth:`intersection`، :meth:`difference`، :meth:`symmetric_difference`، " +":meth:`issubset`، و :meth:`issuperset`، هر تکرارپذیری را به عنوان آرگومان " +"می‌پذیرند. در مقابل، همتایان مبتنی بر اپراتور آنها نیاز دارند که آرگومان " +"های آنها مجموعه باشد. این مانع از ساختارهای مستعد خطا مانند ``set('abc') & " +"'cbs'`` به نفع خواناتر ``set('abc').intersection('cbs')`` می شود." #: library/stdtypes.rst:4348 -msgid "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two sets are equal if and only if every element of each set is contained in the other (each is a subset of the other). A set is less than another set if and only if the first set is a proper subset of the second set (is a subset, but is not equal). A set is greater than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal)." -msgstr "" +#, fuzzy +msgid "" +"Both :class:`set` and :class:`frozenset` support set to set comparisons. Two" +" sets are equal if and only if every element of each set is contained in the" +" other (each is a subset of the other). A set is less than another set if " +"and only if the first set is a proper subset of the second set (is a subset," +" but is not equal). A set is greater than another set if and only if the " +"first set is a proper superset of the second set (is a superset, but is not " +"equal)." +msgstr "" +"هر دو :class:`set` و :class:`frozenset` برای تنظیم مقایسه ها پشتیبانی می " +"کنند. دو مجموعه برابر هستند اگر و فقط در صورتی که هر عنصر از هر مجموعه در " +"دیگری موجود باشد (هر کدام زیرمجموعه دیگری است). یک مجموعه کمتر از مجموعه " +"دیگر است اگر و تنها در صورتی که مجموعه اول زیرمجموعه مناسب مجموعه دوم باشد " +"(یک زیر مجموعه است, اما برابر نیست). یک مجموعه بزرگتر از مجموعه دیگر است اگر" +" و تنها در صورتی که مجموعه اول یک ابر مجموعه مناسب از مجموعه دوم باشد (یک " +"ابر مجموعه است, اما برابر نیست)." #: library/stdtypes.rst:4355 -msgid "Instances of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." +#, fuzzy +msgid "" +"Instances of :class:`set` are compared to instances of :class:`frozenset` " +"based on their members. For example, ``set('abc') == frozenset('abc')`` " +"returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" +"نمونه‌های :class:`set` با نمونه‌های :class:`frozenset` بر اساس اعضایشان " +"مقایسه می‌شوند. برای مثال، ``set('abc') == frozenset('abc')`` ``True`` را " +"برمی‌گرداند و ``set('abc') in set([frozenset('abc')])`` را نیز برمی‌گرداند." #: library/stdtypes.rst:4359 -msgid "The subset and equality comparisons do not generalize to a total ordering function. For example, any two nonempty disjoint sets are not equal and are not subsets of each other, so *all* of the following return ``False``: ``ab``." +#, fuzzy +msgid "" +"The subset and equality comparisons do not generalize to a total ordering " +"function. For example, any two nonempty disjoint sets are not equal and are" +" not subsets of each other, so *all* of the following return ``False``: " +"``ab``." msgstr "" +"مقایسه زیر مجموعه و برابری به یک تابع ترتیب کل تعمیم نمی یابد. به عنوان " +"مثال، هر دو مجموعه مجزای غیر خالی برابر نیستند و زیرمجموعه یکدیگر نیستند، " +"بنابراین *all* از ``False`` برمی‌گرداند: ``ab``." #: library/stdtypes.rst:4364 -msgid "Since sets only define partial ordering (subset relationships), the output of the :meth:`list.sort` method is undefined for lists of sets." +#, fuzzy +msgid "" +"Since sets only define partial ordering (subset relationships), the output " +"of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" +"از آنجایی که مجموعه ها فقط ترتیب جزئی را تعریف می کنند (روابط زیر مجموعه), " +"خروجی روش :meth:`list.sort` برای لیست مجموعه ها تعریف نشده است." #: library/stdtypes.rst:4367 +#, fuzzy msgid "Set elements, like dictionary keys, must be :term:`hashable`." -msgstr "" +msgstr "عناصر مجموعه، مانند کلیدهای فرهنگ لغت، باید :term:`hashable` باشند." #: library/stdtypes.rst:4369 -msgid "Binary operations that mix :class:`set` instances with :class:`frozenset` return the type of the first operand. For example: ``frozenset('ab') | set('bc')`` returns an instance of :class:`frozenset`." +#, fuzzy +msgid "" +"Binary operations that mix :class:`set` instances with :class:`frozenset` " +"return the type of the first operand. For example: ``frozenset('ab') | " +"set('bc')`` returns an instance of :class:`frozenset`." msgstr "" +"عملیات باینری که نمونه های :class:`set` را با :class:`frozenset` مخلوط می " +"کنند، نوع عملوند اول را برمی گرداند. به عنوان مثال: ``frozenset('ab') | " +"set('bc')`` نمونه ای از :class:`frozenset` را برمی گرداند." #: library/stdtypes.rst:4373 -msgid "The following table lists operations available for :class:`set` that do not apply to immutable instances of :class:`frozenset`:" +#, fuzzy +msgid "" +"The following table lists operations available for :class:`set` that do not " +"apply to immutable instances of :class:`frozenset`:" msgstr "" +"جدول زیر عملیات های موجود برای :class:`set` را فهرست می کند که برای نمونه " +"های تغییرناپذیر :class:`frozenset` اعمال نمی شود:" #: library/stdtypes.rst:4379 +#, fuzzy msgid "Update the set, adding elements from all others." -msgstr "" +msgstr "مجموعه را به روز کنید، عناصری را از بقیه اضافه کنید." #: library/stdtypes.rst:4384 +#, fuzzy msgid "Update the set, keeping only elements found in it and all others." msgstr "" +"مجموعه را به روز کنید و فقط عناصر موجود در آن و سایر موارد را حفظ کنید." #: library/stdtypes.rst:4389 +#, fuzzy msgid "Update the set, removing elements found in others." -msgstr "" +msgstr "مجموعه را به روز کنید و عناصر موجود در سایرین را حذف کنید." #: library/stdtypes.rst:4394 -msgid "Update the set, keeping only elements found in either set, but not in both." +#, fuzzy +msgid "" +"Update the set, keeping only elements found in either set, but not in both." msgstr "" +"مجموعه را به روز کنید، فقط عناصر موجود در هر دو مجموعه را حفظ کنید، اما نه " +"در هر دو." #: library/stdtypes.rst:4398 +#, fuzzy msgid "Add element *elem* to the set." -msgstr "" +msgstr "عنصر *elem* را به مجموعه اضافه کنید." #: library/stdtypes.rst:4402 -msgid "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not contained in the set." +#, fuzzy +msgid "" +"Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not" +" contained in the set." msgstr "" +"عنصر *elem* را از مجموعه حذف کنید. اگر *elem* در مجموعه موجود نباشد، " +":exc:`KeyError` را افزایش می دهد." #: library/stdtypes.rst:4407 +#, fuzzy msgid "Remove element *elem* from the set if it is present." -msgstr "" +msgstr "عنصر *elem* را در صورت وجود از مجموعه حذف کنید." #: library/stdtypes.rst:4411 -msgid "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` if the set is empty." +#, fuzzy +msgid "" +"Remove and return an arbitrary element from the set. Raises :exc:`KeyError`" +" if the set is empty." msgstr "" +"یک عنصر دلخواه را از مجموعه حذف و برگردانید. اگر مجموعه خالی باشد، " +":exc:`KeyError` را افزایش می دهد." #: library/stdtypes.rst:4416 +#, fuzzy msgid "Remove all elements from the set." -msgstr "" +msgstr "تمام عناصر را از مجموعه حذف کنید." #: library/stdtypes.rst:4419 -msgid "Note, the non-operator versions of the :meth:`update`, :meth:`intersection_update`, :meth:`difference_update`, and :meth:`symmetric_difference_update` methods will accept any iterable as an argument." +#, fuzzy +msgid "" +"Note, the non-operator versions of the :meth:`update`, " +":meth:`intersection_update`, :meth:`difference_update`, and " +":meth:`symmetric_difference_update` methods will accept any iterable as an " +"argument." msgstr "" +"توجه داشته باشید، نسخه‌های غیر عامل متدهای :meth:`update`، " +":meth:`intersection_update`، :meth:`difference_update`، و " +":meth:`symmetric_difference_update` هر تکرارپذیری را به عنوان آرگومان " +"می‌پذیرند." #: library/stdtypes.rst:4424 -msgid "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`remove`, and :meth:`discard` methods may be a set. To support searching for an equivalent frozenset, a temporary one is created from *elem*." +#, fuzzy +msgid "" +"Note, the *elem* argument to the :meth:`~object.__contains__`, " +":meth:`remove`, and :meth:`discard` methods may be a set. To support " +"searching for an equivalent frozenset, a temporary one is created from " +"*elem*." msgstr "" +"توجه داشته باشید، آرگومان *elem* به متدهای :meth:`~object.__contains__`، " +":meth:`remove` و :meth:`discard` ممکن است یک مجموعه باشد. برای پشتیبانی از " +"جستجوی یک منجمد معادل، یک مجموعه موقت از *elem* ایجاد می شود." #: library/stdtypes.rst:4433 +#, fuzzy msgid "Mapping Types --- :class:`dict`" -msgstr "" +msgstr "انواع نقشه برداری --- :class:`dict`" #: library/stdtypes.rst:4443 -msgid "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. Mappings are mutable objects. There is currently only one standard mapping type, the :dfn:`dictionary`. (For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.)" -msgstr "" +#, fuzzy +msgid "" +"A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " +"Mappings are mutable objects. There is currently only one standard mapping " +"type, the :dfn:`dictionary`. (For other containers see the built-in " +":class:`list`, :class:`set`, and :class:`tuple` classes, and the " +":mod:`collections` module.)" +msgstr "" +"یک شی :term:`mapping` مقادیر :term:`hashable` را به اشیاء دلخواه نگاشت می " +"کند. نگاشت ها اشیا قابل تغییر هستند. در حال حاضر تنها یک نوع نگاشت " +"استاندارد وجود دارد، :dfn:`dictionary`. (برای سایر کانتینرها به کلاس های " +"داخلی :class:`list`, :class:`set`, و :class:`tuple` و ماژول " +":mod:`collections` مراجعه کنید.)" #: library/stdtypes.rst:4449 -msgid "A dictionary's keys are *almost* arbitrary values. Values that are not :term:`hashable`, that is, values containing lists, dictionaries or other mutable types (that are compared by value rather than by object identity) may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, and ``True``) can be used interchangeably to index the same dictionary entry." -msgstr "" +#, fuzzy +msgid "" +"A dictionary's keys are *almost* arbitrary values. Values that are not " +":term:`hashable`, that is, values containing lists, dictionaries or other " +"mutable types (that are compared by value rather than by object identity) " +"may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, " +"and ``True``) can be used interchangeably to index the same dictionary " +"entry." +msgstr "" +"کلیدهای یک فرهنگ لغت مقادیر دلخواه *almost* هستند. مقادیری که " +":term:`hashable` نیستند، یعنی مقادیری که شامل لیست ها، فرهنگ لغت ها یا انواع" +" قابل تغییر هستند (که به جای هویت شی با ارزش مقایسه می شوند) نمی توانند به " +"عنوان کلید استفاده شوند. مقادیری که با هم مقایسه می شوند (مانند ``1``, " +"``1.0``, و ``True``) می توانند به جای هم برای نمایه سازی یک مدخل فرهنگ لغت " +"استفاده شوند." #: library/stdtypes.rst:4460 -msgid "Return a new dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments." +#, fuzzy +msgid "" +"Return a new dictionary initialized from an optional positional argument and" +" a possibly empty set of keyword arguments." msgstr "" +"یک فرهنگ لغت جدید را که از یک آرگومان موقعیتی اختیاری و یک مجموعه احتمالاً " +"خالی از آرگومان های کلیدواژه مقداردهی شده است، بازگردانید." #: library/stdtypes.rst:4463 +#, fuzzy msgid "Dictionaries can be created by several means:" -msgstr "" +msgstr "فرهنگ لغت را می توان به روش های مختلفی ایجاد کرد:" #: library/stdtypes.rst:4465 -msgid "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" +#, fuzzy +msgid "" +"Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack':" +" 4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" +"از یک لیست جدا شده با کاما از جفت های ``key: value`` در پرانتزها استفاده " +"کنید: ``{'jack': 4098, 'sjoerd': 4127}`` یا ``{4098: 'jack', 4127: " +"'sjoerd'}``" #: library/stdtypes.rst:4467 +#, fuzzy msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" -msgstr "" +msgstr "از درک دیکت استفاده کنید: ``{}``، ``{x: x ** 2 for x in range(10)}``" #: library/stdtypes.rst:4468 -msgid "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', 200)])``, ``dict(foo=100, bar=200)``" +#, fuzzy +msgid "" +"Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " +"200)])``, ``dict(foo=100, bar=200)``" msgstr "" +"از سازنده نوع استفاده کنید: ``dict()``، ``dict([('foo', 100), ('bar', " +"200)])``، ``dict(foo=100, bar=200)``" #: library/stdtypes.rst:4471 -msgid "If no positional argument is given, an empty dictionary is created. If a positional argument is given and it defines a ``keys()`` method, a dictionary is created by calling :meth:`~object.__getitem__` on the argument with each returned key from the method. Otherwise, the positional argument must be an :term:`iterable` object. Each item in the iterable must itself be an iterable with exactly two elements. The first element of each item becomes a key in the new dictionary, and the second element the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary." -msgstr "" +#, fuzzy +msgid "" +"If no positional argument is given, an empty dictionary is created. If a " +"positional argument is given and it defines a ``keys()`` method, a " +"dictionary is created by calling :meth:`~object.__getitem__` on the argument" +" with each returned key from the method. Otherwise, the positional argument" +" must be an :term:`iterable` object. Each item in the iterable must itself " +"be an iterable with exactly two elements. The first element of each item " +"becomes a key in the new dictionary, and the second element the " +"corresponding value. If a key occurs more than once, the last value for " +"that key becomes the corresponding value in the new dictionary." +msgstr "" +"اگر آرگومان موقعیتی داده نشود، یک فرهنگ لغت خالی ایجاد می شود. اگر یک " +"آرگومان موقعیتی داده شود و یک متد ``keys()`` را تعریف کند، یک فرهنگ لغت با " +"فراخوانی :meth:`~object.__getitem__` روی آرگومان با هر کلید برگشتی از متد " +"ایجاد می شود. در غیر این صورت، آرگومان موقعیتی باید یک شی :term:`iterable` " +"باشد. هر مورد در تکرارپذیر باید خودش یک تکرارپذیر با دو عنصر باشد. عنصر " +"اول هر آیتم به یک کلید در فرهنگ لغت جدید تبدیل می شود و عنصر دوم مقدار " +"مربوطه. اگر یک کلید بیش از یک بار اتفاق بیفتد، آخرین مقدار آن کلید به مقدار" +" مربوطه در فرهنگ لغت جدید تبدیل می شود." #: library/stdtypes.rst:4481 -msgid "If keyword arguments are given, the keyword arguments and their values are added to the dictionary created from the positional argument. If a key being added is already present, the value from the keyword argument replaces the value from the positional argument." +#, fuzzy +msgid "" +"If keyword arguments are given, the keyword arguments and their values are " +"added to the dictionary created from the positional argument. If a key " +"being added is already present, the value from the keyword argument replaces" +" the value from the positional argument." msgstr "" +"اگر آرگومان های کلمه کلیدی داده شوند، آرگومان های کلیدواژه و مقادیر آنها به " +"فرهنگ لغت ایجاد شده از آرگومان موقعیتی اضافه می شوند. اگر یک کلید در حال " +"اضافه شدن از قبل وجود داشته باشد، مقدار آرگومان کلمه کلیدی جایگزین مقدار " +"آرگومان موقعیتی می شود." #: library/stdtypes.rst:4486 -msgid "To illustrate, the following examples all return a dictionary equal to ``{\"one\": 1, \"two\": 2, \"three\": 3}``::" +#, fuzzy +msgid "" +"To illustrate, the following examples all return a dictionary equal to " +"``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" +"برای نشان دادن، مثال‌های زیر همگی یک دیکشنری برابر با ``{\"one\": 1, " +"\"two\": 2, \"three\": 3}`` برمی‌گردانند:" #: library/stdtypes.rst:4489 -msgid ">>> a = dict(one=1, two=2, three=3)\n" +#, fuzzy +msgid "" +">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" ">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" ">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" @@ -4146,33 +8409,76 @@ msgid ">>> a = dict(one=1, two=2, three=3)\n" ">>> a == b == c == d == e == f\n" "True" msgstr "" +">>> a = dict(one=1, two=2, three=3)\n" +">>> b = {'one': 1, 'two': 2, 'three': 3}\n" +">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" +">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" +">>> e = dict({'three': 3, 'one': 1, 'two': 2})\n" +">>> f = dict({'one': 1, 'three': 3}, two=2)\n" +">>> a == b == c == d == e == f\n" +"True" #: library/stdtypes.rst:4498 -msgid "Providing keyword arguments as in the first example only works for keys that are valid Python identifiers. Otherwise, any valid keys can be used." +#, fuzzy +msgid "" +"Providing keyword arguments as in the first example only works for keys that" +" are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" +"ارائه آرگومان های کلمه کلیدی مانند مثال اول فقط برای کلیدهایی کار می کند که " +"شناسه پایتون معتبر هستند. در غیر این صورت، می توان از هر کلید معتبر استفاده" +" کرد." #: library/stdtypes.rst:4502 -msgid "These are the operations that dictionaries support (and therefore, custom mapping types should support too):" +#, fuzzy +msgid "" +"These are the operations that dictionaries support (and therefore, custom " +"mapping types should support too):" msgstr "" +"اینها عملیاتی هستند که دیکشنری ها پشتیبانی می کنند (و بنابراین, انواع نقشه " +"برداری سفارشی نیز باید پشتیبانی کنند):" #: library/stdtypes.rst:4507 +#, fuzzy msgid "Return a list of all the keys used in the dictionary *d*." -msgstr "" +msgstr "فهرستی از تمام کلیدهای استفاده شده در فرهنگ لغت *d* را برگردانید." #: library/stdtypes.rst:4511 +#, fuzzy msgid "Return the number of items in the dictionary *d*." -msgstr "" +msgstr "تعداد موارد موجود در فرهنگ لغت *d* را برگردانید." #: library/stdtypes.rst:4515 -msgid "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map." +#, fuzzy +msgid "" +"Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is" +" not in the map." msgstr "" +"مورد *d* را با کلید *key* برگردانید. اگر *key* در نقشه نباشد یک " +":exc:`KeyError` را افزایش می دهد." #: library/stdtypes.rst:4520 -msgid "If a subclass of dict defines a method :meth:`__missing__` and *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or raises whatever is returned or raised by the ``__missing__(key)`` call. No other operations or methods invoke :meth:`__missing__`. If :meth:`__missing__` is not defined, :exc:`KeyError` is raised. :meth:`__missing__` must be a method; it cannot be an instance variable::" -msgstr "" +#, fuzzy +msgid "" +"If a subclass of dict defines a method :meth:`__missing__` and *key* is not " +"present, the ``d[key]`` operation calls that method with the key *key* as " +"argument. The ``d[key]`` operation then returns or raises whatever is " +"returned or raised by the ``__missing__(key)`` call. No other operations or " +"methods invoke :meth:`__missing__`. If :meth:`__missing__` is not defined, " +":exc:`KeyError` is raised. :meth:`__missing__` must be a method; it cannot " +"be an instance variable::" +msgstr "" +"اگر یک زیر کلاس از dict متد :meth:`__missing__` را تعریف کند و *key* وجود " +"نداشته باشد، عملیات ``d[key]`` آن متد را با کلید *key* به عنوان آرگومان " +"فراخوانی می کند. سپس عملیات ``d[key]`` هر آنچه را که توسط فراخوانی " +"``__missing__(key)`` برگردانده یا افزایش یافته است، برمی گرداند یا افزایش می" +" دهد. هیچ عملیات یا روش دیگری :meth:`__missing__` را فراخوانی نمی کند. اگر " +":meth:`__missing__` تعریف نشده باشد، :exc:`KeyError` مطرح می شود. " +":meth:`__missing__` باید یک روش باشد. نمی تواند یک متغیر نمونه باشد::" #: library/stdtypes.rst:4528 -msgid ">>> class Counter(dict):\n" +#, fuzzy +msgid "" +">>> class Counter(dict):\n" "... def __missing__(self, key):\n" "... return 0\n" "...\n" @@ -4183,123 +8489,284 @@ msgid ">>> class Counter(dict):\n" ">>> c['red']\n" "1" msgstr "" +">>> class Counter(dict):\n" +"... def __missing__(self, key):\n" +"... return 0\n" +"...\n" +">>> c = Counter()\n" +">>> c['red']\n" +"0\n" +">>> c['red'] += 1\n" +">>> c['red']\n" +"1" #: library/stdtypes.rst:4539 -msgid "The example above shows part of the implementation of :class:`collections.Counter`. A different ``__missing__`` method is used by :class:`collections.defaultdict`." +#, fuzzy +msgid "" +"The example above shows part of the implementation of " +":class:`collections.Counter`. A different ``__missing__`` method is used by" +" :class:`collections.defaultdict`." msgstr "" +"مثال بالا بخشی از اجرای :class:`collections.Counter` را نشان می دهد. یک روش" +" ``__missing__`` متفاوت توسط :class:`collections.defaultdict` استفاده می " +"شود." #: library/stdtypes.rst:4545 +#, fuzzy msgid "Set ``d[key]`` to *value*." -msgstr "" +msgstr "``d[key]`` را روی *value* تنظیم کنید." #: library/stdtypes.rst:4549 -msgid "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the map." +#, fuzzy +msgid "" +"Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the" +" map." msgstr "" +"``d[key]`` را از *d* حذف کنید. اگر *key* در نقشه نباشد یک :exc:`KeyError` " +"را افزایش می دهد." #: library/stdtypes.rst:4554 +#, fuzzy msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" +"اگر *d* دارای کلید *key* است، ``True`` را برگردانید، در غیر این صورت " +"``False``." #: library/stdtypes.rst:4558 +#, fuzzy msgid "Equivalent to ``not key in d``." -msgstr "" +msgstr "معادل ``not key in d``." #: library/stdtypes.rst:4562 -msgid "Return an iterator over the keys of the dictionary. This is a shortcut for ``iter(d.keys())``." +#, fuzzy +msgid "" +"Return an iterator over the keys of the dictionary. This is a shortcut for " +"``iter(d.keys())``." msgstr "" +"یک تکرارکننده را روی کلیدهای فرهنگ لغت برگردانید. این یک میانبر برای " +"``iter(d.keys())`` است." #: library/stdtypes.rst:4567 +#, fuzzy msgid "Remove all items from the dictionary." -msgstr "" +msgstr "همه موارد را از فرهنگ لغت حذف کنید." #: library/stdtypes.rst:4571 +#, fuzzy msgid "Return a shallow copy of the dictionary." -msgstr "" +msgstr "یک نسخه کم عمق از فرهنگ لغت را برگردانید." #: library/stdtypes.rst:4575 -msgid "Create a new dictionary with keys from *iterable* and values set to *value*." +#, fuzzy +msgid "" +"Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" +"یک فرهنگ لغت جدید با کلیدهای *iterable* و مقادیر تنظیم شده روی *value* ایجاد" +" کنید." #: library/stdtypes.rst:4577 -msgid ":meth:`fromkeys` is a class method that returns a new dictionary. *value* defaults to ``None``. All of the values refer to just a single instance, so it generally doesn't make sense for *value* to be a mutable object such as an empty list. To get distinct values, use a :ref:`dict comprehension ` instead." -msgstr "" +#, fuzzy +msgid "" +":meth:`fromkeys` is a class method that returns a new dictionary. *value* " +"defaults to ``None``. All of the values refer to just a single instance, so" +" it generally doesn't make sense for *value* to be a mutable object such as " +"an empty list. To get distinct values, use a :ref:`dict comprehension " +"` instead." +msgstr "" +":meth:`fromkeys` یک متد کلاسی است که یک دیکشنری جدید را برمی گرداند. *value*" +" به طور پیش فرض روی ``None`` است. همه مقادیر فقط به یک نمونه اشاره می کنند،" +" بنابراین به طور کلی منطقی نیست که *value* یک شیء قابل تغییر مانند یک لیست " +"خالی باشد. برای دریافت مقادیر متمایز، به جای آن از :ref:`dict comprehension" +" ` استفاده کنید." #: library/stdtypes.rst:4585 -msgid "Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to ``None``, so that this method never raises a :exc:`KeyError`." +#, fuzzy +msgid "" +"Return the value for *key* if *key* is in the dictionary, else *default*. If" +" *default* is not given, it defaults to ``None``, so that this method never " +"raises a :exc:`KeyError`." msgstr "" +"اگر *key* در فرهنگ لغت است، مقدار *key* را برگردانید، در غیر این صورت " +"*default*. اگر *default* داده نشود، به طور پیش فرض روی ``None`` قرار می " +"گیرد، به طوری که این روش هرگز :exc:`KeyError` را افزایش نمی دهد." #: library/stdtypes.rst:4591 -msgid "Return a new view of the dictionary's items (``(key, value)`` pairs). See the :ref:`documentation of view objects `." +#, fuzzy +msgid "" +"Return a new view of the dictionary's items (``(key, value)`` pairs). See " +"the :ref:`documentation of view objects `." msgstr "" +"نمای جدیدی از موارد فرهنگ لغت (جفت ``(key, value)``) را برگردانید. " +":ref:`documentation of view objects ` را ببینید." #: library/stdtypes.rst:4596 -msgid "Return a new view of the dictionary's keys. See the :ref:`documentation of view objects `." +#, fuzzy +msgid "" +"Return a new view of the dictionary's keys. See the :ref:`documentation of " +"view objects `." msgstr "" +"نمای جدیدی از کلیدهای فرهنگ لغت را برگردانید. :ref:`documentation of view " +"objects ` را ببینید." #: library/stdtypes.rst:4601 -msgid "If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a :exc:`KeyError` is raised." +#, fuzzy +msgid "" +"If *key* is in the dictionary, remove it and return its value, else return " +"*default*. If *default* is not given and *key* is not in the dictionary, a " +":exc:`KeyError` is raised." msgstr "" +"اگر *key* در فرهنگ لغت است، آن را حذف کنید و مقدار آن را برگردانید، در غیر " +"این صورت *default* را برگردانید. اگر *default* داده نشود و *key* در فرهنگ " +"لغت نباشد، یک :exc:`KeyError` مطرح می شود." #: library/stdtypes.rst:4607 -msgid "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are returned in :abbr:`LIFO (last-in, first-out)` order." +#, fuzzy +msgid "" +"Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " +"returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" +"یک جفت ``(key, value)`` را از فرهنگ لغت بردارید و برگردانید. جفت ها به ترتیب" +" :abbr: `LIFO (آخرین ورود, اولین خروج)` برگردانده می شوند." #: library/stdtypes.rst:4610 -msgid ":meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`." +#, fuzzy +msgid "" +":meth:`popitem` is useful to destructively iterate over a dictionary, as " +"often used in set algorithms. If the dictionary is empty, calling " +":meth:`popitem` raises a :exc:`KeyError`." msgstr "" +":meth:`popitem` برای تکرار مخرب در فرهنگ لغت مفید است، همانطور که اغلب در " +"الگوریتم های مجموعه استفاده می شود. اگر فرهنگ لغت خالی باشد، فراخوانی " +":meth:`popitem` باعث افزایش یک :exc:`KeyError` می شود." #: library/stdtypes.rst:4614 -msgid "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair." +#, fuzzy +msgid "" +"LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " +"return an arbitrary key/value pair." msgstr "" +"سفارش LIFO اکنون تضمین شده است. در نسخه های قبلی، :meth:`popitem` یک جفت " +"کلید/مقدار دلخواه را برمی گرداند." #: library/stdtypes.rst:4620 -msgid "Return a reverse iterator over the keys of the dictionary. This is a shortcut for ``reversed(d.keys())``." +#, fuzzy +msgid "" +"Return a reverse iterator over the keys of the dictionary. This is a " +"shortcut for ``reversed(d.keys())``." msgstr "" +"یک تکرار معکوس روی کلیدهای فرهنگ لغت برگردانید. این یک میانبر برای " +"``reversed(d.keys())`` است." #: library/stdtypes.rst:4627 -msgid "If *key* is in the dictionary, return its value. If not, insert *key* with a value of *default* and return *default*. *default* defaults to ``None``." +#, fuzzy +msgid "" +"If *key* is in the dictionary, return its value. If not, insert *key* with " +"a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" +"اگر *key* در فرهنگ لغت وجود دارد، مقدار آن را برگردانید. اگر نه، *key* را " +"با مقدار *default* وارد کنید و *default* را برگردانید. *default* به طور پیش" +" فرض روی ``None`` است." #: library/stdtypes.rst:4633 -msgid "Update the dictionary with the key/value pairs from *other*, overwriting existing keys. Return ``None``." +#, fuzzy +msgid "" +"Update the dictionary with the key/value pairs from *other*, overwriting " +"existing keys. Return ``None``." msgstr "" +"فرهنگ لغت را با جفت‌های کلید/مقدار از *other* به‌روزرسانی کنید و کلیدهای " +"موجود را بازنویسی کنید. ``None`` را برگردانید." #: library/stdtypes.rst:4636 -msgid ":meth:`update` accepts either another object with a ``keys()`` method (in which case :meth:`~object.__getitem__` is called with every key returned from the method) or an iterable of key/value pairs (as tuples or other iterables of length two). If keyword arguments are specified, the dictionary is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." -msgstr "" +#, fuzzy +msgid "" +":meth:`update` accepts either another object with a ``keys()`` method (in " +"which case :meth:`~object.__getitem__` is called with every key returned " +"from the method) or an iterable of key/value pairs (as tuples or other " +"iterables of length two). If keyword arguments are specified, the dictionary" +" is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." +msgstr "" +":meth:`update` یا شیء دیگری را با متد ``keys()`` می پذیرد (در این صورت " +":meth:`~object.__getitem__` با هر کلیدی که از متد برگردانده می شود فراخوانی " +"می شود) یا یک جفت کلید/مقدار تکرار شونده (به صورت چند تایی یا تکرارپذیرهای " +"دیگر با طول دو). اگر آرگومان های کلمه کلیدی مشخص شده باشند، فرهنگ لغت با آن " +"جفت های کلید/مقدار به روز می شود: ``d.update(red=1, blue=2)``." #: library/stdtypes.rst:4644 -msgid "Return a new view of the dictionary's values. See the :ref:`documentation of view objects `." +#, fuzzy +msgid "" +"Return a new view of the dictionary's values. See the :ref:`documentation " +"of view objects `." msgstr "" +"نمای جدیدی از مقادیر فرهنگ لغت را برگردانید. :ref:`documentation of view " +"objects ` را ببینید." #: library/stdtypes.rst:4647 -msgid "An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself::" +#, fuzzy +msgid "" +"An equality comparison between one ``dict.values()`` view and another will " +"always return ``False``. This also applies when comparing ``dict.values()`` " +"to itself::" msgstr "" +"مقایسه برابری بین یک نمای ``dict.values()`` و نمای دیگر همیشه ``False`` را " +"برمی گرداند. این همچنین هنگام مقایسه ``dict.values()`` با خودش صدق می کند:" #: library/stdtypes.rst:4651 -msgid ">>> d = {'a': 1}\n" +#, fuzzy +msgid "" +">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" "False" msgstr "" +">>> d = {'a': 1}\n" +">>> d.values() == d.values()\n" +"False" #: library/stdtypes.rst:4657 -msgid "Create a new dictionary with the merged keys and values of *d* and *other*, which must both be dictionaries. The values of *other* take priority when *d* and *other* share keys." +#, fuzzy +msgid "" +"Create a new dictionary with the merged keys and values of *d* and *other*, " +"which must both be dictionaries. The values of *other* take priority when " +"*d* and *other* share keys." msgstr "" +"یک فرهنگ لغت جدید با کلیدها و مقادیر ادغام شده *d* و *other* ایجاد کنید، که " +"هر دو باید دیکشنری باشند. مقادیر *other* زمانی که کلیدهای مشترک *d* و " +"*other* اولویت دارند." #: library/stdtypes.rst:4665 -msgid "Update the dictionary *d* with keys and values from *other*, which may be either a :term:`mapping` or an :term:`iterable` of key/value pairs. The values of *other* take priority when *d* and *other* share keys." +#, fuzzy +msgid "" +"Update the dictionary *d* with keys and values from *other*, which may be " +"either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " +"values of *other* take priority when *d* and *other* share keys." msgstr "" +"فرهنگ لغت *d* را با کلیدها و مقادیر *other* به روز کنید، که ممکن است یک " +":term:`mapping` یا یک :term:`iterable` از جفت های کلید/مقدار باشد. مقادیر " +"*other* در هنگام اشتراک گذاری کلیدهای *d* و *other* اولویت دارند." #: library/stdtypes.rst:4671 -msgid "Dictionaries compare equal if and only if they have the same ``(key, value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise :exc:`TypeError`." +#, fuzzy +msgid "" +"Dictionaries compare equal if and only if they have the same ``(key, " +"value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>='," +" '>') raise :exc:`TypeError`." msgstr "" +"دیکشنری ها اگر و فقط در صورتی که جفت های ``(key, value)`` یکسانی داشته باشند" +" (بدون در نظر گرفتن سفارش) برابر هستند. مقایسه‌های سفارش ('<', '<=', '>=', " +"'>') :exc:`TypeError` را افزایش می‌دهد." #: library/stdtypes.rst:4675 -msgid "Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end. ::" +#, fuzzy +msgid "" +"Dictionaries preserve insertion order. Note that updating a key does not " +"affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" +"فرهنگ لغت ترتیب درج را حفظ می کند. توجه داشته باشید که به‌روزرسانی یک کلید " +"بر ترتیب تأثیری ندارد. کلیدهای اضافه شده پس از حذف در انتها درج می شوند. ::" #: library/stdtypes.rst:4678 -msgid ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +#, fuzzy +msgid "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" "{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" ">>> list(d)\n" @@ -4314,17 +8781,39 @@ msgid ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(d)\n" +"['one', 'two', 'three', 'four']\n" +">>> list(d.values())\n" +"[1, 2, 3, 4]\n" +">>> d[\"one\"] = 42\n" +">>> d\n" +"{'one': 42, 'two': 2, 'three': 3, 'four': 4}\n" +">>> del d[\"two\"]\n" +">>> d[\"two\"] = None\n" +">>> d\n" +"{'one': 42, 'three': 3, 'four': 4, 'two': None}" #: library/stdtypes.rst:4693 -msgid "Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6." +#, fuzzy +msgid "" +"Dictionary order is guaranteed to be insertion order. This behavior was an " +"implementation detail of CPython from 3.6." msgstr "" +"سفارش دیکشنری تضمین شده است که سفارش درج است. این رفتار جزییات پیاده سازی " +"CPython از 3.6 بود." #: library/stdtypes.rst:4697 +#, fuzzy msgid "Dictionaries and dictionary views are reversible. ::" -msgstr "" +msgstr "لغت نامه ها و نماهای فرهنگ لغت برگشت پذیر هستند. ::" #: library/stdtypes.rst:4699 -msgid ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +#, fuzzy +msgid "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" "{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" ">>> list(reversed(d))\n" @@ -4334,73 +8823,203 @@ msgid ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(reversed(d))\n" +"['four', 'three', 'two', 'one']\n" +">>> list(reversed(d.values()))\n" +"[4, 3, 2, 1]\n" +">>> list(reversed(d.items()))\n" +"[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" #: library/stdtypes.rst:4709 +#, fuzzy msgid "Dictionaries are now reversible." -msgstr "" +msgstr "دیکشنری ها اکنون قابل برگشت هستند." #: library/stdtypes.rst:4714 -msgid ":class:`types.MappingProxyType` can be used to create a read-only view of a :class:`dict`." +#, fuzzy +msgid "" +":class:`types.MappingProxyType` can be used to create a read-only view of a " +":class:`dict`." msgstr "" +":class:`types.MappingProxyType` می تواند برای ایجاد یک نمای فقط خواندنی از " +":class:`dict` استفاده شود." #: library/stdtypes.rst:4721 +#, fuzzy msgid "Dictionary view objects" -msgstr "" +msgstr "دیکشنری مشاهده اشیاء" #: library/stdtypes.rst:4723 -msgid "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict.items` are *view objects*. They provide a dynamic view on the dictionary's entries, which means that when the dictionary changes, the view reflects these changes." +#, fuzzy +msgid "" +"The objects returned by :meth:`dict.keys`, :meth:`dict.values` and " +":meth:`dict.items` are *view objects*. They provide a dynamic view on the " +"dictionary's entries, which means that when the dictionary changes, the view" +" reflects these changes." msgstr "" +"اشیاء بازگردانده شده توسط :meth:`dict.keys`، :meth:`dict.values` و " +":meth:`dict.items` *view objects* هستند. آنها یک نمای پویا در مورد مدخل های" +" فرهنگ لغت ارائه می دهند، به این معنی که وقتی فرهنگ لغت تغییر می کند، نمای " +"این تغییرات را منعکس می کند." #: library/stdtypes.rst:4728 -msgid "Dictionary views can be iterated over to yield their respective data, and support membership tests:" +#, fuzzy +msgid "" +"Dictionary views can be iterated over to yield their respective data, and " +"support membership tests:" msgstr "" +"نماهای فرهنگ لغت را می توان برای به دست آوردن داده های مربوطه تکرار کرد و از" +" آزمون های عضویت پشتیبانی کرد:" #: library/stdtypes.rst:4733 +#, fuzzy msgid "Return the number of entries in the dictionary." -msgstr "" +msgstr "تعداد مدخل های فرهنگ لغت را برگردانید." #: library/stdtypes.rst:4737 -msgid "Return an iterator over the keys, values or items (represented as tuples of ``(key, value)``) in the dictionary." +#, fuzzy +msgid "" +"Return an iterator over the keys, values or items (represented as tuples of " +"``(key, value)``) in the dictionary." msgstr "" +"یک تکرارکننده روی کلیدها، مقادیر یا آیتم‌ها (که به صورت چند تایی از ``(key, " +"value)`` نشان داده شده‌اند) در فرهنگ لغت برگردانید." #: library/stdtypes.rst:4740 -msgid "Keys and values are iterated over in insertion order. This allows the creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d.values(), d.keys())``. Another way to create the same list is ``pairs = [(v, k) for (k, v) in d.items()]``." +#, fuzzy +msgid "" +"Keys and values are iterated over in insertion order. This allows the " +"creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = " +"zip(d.values(), d.keys())``. Another way to create the same list is ``pairs" +" = [(v, k) for (k, v) in d.items()]``." msgstr "" +"کلیدها و مقادیر به ترتیب درج تکرار می شوند. این امکان ایجاد جفت های " +"``(value, key)`` را با استفاده از :func:`zip`: ``pairs = zip(d.values(), " +"d.keys())`` فراهم می کند. راه دیگری برای ایجاد همین لیست ``pairs = [(v, k) " +"for (k, v) in d.items()]`` است." #: library/stdtypes.rst:4745 -msgid "Iterating views while adding or deleting entries in the dictionary may raise a :exc:`RuntimeError` or fail to iterate over all entries." +#, fuzzy +msgid "" +"Iterating views while adding or deleting entries in the dictionary may raise" +" a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" +"تکرار نماها در حین افزودن یا حذف مدخل ها در فرهنگ لغت ممکن است " +":exc:`RuntimeError` را افزایش دهد یا بر روی همه مدخل ها تکرار نشود." #: library/stdtypes.rst:4748 +#, fuzzy msgid "Dictionary order is guaranteed to be insertion order." -msgstr "" +msgstr "سفارش دیکشنری تضمین شده است که سفارش درج است." #: library/stdtypes.rst:4753 -msgid "Return ``True`` if *x* is in the underlying dictionary's keys, values or items (in the latter case, *x* should be a ``(key, value)`` tuple)." +#, fuzzy +msgid "" +"Return ``True`` if *x* is in the underlying dictionary's keys, values or " +"items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" +"اگر *x* در کلیدها، مقادیر یا موارد فرهنگ لغت زیرین قرار دارد، ``True`` را " +"برگردانید (در مورد دوم, *x* باید یک تاپلی ``(key, value)`` باشد)." #: library/stdtypes.rst:4758 -msgid "Return a reverse iterator over the keys, values or items of the dictionary. The view will be iterated in reverse order of the insertion." +#, fuzzy +msgid "" +"Return a reverse iterator over the keys, values or items of the dictionary. " +"The view will be iterated in reverse order of the insertion." msgstr "" +"یک تکرار معکوس روی کلیدها، مقادیر یا موارد فرهنگ لغت برگردانید. نمای به " +"ترتیب معکوس درج تکرار می شود." #: library/stdtypes.rst:4761 +#, fuzzy msgid "Dictionary views are now reversible." -msgstr "" +msgstr "نماهای دیکشنری اکنون قابل برگشت هستند." #: library/stdtypes.rst:4766 -msgid "Return a :class:`types.MappingProxyType` that wraps the original dictionary to which the view refers." +#, fuzzy +msgid "" +"Return a :class:`types.MappingProxyType` that wraps the original dictionary " +"to which the view refers." msgstr "" +"یک :class:`types.MappingProxyType` را برگردانید که فرهنگ لغت اصلی را که نما " +"به آن ارجاع می دهد، می پیچد." #: library/stdtypes.rst:4771 -msgid "Keys views are set-like since their entries are unique and :term:`hashable`. Items views also have set-like operations since the (key, value) pairs are unique and the keys are hashable. If all values in an items view are hashable as well, then the items view can interoperate with other sets. (Values views are not treated as set-like since the entries are generally not unique.) For set-like views, all of the operations defined for the abstract base class :class:`collections.abc.Set` are available (for example, ``==``, ``<``, or ``^``). While using set operators, set-like views accept any iterable as the other operand, unlike sets which only accept sets as the input." -msgstr "" +#, fuzzy +msgid "" +"Keys views are set-like since their entries are unique and :term:`hashable`." +" Items views also have set-like operations since the (key, value) pairs are " +"unique and the keys are hashable. If all values in an items view are " +"hashable as well, then the items view can interoperate with other sets. " +"(Values views are not treated as set-like since the entries are generally " +"not unique.) For set-like views, all of the operations defined for the " +"abstract base class :class:`collections.abc.Set` are available (for example," +" ``==``, ``<``, or ``^``). While using set operators, set-like views accept" +" any iterable as the other operand, unlike sets which only accept sets as " +"the input." +msgstr "" +"نماهای کلیدها مانند مجموعه هستند زیرا ورودی های آنها منحصر به فرد و " +":term:`hashable` هستند. نماهای آیتم ها نیز عملیاتی شبیه به مجموعه دارند زیرا" +" جفت های (کلید, مقدار) منحصر به فرد هستند و کلیدها قابل هش هستند. اگر همه " +"مقادیر در نمای آیتم ها نیز قابل هش باشند، نمای آیتم ها می تواند با مجموعه " +"های دیگر تعامل داشته باشد. (نماهای مقادیر به‌عنوان مجموعه‌ای در نظر گرفته " +"نمی‌شوند زیرا ورودی‌ها معمولاً منحصربه‌فرد نیستند.) برای نماهای " +"مجموعه‌مانند، همه عملیات تعریف‌شده برای کلاس پایه انتزاعی " +":class:`collections.abc.Set` در دسترس هستند (به عنوان مثال, ``==``, ``<``, " +"یا ``^``). هنگام استفاده از عملگرهای مجموعه، نماهای مجموعه مانند هر " +"تکرارپذیر را به عنوان عملوند دیگر می پذیرند، بر خلاف مجموعه هایی که فقط " +"مجموعه ها را به عنوان ورودی می پذیرند." #: library/stdtypes.rst:4783 +#, fuzzy msgid "An example of dictionary view usage::" +msgstr "نمونه ای از استفاده از نمای فرهنگ لغت::" + +#: library/stdtypes.rst:4785 +#, fuzzy +msgid "" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> keys = dishes.keys()\n" +">>> values = dishes.values()\n" +"\n" +">>> # iteration\n" +">>> n = 0\n" +">>> for val in values:\n" +"... n += val\n" +"...\n" +">>> print(n)\n" +"504\n" +"\n" +">>> # keys and values are iterated over in the same order (insertion order)\n" +">>> list(keys)\n" +"['eggs', 'sausage', 'bacon', 'spam']\n" +">>> list(values)\n" +"[2, 1, 1, 500]\n" +"\n" +">>> # view objects are dynamic and reflect dict changes\n" +">>> del dishes['eggs']\n" +">>> del dishes['sausage']\n" +">>> list(keys)\n" +"['bacon', 'spam']\n" +"\n" +">>> # set operations\n" +">>> keys & {'eggs', 'bacon', 'salad'}\n" +"{'bacon'}\n" +">>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'}\n" +"True\n" +">>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'}\n" +"True\n" +"\n" +">>> # get back a read-only proxy for the original dictionary\n" +">>> values.mapping\n" +"mappingproxy({'bacon': 1, 'spam': 500})\n" +">>> values.mapping['spam']\n" +"500" msgstr "" - -#: library/stdtypes.rst:4785 -msgid ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" ">>> values = dishes.values()\n" "\n" @@ -4437,141 +9056,387 @@ msgid ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" "mappingproxy({'bacon': 1, 'spam': 500})\n" ">>> values.mapping['spam']\n" "500" -msgstr "" #: library/stdtypes.rst:4827 +#, fuzzy msgid "Context Manager Types" -msgstr "" +msgstr "انواع مدیریت زمینه" #: library/stdtypes.rst:4834 -msgid "Python's :keyword:`with` statement supports the concept of a runtime context defined by a context manager. This is implemented using a pair of methods that allow user-defined classes to define a runtime context that is entered before the statement body is executed and exited when the statement ends:" +#, fuzzy +msgid "" +"Python's :keyword:`with` statement supports the concept of a runtime context" +" defined by a context manager. This is implemented using a pair of methods " +"that allow user-defined classes to define a runtime context that is entered " +"before the statement body is executed and exited when the statement ends:" msgstr "" +"عبارت :keyword:`with` پایتون از مفهوم یک زمینه زمان اجرا تعریف شده توسط یک " +"مدیر زمینه پشتیبانی می کند. این با استفاده از یک جفت روش پیاده‌سازی می‌شود " +"که به کلاس‌های تعریف‌شده توسط کاربر اجازه می‌دهد تا یک زمینه زمان اجرا را " +"تعریف کنند که قبل از اجرای متن دستور وارد شده و پس از پایان دستور خارج " +"می‌شود:" #: library/stdtypes.rst:4842 -msgid "Enter the runtime context and return either this object or another object related to the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager." +#, fuzzy +msgid "" +"Enter the runtime context and return either this object or another object " +"related to the runtime context. The value returned by this method is bound " +"to the identifier in the :keyword:`!as` clause of :keyword:`with` statements" +" using this context manager." msgstr "" +"متن زمان اجرا را وارد کنید و این شی یا یک شی دیگر مربوط به زمینه زمان اجرا " +"را برگردانید. مقدار بازگردانده شده توسط این روش به شناسه در عبارت " +":keyword:`!as` از دستورات :keyword:`with` با استفاده از این مدیر زمینه محدود" +" می شود." #: library/stdtypes.rst:4847 -msgid "An example of a context manager that returns itself is a :term:`file object`. File objects return themselves from __enter__() to allow :func:`open` to be used as the context expression in a :keyword:`with` statement." +#, fuzzy +msgid "" +"An example of a context manager that returns itself is a :term:`file " +"object`. File objects return themselves from __enter__() to allow " +":func:`open` to be used as the context expression in a :keyword:`with` " +"statement." msgstr "" +"مثالی از یک مدیر زمینه که خود را برمی‌گرداند، یک :term:`file object` است. اشیاء فایل خود را از __enter__() برمی‌گردانند تا اجازه دهند :func:`open` به عنوان عبارت زمینه در یک دستور :keyword:`with` استفاده شود." #: library/stdtypes.rst:4851 -msgid "An example of a context manager that returns a related object is the one returned by :func:`decimal.localcontext`. These managers set the active decimal context to a copy of the original decimal context and then return the copy. This allows changes to be made to the current decimal context in the body of the :keyword:`with` statement without affecting code outside the :keyword:`!with` statement." -msgstr "" +#, fuzzy +msgid "" +"An example of a context manager that returns a related object is the one " +"returned by :func:`decimal.localcontext`. These managers set the active " +"decimal context to a copy of the original decimal context and then return " +"the copy. This allows changes to be made to the current decimal context in " +"the body of the :keyword:`with` statement without affecting code outside the" +" :keyword:`!with` statement." +msgstr "" +"نمونه ای از یک مدیر زمینه که یک شی مرتبط را برمی گرداند، همان چیزی است که " +"توسط :func:`decimal.localcontext` برگردانده شده است. این مدیران زمینه اعشاری" +" فعال را روی یک کپی از بافت اعشاری اصلی تنظیم می کنند و سپس کپی را برمی " +"گردانند. این اجازه می دهد تا تغییراتی در بافت اعشاری فعلی در متن دستور " +":keyword:`with` بدون تأثیر بر روی کد خارج از دستور :keyword:`!with` ایجاد " +"شود." #: library/stdtypes.rst:4861 -msgid "Exit the runtime context and return a Boolean flag indicating if any exception that occurred should be suppressed. If an exception occurred while executing the body of the :keyword:`with` statement, the arguments contain the exception type, value and traceback information. Otherwise, all three arguments are ``None``." +#, fuzzy +msgid "" +"Exit the runtime context and return a Boolean flag indicating if any " +"exception that occurred should be suppressed. If an exception occurred while" +" executing the body of the :keyword:`with` statement, the arguments contain " +"the exception type, value and traceback information. Otherwise, all three " +"arguments are ``None``." msgstr "" +"از زمینه زمان اجرا خارج شوید و یک پرچم Boolean را برگردانید که نشان می دهد " +"هر استثنایی که رخ داده است باید سرکوب شود. اگر در هنگام اجرای متن دستور " +":keyword:`with` یک استثنا رخ دهد، آرگومان ها حاوی اطلاعات نوع استثنا، مقدار " +"و ردیابی هستند. در غیر این صورت، هر سه آرگومان ``None`` هستند." #: library/stdtypes.rst:4866 -msgid "Returning a true value from this method will cause the :keyword:`with` statement to suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues propagating after this method has finished executing. Exceptions that occur during execution of this method will replace any exception that occurred in the body of the :keyword:`!with` statement." -msgstr "" +#, fuzzy +msgid "" +"Returning a true value from this method will cause the :keyword:`with` " +"statement to suppress the exception and continue execution with the " +"statement immediately following the :keyword:`!with` statement. Otherwise " +"the exception continues propagating after this method has finished " +"executing. Exceptions that occur during execution of this method will " +"replace any exception that occurred in the body of the :keyword:`!with` " +"statement." +msgstr "" +"برگرداندن یک مقدار واقعی از این متد باعث می‌شود که دستور :keyword:`with` " +"استثنا را سرکوب کرده و با دستور بلافاصله بعد از دستور :keyword:`!with` اجرا " +"را ادامه دهد. در غیر این صورت، پس از پایان اجرای این روش، استثنا به انتشار " +"ادامه می‌دهد. استثناهایی که در طول اجرای این متد رخ می دهند جایگزین هر " +"استثنایی می شوند که در متن دستور :keyword:`!with` رخ داده است." #: library/stdtypes.rst:4873 -msgid "The exception passed in should never be reraised explicitly - instead, this method should return a false value to indicate that the method completed successfully and does not want to suppress the raised exception. This allows context management code to easily detect whether or not an :meth:`~object.__exit__` method has actually failed." -msgstr "" +#, fuzzy +msgid "" +"The exception passed in should never be reraised explicitly - instead, this " +"method should return a false value to indicate that the method completed " +"successfully and does not want to suppress the raised exception. This allows" +" context management code to easily detect whether or not an " +":meth:`~object.__exit__` method has actually failed." +msgstr "" +"استثنا ارسال شده هرگز نباید به طور صریح مجدداً افزایش یابد - در عوض، این متد" +" باید یک مقدار نادرست برگرداند تا نشان دهد که متد با موفقیت انجام شده است و " +"نمی‌خواهد استثنای مطرح شده را سرکوب کند. این به کد مدیریت زمینه اجازه می دهد" +" تا به راحتی تشخیص دهد که آیا روش :meth:`~object.__exit__` واقعاً شکست خورده" +" است یا خیر." #: library/stdtypes.rst:4879 -msgid "Python defines several context managers to support easy thread synchronisation, prompt closure of files or other objects, and simpler manipulation of the active decimal arithmetic context. The specific types are not treated specially beyond their implementation of the context management protocol. See the :mod:`contextlib` module for some examples." +#, fuzzy +msgid "" +"Python defines several context managers to support easy thread " +"synchronisation, prompt closure of files or other objects, and simpler " +"manipulation of the active decimal arithmetic context. The specific types " +"are not treated specially beyond their implementation of the context " +"management protocol. See the :mod:`contextlib` module for some examples." msgstr "" +"پایتون چندین مدیر زمینه را برای پشتیبانی از همگام‌سازی رشته‌ها، بستن سریع " +"فایل‌ها یا سایر اشیاء و دستکاری ساده‌تر زمینه حسابی اعشاری فعال تعریف " +"می‌کند. انواع خاص به طور خاص فراتر از اجرای پروتکل مدیریت زمینه مورد توجه " +"قرار نمی گیرند. برای چند نمونه به ماژول :mod:`contextlib` مراجعه کنید." #: library/stdtypes.rst:4885 -msgid "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` decorator provide a convenient way to implement these protocols. If a generator function is decorated with the :class:`contextlib.contextmanager` decorator, it will return a context manager implementing the necessary :meth:`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, rather than the iterator produced by an undecorated generator function." -msgstr "" +#, fuzzy +msgid "" +"Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " +"decorator provide a convenient way to implement these protocols. If a " +"generator function is decorated with the :class:`contextlib.contextmanager` " +"decorator, it will return a context manager implementing the necessary " +":meth:`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` " +"methods, rather than the iterator produced by an undecorated generator " +"function." +msgstr "" +":term:`generator`\\s پایتون و تزئین کننده :class:`contextlib.contextmanager`" +" راه مناسبی برای پیاده سازی این پروتکل ها ارائه می دهند. اگر یک تابع مولد " +"با تزئین کننده :class:`contextlib.contextmanager` تزئین شده باشد، به جای " +"تکرار کننده تولید شده توسط یک تابع مولد تزئین نشده، مدیر زمینه ای را که روش " +"های ضروری :meth:`~contextmanager.__enter__` و " +":meth:`~contextmanager.__exit__` را اجرا می کند، برمی گرداند." #: library/stdtypes.rst:4892 -msgid "Note that there is no specific slot for any of these methods in the type structure for Python objects in the Python/C API. Extension types wanting to define these methods must provide them as a normal Python accessible method. Compared to the overhead of setting up the runtime context, the overhead of a single class dictionary lookup is negligible." -msgstr "" +#, fuzzy +msgid "" +"Note that there is no specific slot for any of these methods in the type " +"structure for Python objects in the Python/C API. Extension types wanting to" +" define these methods must provide them as a normal Python accessible " +"method. Compared to the overhead of setting up the runtime context, the " +"overhead of a single class dictionary lookup is negligible." +msgstr "" +"توجه داشته باشید که هیچ شکاف خاصی برای هیچ یک از این روش ها در ساختار نوع " +"برای اشیاء پایتون در Python/C API وجود ندارد. انواع برنامه های افزودنی که می" +" خواهند این روش ها را تعریف کنند باید آنها را به عنوان یک روش معمولی قابل " +"دسترسی پایتون ارائه دهند. در مقایسه با سربار تنظیم زمینه زمان اجرا، سربار " +"جستجوی فرهنگ لغت تک کلاس ناچیز است." #: library/stdtypes.rst:4900 -msgid "Type Annotation Types --- :ref:`Generic Alias `, :ref:`Union `" +#, fuzzy +msgid "" +"Type Annotation Types --- :ref:`Generic Alias `, " +":ref:`Union `" msgstr "" +"انواع حاشیه نویسی --- :ref:`Generic Alias `, :ref:`Union" +" `" #: library/stdtypes.rst:4905 -msgid "The core built-in types for :term:`type annotations ` are :ref:`Generic Alias ` and :ref:`Union `." +#, fuzzy +msgid "" +"The core built-in types for :term:`type annotations ` are " +":ref:`Generic Alias ` and :ref:`Union `." msgstr "" +"انواع هسته داخلی :term:`type annotations ` :ref:`Generic Alias " +"` و :ref:`Union ` هستند." #: library/stdtypes.rst:4912 +#, fuzzy msgid "Generic Alias Type" -msgstr "" +msgstr "نوع نام مستعار عمومی" #: library/stdtypes.rst:4918 -msgid "``GenericAlias`` objects are generally created by :ref:`subscripting ` a class. They are most often used with :ref:`container classes `, such as :class:`list` or :class:`dict`. For example, ``list[int]`` is a ``GenericAlias`` object created by subscripting the ``list`` class with the argument :class:`int`. ``GenericAlias`` objects are intended primarily for use with :term:`type annotations `." -msgstr "" +#, fuzzy +msgid "" +"``GenericAlias`` objects are generally created by :ref:`subscripting " +"` a class. They are most often used with :ref:`container " +"classes `, such as :class:`list` or :class:`dict`. For " +"example, ``list[int]`` is a ``GenericAlias`` object created by subscripting " +"the ``list`` class with the argument :class:`int`. ``GenericAlias`` objects " +"are intended primarily for use with :term:`type annotations `." +msgstr "" +"اشیاء ``GenericAlias`` عموماً توسط یک کلاس :ref:`subscripting " +"` ایجاد می شوند. آنها اغلب با :ref:`container classes " +"` استفاده می شوند، مانند :class:`list` یا :class:`dict`. به " +"عنوان مثال، ``list[int]`` یک شی ``GenericAlias`` است که با اشتراک کلاس " +"``list`` با آرگومان :class:`int` ایجاد شده است. اشیاء ``GenericAlias`` " +"عمدتاً برای استفاده با :term:`type annotations ` در نظر گرفته " +"شده اند." #: library/stdtypes.rst:4928 -msgid "It is generally only possible to subscript a class if the class implements the special method :meth:`~object.__class_getitem__`." +#, fuzzy +msgid "" +"It is generally only possible to subscript a class if the class implements " +"the special method :meth:`~object.__class_getitem__`." msgstr "" +"به طور کلی تنها زمانی می توان یک کلاس را زیرنویس کرد که کلاس متد خاص " +":meth:`~object.__class_getitem__` را پیاده سازی کند." #: library/stdtypes.rst:4931 -msgid "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*." +#, fuzzy +msgid "" +"A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " +"implementing *parameterized generics*." msgstr "" +"یک شی ``GenericAlias`` به عنوان یک پروکسی برای یک :term:`generic type` عمل " +"می کند و *parameterized generics* را پیاده سازی می کند." #: library/stdtypes.rst:4934 -msgid "For a container class, the argument(s) supplied to a :ref:`subscription ` of the class may indicate the type(s) of the elements an object contains. For example, ``set[bytes]`` can be used in type annotations to signify a :class:`set` in which all the elements are of type :class:`bytes`." +#, fuzzy +msgid "" +"For a container class, the argument(s) supplied to a :ref:`subscription " +"` of the class may indicate the type(s) of the elements an " +"object contains. For example, ``set[bytes]`` can be used in type annotations" +" to signify a :class:`set` in which all the elements are of type " +":class:`bytes`." msgstr "" +"برای یک کلاس کانتینری، آرگومان(های) ارائه شده به یک :ref:`subscription " +"` از کلاس ممکن است نوع(های) عناصر موجود در یک شی را نشان دهد." +" به عنوان مثال، ``set[bytes]`` را می توان در حاشیه نویسی نوع استفاده کرد تا " +"به یک :class:`set` اشاره کند که در آن همه عناصر از نوع :class:`bytes` هستند." #: library/stdtypes.rst:4940 -msgid "For a class which defines :meth:`~object.__class_getitem__` but is not a container, the argument(s) supplied to a subscription of the class will often indicate the return type(s) of one or more methods defined on an object. For example, :mod:`regular expressions ` can be used on both the :class:`str` data type and the :class:`bytes` data type:" -msgstr "" +#, fuzzy +msgid "" +"For a class which defines :meth:`~object.__class_getitem__` but is not a " +"container, the argument(s) supplied to a subscription of the class will " +"often indicate the return type(s) of one or more methods defined on an " +"object. For example, :mod:`regular expressions ` can be used on both the" +" :class:`str` data type and the :class:`bytes` data type:" +msgstr "" +"برای کلاسی که :meth:`~object.__class_getitem__` را تعریف می کند اما یک " +"کانتینر نیست، آرگومان(های) ارائه شده به اشتراک کلاس اغلب نوع(های) بازگشتی یک" +" یا چند متد تعریف شده روی یک شی را نشان می دهد. به عنوان مثال، :mod:`regular" +" expressions ` را می توان در هر دو نوع داده :class:`str` و نوع داده " +":class:`bytes` استفاده کرد:" #: library/stdtypes.rst:4946 -msgid "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will both be of type :class:`str`. We can represent this kind of object in type annotations with the ``GenericAlias`` ``re.Match[str]``." +#, fuzzy +msgid "" +"If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will" +" both be of type :class:`str`. We can represent this kind of object in type " +"annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" +"اگر ``x = re.search('foo', 'foo')``، ``x`` یک شی :ref:`re.Match ` خواهد بود که مقادیر بازگشتی ``x.group(0)`` و ``x[0]`` هر دو از نوع" +" :class:`str` خواهند بود. ما می توانیم این نوع شی را در حاشیه نویسی نوع با " +"``GenericAlias`` ``re.Match[str]`` نشان دهیم." #: library/stdtypes.rst:4952 -msgid "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), ``y`` will also be an instance of ``re.Match``, but the return values of ``y.group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type annotations, we would represent this variety of :ref:`re.Match ` objects with ``re.Match[bytes]``." -msgstr "" +#, fuzzy +msgid "" +"If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " +"``y`` will also be an instance of ``re.Match``, but the return values of " +"``y.group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type " +"annotations, we would represent this variety of :ref:`re.Match ` objects with ``re.Match[bytes]``." +msgstr "" +"اگر ``y = re.search(b'bar', b'bar')``، (به ``b`` برای :class:`bytes` توجه " +"کنید)، ``y`` نیز نمونه ای از ``re.Match`` خواهد بود، اما مقادیر بازگشتی " +"``y.group(0)`` و ``y[0]`` هر دو از نوع :class:`bytes` خواهند بود. در حاشیه " +"نویسی نوع، ما این تنوع از اشیاء :ref:`re.Match ` را با " +"``re.Match[bytes]`` نشان می دهیم." #: library/stdtypes.rst:4958 -msgid "``GenericAlias`` objects are instances of the class :class:`types.GenericAlias`, which can also be used to create ``GenericAlias`` objects directly." +#, fuzzy +msgid "" +"``GenericAlias`` objects are instances of the class " +":class:`types.GenericAlias`, which can also be used to create " +"``GenericAlias`` objects directly." msgstr "" +"اشیاء ``GenericAlias`` نمونه هایی از کلاس :class:`types.GenericAlias` هستند " +"که می توانند برای ایجاد مستقیم اشیاء ``GenericAlias`` نیز استفاده شوند." #: library/stdtypes.rst:4964 -msgid "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types *X*, *Y*, and more depending on the ``T`` used. For example, a function expecting a :class:`list` containing :class:`float` elements::" +#, fuzzy +msgid "" +"Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " +"*X*, *Y*, and more depending on the ``T`` used. For example, a function " +"expecting a :class:`list` containing :class:`float` elements::" msgstr "" +"یک ``GenericAlias`` ایجاد می کند که نشان دهنده نوع ``T`` است که با انواع " +"*X*، *Y* و موارد دیگر بسته به ``T`` مورد استفاده، پارامتر شده است. به عنوان " +"مثال، تابعی که انتظار دارد یک :class:`list` حاوی عناصر :class:`float` باشد:" #: library/stdtypes.rst:4969 -msgid "def average(values: list[float]) -> float:\n" +#, fuzzy +msgid "" +"def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" msgstr "" +"def average(values: list[float]) -> float:\n" +" return sum(values) / len(values)" #: library/stdtypes.rst:4972 -msgid "Another example for :term:`mapping` objects, using a :class:`dict`, which is a generic type expecting two type parameters representing the key type and the value type. In this example, the function expects a ``dict`` with keys of type :class:`str` and values of type :class:`int`::" +#, fuzzy +msgid "" +"Another example for :term:`mapping` objects, using a :class:`dict`, which is" +" a generic type expecting two type parameters representing the key type and " +"the value type. In this example, the function expects a ``dict`` with keys " +"of type :class:`str` and values of type :class:`int`::" msgstr "" +"مثال دیگری برای اشیاء :term:`mapping`، با استفاده از :class:`dict`، که یک " +"نوع عمومی است و انتظار دو پارامتر نوع را دارد که نوع کلید و نوع مقدار را " +"نشان می دهد. در این مثال، تابع یک ``dict`` با کلیدهای نوع :class:`str` و " +"مقادیر نوع :class:`int`::" #: library/stdtypes.rst:4977 -msgid "def send_post_request(url: str, body: dict[str, int]) -> None:\n" +#, fuzzy +msgid "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." msgstr "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" +" ..." #: library/stdtypes.rst:4980 -msgid "The builtin functions :func:`isinstance` and :func:`issubclass` do not accept ``GenericAlias`` types for their second argument::" +#, fuzzy +msgid "" +"The builtin functions :func:`isinstance` and :func:`issubclass` do not " +"accept ``GenericAlias`` types for their second argument::" msgstr "" +"توابع داخلی :func:`isinstance` و :func:`issubclass` انواع ``GenericAlias`` " +"را برای آرگومان دوم خود نمی پذیرند:" #: library/stdtypes.rst:4983 -msgid ">>> isinstance([1, 2], list[str])\n" +#, fuzzy +msgid "" +">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> نمونه ([1, 2], list[str])\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: آرگومان 2 ()instance نمی تواند یک پارامتر عمومی باشد" #: library/stdtypes.rst:4988 -msgid "The Python runtime does not enforce :term:`type annotations `. This extends to generic types and their type parameters. When creating a container object from a ``GenericAlias``, the elements in the container are not checked against their type. For example, the following code is discouraged, but will run without errors::" +#, fuzzy +msgid "" +"The Python runtime does not enforce :term:`type annotations `. " +"This extends to generic types and their type parameters. When creating a " +"container object from a ``GenericAlias``, the elements in the container are " +"not checked against their type. For example, the following code is " +"discouraged, but will run without errors::" msgstr "" +"زمان اجرا پایتون :term:`type annotations ` را اجرا نمی کند. این " +"به انواع عمومی و پارامترهای نوع آنها گسترش می یابد. هنگام ایجاد یک شی " +"کانتینر از یک ``GenericAlias``، عناصر موجود در کانتینر با نوع خود بررسی نمی " +"شوند. به عنوان مثال، کد زیر ممنوع است، اما بدون خطا اجرا می شود:" #: library/stdtypes.rst:4994 -msgid ">>> t = list[str]\n" +#, fuzzy +msgid "" +">>> t = list[str]\n" ">>> t([1, 2, 3])\n" "[1, 2, 3]" msgstr "" +">>> t = list[str]\n" +">>> t([1, 2, 3])\n" +"[1, 2, 3]" #: library/stdtypes.rst:4998 -msgid "Furthermore, parameterized generics erase type parameters during object creation::" +#, fuzzy +msgid "" +"Furthermore, parameterized generics erase type parameters during object " +"creation::" msgstr "" +"علاوه بر این، ژنریک های پارامتری شده پارامترهای نوع را در حین ایجاد شی پاک " +"می کنند:" #: library/stdtypes.rst:5001 -msgid ">>> t = list[str]\n" +#, fuzzy +msgid "" +">>> t = list[str]\n" ">>> type(t)\n" "\n" "\n" @@ -4579,428 +9444,672 @@ msgid ">>> t = list[str]\n" ">>> type(l)\n" "" msgstr "" +">>> t = لیست[str]\n" +">>> نوع (t)\n" +"\n" +"\n" +">>> l = t()\n" +">>> نوع (l)\n" +"" #: library/stdtypes.rst:5009 -msgid "Calling :func:`repr` or :func:`str` on a generic shows the parameterized type::" +#, fuzzy +msgid "" +"Calling :func:`repr` or :func:`str` on a generic shows the parameterized " +"type::" msgstr "" +"فراخوانی :func:`repr` یا :func:`str` در یک ژنریک نوع پارامتر شده را نشان می " +"دهد:" #: library/stdtypes.rst:5011 -msgid ">>> repr(list[int])\n" +#, fuzzy +msgid "" +">>> repr(list[int])\n" "'list[int]'\n" "\n" ">>> str(list[int])\n" "'list[int]'" msgstr "" +">>> repr(list[int])\n" +"'list[int]'\n" +"\n" +">>> str(list[int])\n" +"'list[int]'" #: library/stdtypes.rst:5017 -msgid "The :meth:`~object.__getitem__` method of generic containers will raise an exception to disallow mistakes like ``dict[str][str]``::" +#, fuzzy +msgid "" +"The :meth:`~object.__getitem__` method of generic containers will raise an " +"exception to disallow mistakes like ``dict[str][str]``::" msgstr "" +"روش :meth:`~object.__getitem__` در کانتینرهای عمومی استثنایی برای عدم اجازه " +"اشتباهات مانند ``dict[str][str]`` ایجاد می کند:" #: library/stdtypes.rst:5020 -msgid ">>> dict[str][str]\n" +#, fuzzy +msgid "" +">>> dict[str][str]\n" "Traceback (most recent call last):\n" " ...\n" "TypeError: dict[str] is not a generic class" msgstr "" +">>> dict[str][str]\n" +"ردیابی (آخرین تماس اخیر):\n" +" ...\n" +"TypeError: dict[str] یک کلاس عمومی نیست" #: library/stdtypes.rst:5025 -msgid "However, such expressions are valid when :ref:`type variables ` are used. The index must have as many elements as there are type variable items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" +#, fuzzy +msgid "" +"However, such expressions are valid when :ref:`type variables ` " +"are used. The index must have as many elements as there are type variable " +"items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" +"با این حال، چنین عباراتی زمانی معتبر هستند که از :ref:`type variables " +"` استفاده می شود. شاخص باید به تعداد عناصر متغیر نوع در " +":attr:`~genericalias.__args__` شی ``GenericAlias`` باشد. ::" #: library/stdtypes.rst:5029 -msgid ">>> from typing import TypeVar\n" +#, fuzzy +msgid "" +">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" ">>> dict[str, Y][int]\n" "dict[str, int]" msgstr "" +">>> from typing import TypeVar\n" +">>> Y = TypeVar('Y')\n" +">>> dict[str, Y][int]\n" +"dict[str, int]" #: library/stdtypes.rst:5036 +#, fuzzy msgid "Standard Generic Classes" -msgstr "" +msgstr "کلاس های عمومی استاندارد" #: library/stdtypes.rst:5038 -msgid "The following standard library classes support parameterized generics. This list is non-exhaustive." +#, fuzzy +msgid "" +"The following standard library classes support parameterized generics. This " +"list is non-exhaustive." msgstr "" +"کلاس های کتابخانه استاندارد زیر از ژنریک های پارامتری شده پشتیبانی می کنند. " +"این فهرست غیر جامع است." #: library/stdtypes.rst:5041 +#, fuzzy msgid ":class:`tuple`" -msgstr "" +msgstr ":class:`tuple`" #: library/stdtypes.rst:5042 +#, fuzzy msgid ":class:`list`" -msgstr "" +msgstr ":class:`list`" #: library/stdtypes.rst:5043 +#, fuzzy msgid ":class:`dict`" -msgstr "" +msgstr ":class:`dict`" #: library/stdtypes.rst:5044 +#, fuzzy msgid ":class:`set`" -msgstr "" +msgstr ":class:`set`" #: library/stdtypes.rst:5045 +#, fuzzy msgid ":class:`frozenset`" -msgstr "" +msgstr ":class:`frozenset`" #: library/stdtypes.rst:5046 +#, fuzzy msgid ":class:`type`" -msgstr "" +msgstr ":class:`type`" #: library/stdtypes.rst:5047 +#, fuzzy msgid ":class:`collections.deque`" -msgstr "" +msgstr ":class:`collections.deque`" #: library/stdtypes.rst:5048 +#, fuzzy msgid ":class:`collections.defaultdict`" -msgstr "" +msgstr ":class:`collections.defaultdict`" #: library/stdtypes.rst:5049 +#, fuzzy msgid ":class:`collections.OrderedDict`" -msgstr "" +msgstr ":class:`collections.OrderedDict`" #: library/stdtypes.rst:5050 +#, fuzzy msgid ":class:`collections.Counter`" -msgstr "" +msgstr ":class:`collections.Counter`" #: library/stdtypes.rst:5051 +#, fuzzy msgid ":class:`collections.ChainMap`" -msgstr "" +msgstr ":class:`collections.ChainMap`" #: library/stdtypes.rst:5052 +#, fuzzy msgid ":class:`collections.abc.Awaitable`" -msgstr "" +msgstr ":class:`collections.abc.Awaitable`" #: library/stdtypes.rst:5053 +#, fuzzy msgid ":class:`collections.abc.Coroutine`" -msgstr "" +msgstr ":class:`collections.abc.Coroutine`" #: library/stdtypes.rst:5054 +#, fuzzy msgid ":class:`collections.abc.AsyncIterable`" -msgstr "" +msgstr ":class:`collections.abc.AsyncIterable`" #: library/stdtypes.rst:5055 +#, fuzzy msgid ":class:`collections.abc.AsyncIterator`" -msgstr "" +msgstr ":class:`collections.abc.AsyncIterator`" #: library/stdtypes.rst:5056 +#, fuzzy msgid ":class:`collections.abc.AsyncGenerator`" -msgstr "" +msgstr ":class:`collections.abc.AsyncGenerator`" #: library/stdtypes.rst:5057 +#, fuzzy msgid ":class:`collections.abc.Iterable`" -msgstr "" +msgstr ":class:`collections.abc.Iterable`" #: library/stdtypes.rst:5058 +#, fuzzy msgid ":class:`collections.abc.Iterator`" -msgstr "" +msgstr ":class:`collections.abc.Iterator`" #: library/stdtypes.rst:5059 +#, fuzzy msgid ":class:`collections.abc.Generator`" -msgstr "" +msgstr ":class:`collections.abc.Generator`" #: library/stdtypes.rst:5060 +#, fuzzy msgid ":class:`collections.abc.Reversible`" -msgstr "" +msgstr ":class:`collections.abc.Reversible`" #: library/stdtypes.rst:5061 +#, fuzzy msgid ":class:`collections.abc.Container`" -msgstr "" +msgstr ":class:`collections.abc.Container`" #: library/stdtypes.rst:5062 +#, fuzzy msgid ":class:`collections.abc.Collection`" -msgstr "" +msgstr ":class:`collections.abc.Collection`" #: library/stdtypes.rst:5063 +#, fuzzy msgid ":class:`collections.abc.Callable`" -msgstr "" +msgstr ":class:`collections.abc.Callable`" #: library/stdtypes.rst:5064 +#, fuzzy msgid ":class:`collections.abc.Set`" -msgstr "" +msgstr ":class:`collections.abc.Set`" #: library/stdtypes.rst:5065 +#, fuzzy msgid ":class:`collections.abc.MutableSet`" -msgstr "" +msgstr ":class:`collections.abc.MutableSet`" #: library/stdtypes.rst:5066 +#, fuzzy msgid ":class:`collections.abc.Mapping`" -msgstr "" +msgstr ":class:`collections.abc.Mapping`" #: library/stdtypes.rst:5067 +#, fuzzy msgid ":class:`collections.abc.MutableMapping`" -msgstr "" +msgstr ":class:`collections.abc.MutableMapping`" #: library/stdtypes.rst:5068 +#, fuzzy msgid ":class:`collections.abc.Sequence`" -msgstr "" +msgstr ":class:`collections.abc.Sequence`" #: library/stdtypes.rst:5069 +#, fuzzy msgid ":class:`collections.abc.MutableSequence`" -msgstr "" +msgstr ":class:`collections.abc.MutableSequence`" #: library/stdtypes.rst:5070 +#, fuzzy msgid ":class:`collections.abc.ByteString`" -msgstr "" +msgstr ":class:`collections.abc.ByteString`" #: library/stdtypes.rst:5071 +#, fuzzy msgid ":class:`collections.abc.MappingView`" -msgstr "" +msgstr ":class:`collections.abc.MappingView`" #: library/stdtypes.rst:5072 +#, fuzzy msgid ":class:`collections.abc.KeysView`" -msgstr "" +msgstr ":class:`collections.abc.KeysView`" #: library/stdtypes.rst:5073 +#, fuzzy msgid ":class:`collections.abc.ItemsView`" -msgstr "" +msgstr ":class:`collections.abc.ItemsView`" #: library/stdtypes.rst:5074 +#, fuzzy msgid ":class:`collections.abc.ValuesView`" -msgstr "" +msgstr ":class:`collections.abc.ValuesView`" #: library/stdtypes.rst:5075 +#, fuzzy msgid ":class:`contextlib.AbstractContextManager`" -msgstr "" +msgstr ":class:`contextlib.AbstractContextManager`" #: library/stdtypes.rst:5076 +#, fuzzy msgid ":class:`contextlib.AbstractAsyncContextManager`" -msgstr "" +msgstr ":class:`contextlib.AbstractAsyncContextManager`" #: library/stdtypes.rst:5077 +#, fuzzy msgid ":class:`dataclasses.Field`" -msgstr "" +msgstr ":class:`dataclasses.Field`" #: library/stdtypes.rst:5078 +#, fuzzy msgid ":class:`functools.cached_property`" -msgstr "" +msgstr ":class:`functools.cached_property`" #: library/stdtypes.rst:5079 +#, fuzzy msgid ":class:`functools.partialmethod`" -msgstr "" +msgstr ":class:`functools.partialmethod`" #: library/stdtypes.rst:5080 +#, fuzzy msgid ":class:`os.PathLike`" -msgstr "" +msgstr ":class:`os.PathLike`" #: library/stdtypes.rst:5081 +#, fuzzy msgid ":class:`queue.LifoQueue`" -msgstr "" +msgstr ":class:`queue.LifoQueue`" #: library/stdtypes.rst:5082 +#, fuzzy msgid ":class:`queue.Queue`" -msgstr "" +msgstr ":class:`queue.Queue`" #: library/stdtypes.rst:5083 +#, fuzzy msgid ":class:`queue.PriorityQueue`" -msgstr "" +msgstr ":class:`queue.PriorityQueue`" #: library/stdtypes.rst:5084 +#, fuzzy msgid ":class:`queue.SimpleQueue`" -msgstr "" +msgstr ":class:`queue.SimpleQueue`" #: library/stdtypes.rst:5085 +#, fuzzy msgid ":ref:`re.Pattern `" -msgstr "" +msgstr ":ref:`re.Pattern `" #: library/stdtypes.rst:5086 +#, fuzzy msgid ":ref:`re.Match `" -msgstr "" +msgstr ":ref:`re.Match `" #: library/stdtypes.rst:5087 +#, fuzzy msgid ":class:`shelve.BsdDbShelf`" -msgstr "" +msgstr ":class:`shelve.BsdDbShelf`" #: library/stdtypes.rst:5088 +#, fuzzy msgid ":class:`shelve.DbfilenameShelf`" -msgstr "" +msgstr ":class:`shelve.DbfilenameShelf`" #: library/stdtypes.rst:5089 +#, fuzzy msgid ":class:`shelve.Shelf`" -msgstr "" +msgstr ":class:`shelve.Shelf`" #: library/stdtypes.rst:5090 +#, fuzzy msgid ":class:`types.MappingProxyType`" -msgstr "" +msgstr ":class:`types.MappingProxyType`" #: library/stdtypes.rst:5091 +#, fuzzy msgid ":class:`weakref.WeakKeyDictionary`" -msgstr "" +msgstr ":class:`weakref.WeakKeyDictionary`" #: library/stdtypes.rst:5092 +#, fuzzy msgid ":class:`weakref.WeakMethod`" -msgstr "" +msgstr ":class:`weakref.WeakMethod`" #: library/stdtypes.rst:5093 +#, fuzzy msgid ":class:`weakref.WeakSet`" -msgstr "" +msgstr ":class:`weakref.WeakSet`" #: library/stdtypes.rst:5094 +#, fuzzy msgid ":class:`weakref.WeakValueDictionary`" -msgstr "" +msgstr ":class:`weakref.WeakValueDictionary`" #: library/stdtypes.rst:5099 +#, fuzzy msgid "Special Attributes of ``GenericAlias`` objects" -msgstr "" +msgstr "ویژگی های خاص اشیاء ``GenericAlias``" #: library/stdtypes.rst:5101 +#, fuzzy msgid "All parameterized generics implement special read-only attributes." msgstr "" +"همه ژنریک های پارامتری شده ویژگی های ویژه فقط خواندنی را پیاده سازی می کنند." #: library/stdtypes.rst:5105 +#, fuzzy msgid "This attribute points at the non-parameterized generic class::" -msgstr "" +msgstr "این ویژگی به کلاس عمومی غیر پارامتری اشاره می کند:" #: library/stdtypes.rst:5107 -msgid ">>> list[int].__origin__\n" +#, fuzzy +msgid "" +">>> list[int].__origin__\n" "" msgstr "" +">>> لیست[int].__origin__\n" +"" #: library/stdtypes.rst:5113 -msgid "This attribute is a :class:`tuple` (possibly of length 1) of generic types passed to the original :meth:`~object.__class_getitem__` of the generic class::" +#, fuzzy +msgid "" +"This attribute is a :class:`tuple` (possibly of length 1) of generic types " +"passed to the original :meth:`~object.__class_getitem__` of the generic " +"class::" msgstr "" +"این ویژگی یک :class:`tuple` (احتمالاً به طول 1) از انواع عمومی است که به " +":meth:`~object.__class_getitem__` اصلی کلاس عمومی منتقل شده است:" #: library/stdtypes.rst:5117 -msgid ">>> dict[str, list[int]].__args__\n" +#, fuzzy +msgid "" +">>> dict[str, list[int]].__args__\n" "(, list[int])" msgstr "" +">>> dict[str, list[int]].__args__\n" +"(, لیست[int])" #: library/stdtypes.rst:5123 -msgid "This attribute is a lazily computed tuple (possibly empty) of unique type variables found in ``__args__``::" +#, fuzzy +msgid "" +"This attribute is a lazily computed tuple (possibly empty) of unique type " +"variables found in ``__args__``::" msgstr "" +"این ویژگی یک تاپلی محاسبه‌شده (احتمالاً خالی) از متغیرهای نوع منحصربه‌فرد " +"است که در ``__args__``::" #: library/stdtypes.rst:5126 -msgid ">>> from typing import TypeVar\n" +#, fuzzy +msgid "" +">>> from typing import TypeVar\n" "\n" ">>> T = TypeVar('T')\n" ">>> list[T].__parameters__\n" "(~T,)" msgstr "" +">>> from typing import TypeVar\n" +"\n" +">>> T = TypeVar('T')\n" +">>> list[T].__parameters__\n" +"(~T,)" #: library/stdtypes.rst:5134 -msgid "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not have correct ``__parameters__`` after substitution because :class:`typing.ParamSpec` is intended primarily for static type checking." +#, fuzzy +msgid "" +"A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " +"have correct ``__parameters__`` after substitution because " +":class:`typing.ParamSpec` is intended primarily for static type checking." msgstr "" +"یک شی ``GenericAlias`` با پارامترهای :class:`typing.ParamSpec` ممکن است پس " +"از جایگزینی دارای ``__parameters__`` صحیح نباشد زیرا " +":class:`typing.ParamSpec` عمدتاً برای بررسی نوع استاتیک در نظر گرفته شده " +"است." #: library/stdtypes.rst:5141 -msgid "A boolean that is true if the alias has been unpacked using the ``*`` operator (see :data:`~typing.TypeVarTuple`)." +#, fuzzy +msgid "" +"A boolean that is true if the alias has been unpacked using the ``*`` " +"operator (see :data:`~typing.TypeVarTuple`)." msgstr "" +"اگر نام مستعار با استفاده از عملگر ``*`` باز شده باشد، درست است (به " +":data:`~typing.TypeVarTuple` مراجعه کنید)." #: library/stdtypes.rst:5149 +#, fuzzy msgid ":pep:`484` - Type Hints" -msgstr "" +msgstr ":pep:`484` - نکات را تایپ کنید" #: library/stdtypes.rst:5150 +#, fuzzy msgid "Introducing Python's framework for type annotations." -msgstr "" +msgstr "معرفی چارچوب پایتون برای حاشیه نویسی نوع." #: library/stdtypes.rst:5152 +#, fuzzy msgid ":pep:`585` - Type Hinting Generics In Standard Collections" -msgstr "" +msgstr ":pep:`585` - Hinting Generics را در مجموعه های استاندارد تایپ کنید" #: library/stdtypes.rst:5153 -msgid "Introducing the ability to natively parameterize standard-library classes, provided they implement the special class method :meth:`~object.__class_getitem__`." +#, fuzzy +msgid "" +"Introducing the ability to natively parameterize standard-library classes, " +"provided they implement the special class method " +":meth:`~object.__class_getitem__`." msgstr "" +"معرفی قابلیت پارامترسازی بومی کلاس‌های کتابخانه استاندارد، مشروط بر اینکه " +"متد کلاس ویژه :meth:`~object.__class_getitem__` را پیاده‌سازی کنند." #: library/stdtypes.rst:5157 -msgid ":ref:`Generics`, :ref:`user-defined generics ` and :class:`typing.Generic`" +#, fuzzy +msgid "" +":ref:`Generics`, :ref:`user-defined generics ` and " +":class:`typing.Generic`" msgstr "" +":ref:`Generics`، :ref:`user-defined generics ` و " +":class:`typing.Generic`" #: library/stdtypes.rst:5158 -msgid "Documentation on how to implement generic classes that can be parameterized at runtime and understood by static type-checkers." +#, fuzzy +msgid "" +"Documentation on how to implement generic classes that can be parameterized " +"at runtime and understood by static type-checkers." msgstr "" +"مستنداتی در مورد نحوه پیاده‌سازی کلاس‌های عمومی که می‌توانند در زمان اجرا " +"پارامتری شوند و توسط چک‌کننده‌های نوع استاتیک درک شوند." #: library/stdtypes.rst:5167 +#, fuzzy msgid "Union Type" -msgstr "" +msgstr "نوع اتحادیه" #: library/stdtypes.rst:5173 -msgid "A union object holds the value of the ``|`` (bitwise or) operation on multiple :ref:`type objects `. These types are intended primarily for :term:`type annotations `. The union type expression enables cleaner type hinting syntax compared to :data:`typing.Union`." +#, fuzzy +msgid "" +"A union object holds the value of the ``|`` (bitwise or) operation on " +"multiple :ref:`type objects `. These types are intended" +" primarily for :term:`type annotations `. The union type " +"expression enables cleaner type hinting syntax compared to " +":data:`typing.Union`." msgstr "" +"یک شی اتحادیه مقدار عملیات ``|`` (بیتی یا) را روی چند :ref:`type objects " +"` نگه می دارد. این نوع در درجه اول برای :term:`type " +"annotations ` در نظر گرفته شده است. عبارت union type syntax نوع " +"تمیزتر را در مقایسه با :data:`typing.Union` فعال می کند." #: library/stdtypes.rst:5180 -msgid "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For example, the following function expects an argument of type :class:`int` or :class:`float`::" +#, fuzzy +msgid "" +"Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " +"means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " +"example, the following function expects an argument of type :class:`int` or " +":class:`float`::" msgstr "" +"یک شیء اتحاد را تعریف می کند که دارای انواع *X*، *Y* و غیره است. ``X | Y`` " +"به معنای X یا Y است. معادل ``typing.Union[X, Y]`` است. به عنوان مثال، تابع " +"زیر یک آرگومان از نوع :class:`int` یا :class:`float` را انتظار دارد:" #: library/stdtypes.rst:5185 -msgid "def square(number: int | float) -> int | float:\n" +#, fuzzy +msgid "" +"def square(number: int | float) -> int | float:\n" " return number ** 2" msgstr "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" #: library/stdtypes.rst:5190 -msgid "The ``|`` operand cannot be used at runtime to define unions where one or more members is a forward reference. For example, ``int | \"Foo\"``, where ``\"Foo\"`` is a reference to a class not yet defined, will fail at runtime. For unions which include forward references, present the whole expression as a string, e.g. ``\"int | Foo\"``." -msgstr "" +#, fuzzy +msgid "" +"The ``|`` operand cannot be used at runtime to define unions where one or " +"more members is a forward reference. For example, ``int | \"Foo\"``, where " +"``\"Foo\"`` is a reference to a class not yet defined, will fail at runtime." +" For unions which include forward references, present the whole expression " +"as a string, e.g. ``\"int | Foo\"``." +msgstr "" +"عملوند ``|`` را نمی توان در زمان اجرا برای تعریف اتحادیه هایی که در آن یک یا" +" چند عضو مرجع پیشرو هستند استفاده کرد. به عنوان مثال، ``int | \"Foo\"``، که " +"در آن ``\"Foo\"`` ارجاع به کلاسی است که هنوز تعریف نشده است، در زمان اجرا با" +" شکست مواجه خواهد شد. برای اتحادیه هایی که شامل ارجاعات رو به جلو هستند، کل " +"عبارت را به عنوان یک رشته ارائه کنید، به عنوان مثال. ``\"int | Foo\"``." #: library/stdtypes.rst:5198 -msgid "Union objects can be tested for equality with other union objects. Details:" +#, fuzzy +msgid "" +"Union objects can be tested for equality with other union objects. Details:" msgstr "" +"اشیاء اتحادیه را می توان برای برابری با سایر اشیاء اتحادیه آزمایش کرد. " +"جزئیات:" #: library/stdtypes.rst:5200 +#, fuzzy msgid "Unions of unions are flattened::" -msgstr "" +msgstr "اتحادیه های اتحادیه ها مسطح می شوند::" #: library/stdtypes.rst:5202 +#, fuzzy msgid "(int | str) | float == int | str | float" -msgstr "" +msgstr "(int | str) | float == int | str | float" #: library/stdtypes.rst:5204 +#, fuzzy msgid "Redundant types are removed::" -msgstr "" +msgstr "انواع اضافی حذف می شوند:" #: library/stdtypes.rst:5206 +#, fuzzy msgid "int | str | int == int | str" -msgstr "" +msgstr "int | str | int == int | str" #: library/stdtypes.rst:5208 +#, fuzzy msgid "When comparing unions, the order is ignored::" -msgstr "" +msgstr "هنگام مقایسه اتحادیه ها، ترتیب نادیده گرفته می شود::" #: library/stdtypes.rst:5210 +#, fuzzy msgid "int | str == str | int" -msgstr "" +msgstr "int | str == str | int" #: library/stdtypes.rst:5212 +#, fuzzy msgid "It is compatible with :data:`typing.Union`::" -msgstr "" +msgstr "با :data:`typing.Union` سازگار است::" #: library/stdtypes.rst:5214 +#, fuzzy msgid "int | str == typing.Union[int, str]" -msgstr "" +msgstr "int | str == typing.Union[int, str]" #: library/stdtypes.rst:5216 +#, fuzzy msgid "Optional types can be spelled as a union with ``None``::" -msgstr "" +msgstr "انواع اختیاری را می توان به صورت یک اتحاد با ``None`` نوشت::" #: library/stdtypes.rst:5218 +#, fuzzy msgid "str | None == typing.Optional[str]" -msgstr "" +msgstr "str | None == typing.Optional[str]" #: library/stdtypes.rst:5223 -msgid "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a union object::" +#, fuzzy +msgid "" +"Calls to :func:`isinstance` and :func:`issubclass` are also supported with a" +" union object::" msgstr "" +"فراخوانی به :func:`isinstance` و :func:`issubclass` نیز با یک شی اتحادیه " +"پشتیبانی می شود:" #: library/stdtypes.rst:5226 -msgid ">>> isinstance(\"\", int | str)\n" +#, fuzzy +msgid "" +">>> isinstance(\"\", int | str)\n" "True" msgstr "" +">>> isinstance(\"\", int | str)\n" +"True" #: library/stdtypes.rst:5229 -msgid "However, :ref:`parameterized generics ` in union objects cannot be checked::" +#, fuzzy +msgid "" +"However, :ref:`parameterized generics ` in union objects" +" cannot be checked::" msgstr "" +"با این حال، :ref:`parameterized generics ` در اشیاء " +"اتحادیه قابل بررسی نیست:" #: library/stdtypes.rst:5232 -msgid ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" +#, fuzzy +msgid "" +">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" ">>> isinstance([1], int | list[int])\n" "Traceback (most recent call last):\n" " ...\n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> ininstance(1, int | list[int]) # ارزیابی اتصال کوتاه\n" +"درست است\n" +">>> instance([1], int | list[int])\n" +"ردیابی (آخرین تماس اخیر):\n" +" ...\n" +"TypeError: آرگومان 2 ()instance نمی تواند یک پارامتر عمومی باشد" #: library/stdtypes.rst:5239 -msgid "The user-exposed type for the union object can be accessed from :data:`types.UnionType` and used for :func:`isinstance` checks. An object cannot be instantiated from the type::" +#, fuzzy +msgid "" +"The user-exposed type for the union object can be accessed from " +":data:`types.UnionType` and used for :func:`isinstance` checks. An object " +"cannot be instantiated from the type::" msgstr "" +"نوع در معرض کاربر برای شی اتحاد می تواند از :data:`types.UnionType` دسترسی " +"داشته باشد و برای بررسی های :func:`isinstance` استفاده شود. یک شی را نمی " +"توان از نوع::" #: library/stdtypes.rst:5243 -msgid ">>> import types\n" +#, fuzzy +msgid "" +">>> import types\n" ">>> isinstance(int | str, types.UnionType)\n" "True\n" ">>> types.UnionType()\n" @@ -5008,13 +10117,29 @@ msgid ">>> import types\n" " File \"\", line 1, in \n" "TypeError: cannot create 'types.UnionType' instances" msgstr "" +">>> انواع واردات\n" +">>> ininstance(int | str, type.UnionType)\n" +"درست است\n" +">>> type.UnionType()\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: نمی تواند نمونه های 'types.UnionType' ایجاد کند" #: library/stdtypes.rst:5252 -msgid "The :meth:`!__or__` method for type objects was added to support the syntax ``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may override it:" +#, fuzzy +msgid "" +"The :meth:`!__or__` method for type objects was added to support the syntax " +"``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " +"override it:" msgstr "" +"روش :meth:`!__or__` برای اشیاء نوع برای پشتیبانی از نحو ``X | Y`` اضافه شد." +" اگر متاکلاس :meth:`!__or__` را پیاده سازی کند، اتحادیه ممکن است آن را لغو " +"کند:" #: library/stdtypes.rst:5256 -msgid ">>> class M(type):\n" +#, fuzzy +msgid "" +">>> class M(type):\n" "... def __or__(self, other):\n" "... return \"Hello\"\n" "...\n" @@ -5026,77 +10151,193 @@ msgid ">>> class M(type):\n" ">>> int | C\n" "int | C" msgstr "" +">>> class M(type):\n" +"... def __or__(self, other):\n" +"... return \"Hello\"\n" +"...\n" +">>> class C(metaclass=M):\n" +"... pass\n" +"...\n" +">>> C | int\n" +"'Hello'\n" +">>> int | C\n" +"int | C" #: library/stdtypes.rst:5272 +#, fuzzy msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." -msgstr "" +msgstr ":pep:`604` -- PEP دستور ``X | Y`` و نوع Union را پیشنهاد می کند." #: library/stdtypes.rst:5280 +#, fuzzy msgid "Other Built-in Types" -msgstr "" +msgstr "سایر انواع داخلی" #: library/stdtypes.rst:5282 -msgid "The interpreter supports several other kinds of objects. Most of these support only one or two operations." +#, fuzzy +msgid "" +"The interpreter supports several other kinds of objects. Most of these " +"support only one or two operations." msgstr "" +"مفسر از چندین نوع شیء دیگر پشتیبانی می کند. اکثر اینها فقط یک یا دو عملیات " +"را پشتیبانی می کنند." #: library/stdtypes.rst:5289 +#, fuzzy msgid "Modules" -msgstr "" +msgstr "ماژول ها" #: library/stdtypes.rst:5291 -msgid "The only special operation on a module is attribute access: ``m.name``, where *m* is a module and *name* accesses a name defined in *m*'s symbol table. Module attributes can be assigned to. (Note that the :keyword:`import` statement is not, strictly speaking, an operation on a module object; ``import foo`` does not require a module object named *foo* to exist, rather it requires an (external) *definition* for a module named *foo* somewhere.)" -msgstr "" +#, fuzzy +msgid "" +"The only special operation on a module is attribute access: ``m.name``, " +"where *m* is a module and *name* accesses a name defined in *m*'s symbol " +"table. Module attributes can be assigned to. (Note that the " +":keyword:`import` statement is not, strictly speaking, an operation on a " +"module object; ``import foo`` does not require a module object named *foo* " +"to exist, rather it requires an (external) *definition* for a module named " +"*foo* somewhere.)" +msgstr "" +"تنها عملیات ویژه در یک ماژول دسترسی به ویژگی است: ``m.name``، که در آن *m* " +"یک ماژول است و *name* به نامی که در جدول نماد *m* تعریف شده است دسترسی پیدا " +"می کند. ویژگی های ماژول را می توان به آن اختصاص داد. (توجه داشته باشید که " +"دستور :keyword:`import`, به طور دقیق, عملیاتی بر روی یک شی ماژول نیست؛ " +"``import foo`` برای وجود شی ماژول به نام *foo* نیازی ندارد, بلکه به یک " +"*definition* (خارجی) برای ماژولی به نام *foo* در جایی نیاز دارد.)" #: library/stdtypes.rst:5298 -msgid "A special attribute of every module is :attr:`~object.__dict__`. This is the dictionary containing the module's symbol table. Modifying this dictionary will actually change the module's symbol table, but direct assignment to the :attr:`~object.__dict__` attribute is not possible (you can write ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't write ``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is not recommended." -msgstr "" +#, fuzzy +msgid "" +"A special attribute of every module is :attr:`~object.__dict__`. This is the" +" dictionary containing the module's symbol table. Modifying this dictionary " +"will actually change the module's symbol table, but direct assignment to the" +" :attr:`~object.__dict__` attribute is not possible (you can write " +"``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't " +"write ``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is " +"not recommended." +msgstr "" +"ویژگی خاص هر ماژول :attr:`~object.__dict__` است. این فرهنگ لغت حاوی جدول " +"نماد ماژول است. اصلاح این فرهنگ لغت در واقع جدول نماد ماژول را تغییر می دهد،" +" اما انتساب مستقیم به ویژگی :attr:`~object.__dict__` امکان پذیر نیست (شما می" +" توانید ``m.__dict__['a'] = 1`` را بنویسید که ``m.a`` را ``1`` تعریف می کند," +" اما نمی توانید ``m.__dict__ = {}`` بنویسید). تغییر مستقیم " +":attr:`~object.__dict__` توصیه نمی شود." #: library/stdtypes.rst:5306 -msgid "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." +#, fuzzy +msgid "" +"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" +"ماژول های تعبیه شده در مفسر به این صورت نوشته می شوند: ````. اگر از یک فایل بارگذاری شوند، به صورت ```` نوشته می شوند." #: library/stdtypes.rst:5314 +#, fuzzy msgid "Classes and Class Instances" -msgstr "" +msgstr "کلاس ها و نمونه های کلاس" #: library/stdtypes.rst:5316 +#, fuzzy msgid "See :ref:`objects` and :ref:`class` for these." -msgstr "" +msgstr "برای این موارد به :ref:`objects` و :ref:`class` مراجعه کنید." #: library/stdtypes.rst:5322 +#, fuzzy msgid "Functions" -msgstr "" +msgstr "توابع" #: library/stdtypes.rst:5324 -msgid "Function objects are created by function definitions. The only operation on a function object is to call it: ``func(argument-list)``." +#, fuzzy +msgid "" +"Function objects are created by function definitions. The only operation on" +" a function object is to call it: ``func(argument-list)``." msgstr "" +"اشیاء تابع توسط تعاریف تابع ایجاد می شوند. تنها عملیات روی یک شی تابع " +"فراخوانی آن است: ``func(argument-list)``." #: library/stdtypes.rst:5327 -msgid "There are really two flavors of function objects: built-in functions and user-defined functions. Both support the same operation (to call the function), but the implementation is different, hence the different object types." +#, fuzzy +msgid "" +"There are really two flavors of function objects: built-in functions and " +"user-defined functions. Both support the same operation (to call the " +"function), but the implementation is different, hence the different object " +"types." msgstr "" +"در واقع دو نوع شیء تابع وجود دارد: توابع داخلی و توابع تعریف شده توسط کاربر." +" هر دو از یک عملیات (برای فراخوانی تابع) پشتیبانی می کنند، اما پیاده سازی " +"متفاوت است، بنابراین انواع شی متفاوت است." #: library/stdtypes.rst:5331 +#, fuzzy msgid "See :ref:`function` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر به :ref:`function` مراجعه کنید." #: library/stdtypes.rst:5337 +#, fuzzy msgid "Methods" -msgstr "" +msgstr "روش ها" #: library/stdtypes.rst:5341 -msgid "Methods are functions that are called using the attribute notation. There are two flavors: :ref:`built-in methods ` (such as :meth:`append` on lists) and :ref:`class instance method `. Built-in methods are described with the types that support them." +#, fuzzy +msgid "" +"Methods are functions that are called using the attribute notation. There " +"are two flavors: :ref:`built-in methods ` (such as " +":meth:`append` on lists) and :ref:`class instance method `. Built-in methods are described with the types that support them." msgstr "" +"متدها توابعی هستند که با استفاده از نماد مشخصه فراخوانی می شوند. دو طعم وجود" +" دارد: :ref:`built-in methods ` (مانند :meth:`append` در " +"لیست ها) و :ref:`class instance method `. روش های داخلی با" +" انواعی که از آنها پشتیبانی می کنند توضیح داده شده اند." #: library/stdtypes.rst:5346 -msgid "If you access a method (a function defined in a class namespace) through an instance, you get a special object: a :dfn:`bound method` (also called :ref:`instance method `) object. When called, it will add the ``self`` argument to the argument list. Bound methods have two special read-only attributes: :attr:`m.__self__ ` is the object on which the method operates, and :attr:`m.__func__ ` is the function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to calling ``m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)``." -msgstr "" +#, fuzzy +msgid "" +"If you access a method (a function defined in a class namespace) through an " +"instance, you get a special object: a :dfn:`bound method` (also called " +":ref:`instance method `) object. When called, it will add " +"the ``self`` argument to the argument list. Bound methods have two special " +"read-only attributes: :attr:`m.__self__ ` is the object on " +"which the method operates, and :attr:`m.__func__ ` is the " +"function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-n)`` " +"is completely equivalent to calling ``m.__func__(m.__self__, arg-1, arg-2, " +"..., arg-n)``." +msgstr "" +"اگر از طریق یک نمونه به یک متد (یک تابع تعریف‌شده در فضای نام کلاس) دسترسی " +"داشته باشید، یک شی خاص دریافت می‌کنید: یک شی :dfn:`bound method` (که همچنین " +"به عنوان :ref:`instance method ` شناخته می‌شود). هنگام " +"فراخوانی، آرگومان ``self`` به لیست آرگومان اضافه می‌شود. متدهای bound دارای " +"دو ویژگی فقط خواندنی هستند: :attr:`m.__self__ ` شی‌ای است " +"که متد بر روی آن عمل می‌کند و :attr:`m.__func__ ` تابع " +"پیاده‌سازی‌کننده متد می‌باشد. فراخوانی ``m(arg-1, arg-2, ..., arg-n)`` " +"کاملاً معادل فراخوانی ``m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)`` " +"است." #: library/stdtypes.rst:5357 -msgid "Like :ref:`function objects `, bound method objects support getting arbitrary attributes. However, since method attributes are actually stored on the underlying function object (:attr:`method.__func__`), setting method attributes on bound methods is disallowed. Attempting to set an attribute on a method results in an :exc:`AttributeError` being raised. In order to set a method attribute, you need to explicitly set it on the underlying function object:" -msgstr "" +#, fuzzy +msgid "" +"Like :ref:`function objects `, bound method objects " +"support getting arbitrary attributes. However, since method attributes are " +"actually stored on the underlying function object (:attr:`method.__func__`)," +" setting method attributes on bound methods is disallowed. Attempting to " +"set an attribute on a method results in an :exc:`AttributeError` being " +"raised. In order to set a method attribute, you need to explicitly set it " +"on the underlying function object:" +msgstr "" +"مانند :ref:`function objects `، اشیاء متد محدود از " +"دریافت ویژگی‌های دلخواه پشتیبانی می‌کنند. با این حال، از آنجایی که " +"ویژگی‌های متد در واقع روی شی تابع زیرین (:attr:`method.__func__`) ذخیره " +"می‌شوند، تنظیم ویژگی‌های متد در روش‌های محدود مجاز نیست. تلاش برای تنظیم یک" +" ویژگی در یک متد منجر به افزایش :exc:`AttributeError` می شود. برای تنظیم یک" +" ویژگی متد، باید آن را به صراحت روی شی تابع زیرین تنظیم کنید:" #: library/stdtypes.rst:5365 -msgid ">>> class C:\n" +#, fuzzy +msgid "" +">>> class C:\n" "... def method(self):\n" "... pass\n" "...\n" @@ -5109,141 +10350,295 @@ msgid ">>> class C:\n" ">>> c.method.whoami\n" "'my name is method'" msgstr "" +">>> کلاس C:\n" +"... روش دف (خود):\n" +"... بگذرد\n" +"...\n" +">>> c = C()\n" +">>> c.method.whoami = 'نام من روش است' # نمی تواند روی متد تنظیم شود\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"AttributeError: شی «method» هیچ ویژگی «whoami» ندارد\n" +">>> c.method.__func__.whoami = 'نام من روش است'\n" +">>> c.method.whoami\n" +"\"اسم من روش است\"" #: library/stdtypes.rst:5380 +#, fuzzy msgid "See :ref:`instance-methods` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر به :ref:`instance-methods` مراجعه کنید." #: library/stdtypes.rst:5388 +#, fuzzy msgid "Code Objects" -msgstr "" +msgstr "اشیاء کد" #: library/stdtypes.rst:5394 -msgid "Code objects are used by the implementation to represent \"pseudo-compiled\" executable Python code such as a function body. They differ from function objects because they don't contain a reference to their global execution environment. Code objects are returned by the built-in :func:`compile` function and can be extracted from function objects through their :attr:`~function.__code__` attribute. See also the :mod:`code` module." -msgstr "" +#, fuzzy +msgid "" +"Code objects are used by the implementation to represent \"pseudo-compiled\"" +" executable Python code such as a function body. They differ from function " +"objects because they don't contain a reference to their global execution " +"environment. Code objects are returned by the built-in :func:`compile` " +"function and can be extracted from function objects through their " +":attr:`~function.__code__` attribute. See also the :mod:`code` module." +msgstr "" +"اشیاء کد توسط پیاده سازی برای نمایش کدهای اجرایی پایتون \"شبه کامپایل شده\" " +"مانند یک تابع استفاده می شود. آنها با اشیاء تابع متفاوت هستند زیرا حاوی " +"ارجاعی به محیط اجرای جهانی خود نیستند. اشیاء کد توسط تابع داخلی " +":func:`compile` برگردانده می شوند و می توان آنها را از طریق ویژگی " +":attr:`~function.__code__` از اشیاء تابع استخراج کرد. ماژول :mod:`code` را " +"نیز ببینید." #: library/stdtypes.rst:5401 -msgid "Accessing :attr:`~function.__code__` raises an :ref:`auditing event ` ``object.__getattr__`` with arguments ``obj`` and ``\"__code__\"``." +#, fuzzy +msgid "" +"Accessing :attr:`~function.__code__` raises an :ref:`auditing event " +"` ``object.__getattr__`` with arguments ``obj`` and " +"``\"__code__\"``." msgstr "" +"دسترسی به :attr:`~function.__code__` یک :ref:`auditing event ` " +"``object.__getattr__`` با آرگومان های ``obj`` و ``\"__code__\"`` را افزایش " +"می دهد." #: library/stdtypes.rst:5408 -msgid "A code object can be executed or evaluated by passing it (instead of a source string) to the :func:`exec` or :func:`eval` built-in functions." +#, fuzzy +msgid "" +"A code object can be executed or evaluated by passing it (instead of a " +"source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" +"یک شی کد را می توان با ارسال آن (به جای رشته منبع) به توابع داخلی " +":func:`exec` یا :func:`eval` اجرا یا ارزیابی کرد." #: library/stdtypes.rst:5411 +#, fuzzy msgid "See :ref:`types` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر به :ref:`types` مراجعه کنید." #: library/stdtypes.rst:5417 +#, fuzzy msgid "Type Objects" -msgstr "" +msgstr "اشیاء را تایپ کنید" #: library/stdtypes.rst:5423 -msgid "Type objects represent the various object types. An object's type is accessed by the built-in function :func:`type`. There are no special operations on types. The standard module :mod:`types` defines names for all standard built-in types." +#, fuzzy +msgid "" +"Type objects represent the various object types. An object's type is " +"accessed by the built-in function :func:`type`. There are no special " +"operations on types. The standard module :mod:`types` defines names for all" +" standard built-in types." msgstr "" +"اشیاء نوع نشان دهنده انواع مختلف شی هستند. نوع یک شی توسط تابع داخلی " +":func:`type` قابل دسترسی است. هیچ عملیات خاصی روی انواع وجود ندارد. ماژول " +"استاندارد :mod:`types` نام هایی را برای همه انواع استاندارد داخلی تعریف می " +"کند." #: library/stdtypes.rst:5428 +#, fuzzy msgid "Types are written like this: ````." -msgstr "" +msgstr "انواع به این صورت نوشته می شود: ````." #: library/stdtypes.rst:5434 +#, fuzzy msgid "The Null Object" -msgstr "" +msgstr "شی پوچ" #: library/stdtypes.rst:5436 -msgid "This object is returned by functions that don't explicitly return a value. It supports no special operations. There is exactly one null object, named ``None`` (a built-in name). ``type(None)()`` produces the same singleton." +#, fuzzy +msgid "" +"This object is returned by functions that don't explicitly return a value. " +"It supports no special operations. There is exactly one null object, named " +"``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" +"این شی توسط توابعی که به صراحت مقداری را بر نمی گردند، برگردانده می شود. " +"هیچ عملیات خاصی را پشتیبانی نمی کند. دقیقاً یک شی تهی به نام ``None`` (یک " +"نام داخلی) وجود دارد. ``type(None)()`` همان تک تنه را تولید می کند." #: library/stdtypes.rst:5440 +#, fuzzy msgid "It is written as ``None``." -msgstr "" +msgstr "به صورت ``None`` نوشته شده است." #: library/stdtypes.rst:5447 +#, fuzzy msgid "The Ellipsis Object" -msgstr "" +msgstr "شی بیضی" #: library/stdtypes.rst:5449 -msgid "This object is commonly used by slicing (see :ref:`slicings`). It supports no special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton." +#, fuzzy +msgid "" +"This object is commonly used by slicing (see :ref:`slicings`). It supports " +"no special operations. There is exactly one ellipsis object, named " +":const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the " +":const:`Ellipsis` singleton." msgstr "" +"این شی معمولاً با برش استفاده می شود (به :ref:`slicings` مراجعه کنید). هیچ " +"عملیات خاصی را پشتیبانی نمی کند. دقیقاً یک شیء بیضی وجود دارد، به نام " +":const:`Ellipsis` (یک نام داخلی). ``type(Ellipsis)()`` تک تنه " +":const:`Ellipsis` را تولید می کند." #: library/stdtypes.rst:5454 +#, fuzzy msgid "It is written as ``Ellipsis`` or ``...``." -msgstr "" +msgstr "به صورت ``Ellipsis`` یا ``...`` نوشته شده است." #: library/stdtypes.rst:5460 +#, fuzzy msgid "The NotImplemented Object" -msgstr "" +msgstr "شیء NotImplemented" #: library/stdtypes.rst:5462 -msgid "This object is returned from comparisons and binary operations when they are asked to operate on types they don't support. See :ref:`comparisons` for more information. There is exactly one :data:`NotImplemented` object. :code:`type(NotImplemented)()` produces the singleton instance." +#, fuzzy +msgid "" +"This object is returned from comparisons and binary operations when they are" +" asked to operate on types they don't support. See :ref:`comparisons` for " +"more information. There is exactly one :data:`NotImplemented` object. " +":code:`type(NotImplemented)()` produces the singleton instance." msgstr "" +"زمانی که از آنها خواسته می‌شود روی انواعی که پشتیبانی نمی‌کنند عمل کنند، این" +" شی از مقایسه‌ها و عملیات باینری بازگردانده می‌شود. برای اطلاعات بیشتر به " +":ref:`comparisons` مراجعه کنید. دقیقا یک شی :data:`NotImplemented` وجود " +"دارد. :code:`type(NotImplemented)()` نمونه singleton را تولید می کند." #: library/stdtypes.rst:5467 +#, fuzzy msgid "It is written as :code:`NotImplemented`." -msgstr "" +msgstr "به صورت :code:'NotImplemented' نوشته شده است." #: library/stdtypes.rst:5473 +#, fuzzy msgid "Internal Objects" -msgstr "" +msgstr "اشیاء داخلی" #: library/stdtypes.rst:5475 -msgid "See :ref:`types` for this information. It describes :ref:`stack frame objects `, :ref:`traceback objects `, and slice objects." +#, fuzzy +msgid "" +"See :ref:`types` for this information. It describes :ref:`stack frame " +"objects `, :ref:`traceback objects `, and " +"slice objects." msgstr "" +"برای این اطلاعات به :ref:`types` مراجعه کنید. این :ref:`stack frame objects" +" `، :ref:`traceback objects ` و اشیاء برش " +"را توصیف می کند." #: library/stdtypes.rst:5483 +#, fuzzy msgid "Special Attributes" -msgstr "" +msgstr "ویژگی های خاص" #: library/stdtypes.rst:5485 -msgid "The implementation adds a few special read-only attributes to several object types, where they are relevant. Some of these are not reported by the :func:`dir` built-in function." +#, fuzzy +msgid "" +"The implementation adds a few special read-only attributes to several object" +" types, where they are relevant. Some of these are not reported by the " +":func:`dir` built-in function." msgstr "" +"پیاده‌سازی چند ویژگی خاص فقط خواندنی را به چندین نوع شی اضافه می‌کند، جایی " +"که آنها مرتبط هستند. برخی از اینها توسط عملکرد داخلی :func:`dir` گزارش نشده" +" است." #: library/stdtypes.rst:5492 -msgid "The name of the class, function, method, descriptor, or generator instance." -msgstr "" +#, fuzzy +msgid "" +"The name of the class, function, method, descriptor, or generator instance." +msgstr "نام کلاس، تابع، متد، توصیفگر یا نمونه مولد." #: library/stdtypes.rst:5498 -msgid "The :term:`qualified name` of the class, function, method, descriptor, or generator instance." -msgstr "" +#, fuzzy +msgid "" +"The :term:`qualified name` of the class, function, method, descriptor, or " +"generator instance." +msgstr ":term:`qualified name` کلاس، تابع، متد، توصیفگر یا نمونه مولد." #: library/stdtypes.rst:5506 +#, fuzzy msgid "The name of the module in which a class or function was defined." -msgstr "" +msgstr "نام ماژولی که یک کلاس یا تابع در آن تعریف شده است." #: library/stdtypes.rst:5511 -msgid "The documentation string of a class or function, or ``None`` if undefined." -msgstr "" +#, fuzzy +msgid "" +"The documentation string of a class or function, or ``None`` if undefined." +msgstr "رشته مستندات یک کلاس یا تابع یا ``None`` اگر تعریف نشده باشد." #: library/stdtypes.rst:5516 -msgid "The :ref:`type parameters ` of generic classes, functions, and :ref:`type aliases `. For classes and functions that are not generic, this will be an empty tuple." +#, fuzzy +msgid "" +"The :ref:`type parameters ` of generic classes, functions, and " +":ref:`type aliases `. For classes and functions that are not " +"generic, this will be an empty tuple." msgstr "" +":ref:`type parameters ` از کلاس های عمومی، توابع و :ref:`type " +"aliases `. برای کلاس ها و توابعی که عمومی نیستند، این یک تاپل " +"خالی خواهد بود." #: library/stdtypes.rst:5526 +#, fuzzy msgid "Integer string conversion length limitation" -msgstr "" +msgstr "محدودیت طول تبدیل رشته عدد صحیح" #: library/stdtypes.rst:5528 -msgid "CPython has a global limit for converting between :class:`int` and :class:`str` to mitigate denial of service attacks. This limit *only* applies to decimal or other non-power-of-two number bases. Hexadecimal, octal, and binary conversions are unlimited. The limit can be configured." +#, fuzzy +msgid "" +"CPython has a global limit for converting between :class:`int` and " +":class:`str` to mitigate denial of service attacks. This limit *only* " +"applies to decimal or other non-power-of-two number bases. Hexadecimal, " +"octal, and binary conversions are unlimited. The limit can be configured." msgstr "" +"CPython یک محدودیت جهانی برای تبدیل بین :class:`int` و :class:`str` برای " +"کاهش حملات انکار سرویس دارد. این محدودیت *only* برای پایه های اعشاری یا سایر" +" پایه های غیر توان دو عدد اعمال می شود. تبدیل های هگزادسیمال، اکتال و باینری" +" نامحدود هستند. محدودیت را می توان پیکربندی کرد." #: library/stdtypes.rst:5533 -msgid "The :class:`int` type in CPython is an arbitrary length number stored in binary form (commonly known as a \"bignum\"). There exists no algorithm that can convert a string to a binary integer or a binary integer to a string in linear time, *unless* the base is a power of 2. Even the best known algorithms for base 10 have sub-quadratic complexity. Converting a large value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." -msgstr "" +#, fuzzy +msgid "" +"The :class:`int` type in CPython is an arbitrary length number stored in " +"binary form (commonly known as a \"bignum\"). There exists no algorithm that" +" can convert a string to a binary integer or a binary integer to a string in" +" linear time, *unless* the base is a power of 2. Even the best known " +"algorithms for base 10 have sub-quadratic complexity. Converting a large " +"value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." +msgstr "" +"نوع :class:`int` در CPython یک عدد طول دلخواه است که به شکل باینری ذخیره می " +"شود (که معمولاً به عنوان \"bignum\" شناخته می شود). هیچ الگوریتمی وجود ندارد" +" که بتواند یک رشته را در زمان خطی به یک عدد صحیح باینری یا یک عدد صحیح " +"باینری را به یک رشته تبدیل کند، پایه *unless* توان 2 است. حتی بهترین " +"الگوریتم های شناخته شده برای پایه 10 دارای پیچیدگی زیر درجه دوم هستند. تبدیل" +" یک مقدار بزرگ مانند ``int('1' * 500_000)`` می تواند در یک CPU سریع یک ثانیه" +" طول بکشد." #: library/stdtypes.rst:5540 -msgid "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." +#, fuzzy +msgid "" +"Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" +"محدود کردن اندازه تبدیل یک راه عملی برای جلوگیری از :cve:`2020-10735` ارائه " +"می دهد." #: library/stdtypes.rst:5542 -msgid "The limit is applied to the number of digit characters in the input or output string when a non-linear conversion algorithm would be involved. Underscores and the sign are not counted towards the limit." +#, fuzzy +msgid "" +"The limit is applied to the number of digit characters in the input or " +"output string when a non-linear conversion algorithm would be involved. " +"Underscores and the sign are not counted towards the limit." msgstr "" +"محدودیت برای تعداد کاراکترهای رقمی در رشته ورودی یا خروجی اعمال می شود که یک" +" الگوریتم تبدیل غیرخطی درگیر باشد. زیرخط و علامت در حد محدود محاسبه نمی " +"شود." #: library/stdtypes.rst:5546 -msgid "When an operation would exceed the limit, a :exc:`ValueError` is raised:" +#, fuzzy +msgid "" +"When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" +"هنگامی که یک عملیات از حد مجاز فراتر می رود، یک :exc:`ValueError` افزایش می " +"یابد:" #: library/stdtypes.rst:5548 -msgid ">>> import sys\n" +#, fuzzy +msgid "" +">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" ">>> _ = int('2' * 5432)\n" "Traceback (most recent call last):\n" @@ -5261,17 +10656,46 @@ msgid ">>> import sys\n" "7144\n" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" +">>> سیستم را وارد کنید\n" +">>> sys.set_int_max_str_digits(4300) # گویا, این پیش فرض است.\n" +">>> _ = int('2' * 5432)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit\n" +">>> i = int('2' * 4300)\n" +">>> len(str(i))\n" +"4300\n" +">>> i_squared = i*i\n" +">>> len(str(i_squared))\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit\n" +">>> len(hex(i_squared))\n" +"7144\n" +">>> assert int(hex(i_squared), base=16) == i*i # هگزادسیمال نامحدود است." #: library/stdtypes.rst:5568 -msgid "The default limit is 4300 digits as provided in :data:`sys.int_info.default_max_str_digits `. The lowest limit that can be configured is 640 digits as provided in :data:`sys.int_info.str_digits_check_threshold `." +#, fuzzy +msgid "" +"The default limit is 4300 digits as provided in " +":data:`sys.int_info.default_max_str_digits `. The lowest limit" +" that can be configured is 640 digits as provided in " +":data:`sys.int_info.str_digits_check_threshold `." msgstr "" +"حد پیش فرض 4300 رقم است که در :data:`sys.int_info.default_max_str_digits " +"` ارائه شده است. کمترین حدی که می توان پیکربندی کرد 640 رقم " +"است که در :data:`sys.int_info.str_digits_check_threshold ` " +"ارائه شده است." #: library/stdtypes.rst:5573 +#, fuzzy msgid "Verification:" -msgstr "" +msgstr "تایید:" #: library/stdtypes.rst:5575 -msgid ">>> import sys\n" +#, fuzzy +msgid "" +">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" ">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" ">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" @@ -5279,125 +10703,251 @@ msgid ">>> import sys\n" "... '571186405732').to_bytes(53, 'big')\n" "..." msgstr "" +">>> import sys\n" +">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" +">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" +">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" +"... '9252925514383915483333812743580549779436104706260696366600'\n" +"... '571186405732').to_bytes(53, 'big')\n" +"..." #: library/stdtypes.rst:5588 +#, fuzzy msgid "Affected APIs" -msgstr "" +msgstr "APIهای تحت تأثیر" #: library/stdtypes.rst:5590 -msgid "The limitation only applies to potentially slow conversions between :class:`int` and :class:`str` or :class:`bytes`:" +#, fuzzy +msgid "" +"The limitation only applies to potentially slow conversions between " +":class:`int` and :class:`str` or :class:`bytes`:" msgstr "" +"این محدودیت فقط برای تبدیل‌های بالقوه کند بین :class:`int` و :class:`str` یا" +" :class:`bytes` اعمال می‌شود:" #: library/stdtypes.rst:5593 +#, fuzzy msgid "``int(string)`` with default base 10." -msgstr "" +msgstr "``int(string)`` با پایه پیش فرض 10." #: library/stdtypes.rst:5594 +#, fuzzy msgid "``int(string, base)`` for all bases that are not a power of 2." -msgstr "" +msgstr "``int(string, base)`` برای همه پایه هایی که توان 2 نیستند." #: library/stdtypes.rst:5595 +#, fuzzy msgid "``str(integer)``." -msgstr "" +msgstr "``str(integer)``." #: library/stdtypes.rst:5596 +#, fuzzy msgid "``repr(integer)``." -msgstr "" +msgstr "``repr(integer)``." #: library/stdtypes.rst:5597 -msgid "any other string conversion to base 10, for example ``f\"{integer}\"``, ``\"{}\".format(integer)``, or ``b\"%d\" % integer``." +#, fuzzy +msgid "" +"any other string conversion to base 10, for example ``f\"{integer}\"``, " +"``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" +"هر تبدیل رشته دیگر به پایه 10، به عنوان مثال ``f\"{integer}\"``، " +"``\"{}\".format(integer)``، یا ``b\"%d\" % integer``." #: library/stdtypes.rst:5600 +#, fuzzy msgid "The limitations do not apply to functions with a linear algorithm:" -msgstr "" +msgstr "محدودیت ها برای توابع با الگوریتم خطی اعمال نمی شود:" #: library/stdtypes.rst:5602 +#, fuzzy msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." -msgstr "" +msgstr "``int(string, base)`` با پایه 2، 4، 8، 16 یا 32." #: library/stdtypes.rst:5603 +#, fuzzy msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." -msgstr "" +msgstr ":func:`int.from_bytes` و :func:`int.to_bytes`." #: library/stdtypes.rst:5604 +#, fuzzy msgid ":func:`hex`, :func:`oct`, :func:`bin`." -msgstr "" +msgstr ":func:`hex`، :func:`oct`، :func:`bin`." #: library/stdtypes.rst:5605 +#, fuzzy msgid ":ref:`formatspec` for hex, octal, and binary numbers." -msgstr "" +msgstr ":ref:`formatspec` برای اعداد هگز، هشت و دودویی." #: library/stdtypes.rst:5606 +#, fuzzy msgid ":class:`str` to :class:`float`." -msgstr "" +msgstr ":class:`str` تا :class:`float`." #: library/stdtypes.rst:5607 +#, fuzzy msgid ":class:`str` to :class:`decimal.Decimal`." -msgstr "" +msgstr ":class:`str` تا :class:`decimal.Decimal`." #: library/stdtypes.rst:5610 +#, fuzzy msgid "Configuring the limit" -msgstr "" +msgstr "پیکربندی حد" #: library/stdtypes.rst:5612 -msgid "Before Python starts up you can use an environment variable or an interpreter command line flag to configure the limit:" +#, fuzzy +msgid "" +"Before Python starts up you can use an environment variable or an " +"interpreter command line flag to configure the limit:" msgstr "" +"قبل از راه‌اندازی پایتون، می‌توانید از یک متغیر محیطی یا پرچم خط فرمان مفسر " +"برای پیکربندی محدودیت استفاده کنید:" #: library/stdtypes.rst:5615 -msgid ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation." +#, fuzzy +msgid "" +":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " +"to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " +"the limitation." msgstr "" +":envvar:`PYTHONINTMAXSTRDIGITS`، به عنوان مثال ``PYTHONINTMAXSTRDIGITS=640 " +"python3`` برای تنظیم محدودیت روی 640 یا ``PYTHONINTMAXSTRDIGITS=0 python3`` " +"برای غیرفعال کردن محدودیت." #: library/stdtypes.rst:5618 -msgid ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X int_max_str_digits=640``" +#, fuzzy +msgid "" +":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " +"int_max_str_digits=640``" msgstr "" +":option:`-X int_max_str_digits <-X>`، به عنوان مثال ``python3 -X " +"int_max_str_digits=640``" #: library/stdtypes.rst:5620 -msgid ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the env var and the ``-X`` option are set, the ``-X`` option takes precedence. A value of *-1* indicates that both were unset, thus a value of :data:`sys.int_info.default_max_str_digits` was used during initialization." -msgstr "" +#, fuzzy +msgid "" +":data:`sys.flags.int_max_str_digits` contains the value of " +":envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If " +"both the env var and the ``-X`` option are set, the ``-X`` option takes " +"precedence. A value of *-1* indicates that both were unset, thus a value of " +":data:`sys.int_info.default_max_str_digits` was used during initialization." +msgstr "" +":data:`sys.flags.int_max_str_digits` حاوی مقدار " +":envvar:`PYTHONINTMAXSTRDIGITS` یا :option:`-X int_max_str_digits <-X>` است." +" اگر هر دو گزینه env var و ``-X`` تنظیم شده باشند، گزینه ``-X`` اولویت دارد." +" مقدار *-1* نشان می دهد که هر دو تنظیم نشده بودند، بنابراین مقدار " +":data:`sys.int_info.default_max_str_digits` در هنگام مقداردهی اولیه استفاده " +"شد." #: library/stdtypes.rst:5626 -msgid "From code, you can inspect the current limit and set a new one using these :mod:`sys` APIs:" +#, fuzzy +msgid "" +"From code, you can inspect the current limit and set a new one using these " +":mod:`sys` APIs:" msgstr "" +"از کد، می توانید محدودیت فعلی را بررسی کرده و با استفاده از این API های " +":mod:`sys` یک محدودیت جدید تنظیم کنید:" #: library/stdtypes.rst:5629 -msgid ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` are a getter and setter for the interpreter-wide limit. Subinterpreters have their own limit." +#, fuzzy +msgid "" +":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " +"are a getter and setter for the interpreter-wide limit. Subinterpreters have" +" their own limit." msgstr "" +":func:`sys.get_int_max_str_digits` و :func:`sys.set_int_max_str_digits` یک " +"گیرنده و تنظیم کننده برای حد گسترده مترجم هستند. مترجم فرعی محدودیت خاص خود " +"را دارد." #: library/stdtypes.rst:5633 -msgid "Information about the default and minimum can be found in :data:`sys.int_info`:" +#, fuzzy +msgid "" +"Information about the default and minimum can be found in " +":data:`sys.int_info`:" msgstr "" +"اطلاعات مربوط به پیش فرض و حداقل را می توان در :data:`sys.int_info` یافت:" #: library/stdtypes.rst:5635 -msgid ":data:`sys.int_info.default_max_str_digits ` is the compiled-in default limit." +#, fuzzy +msgid "" +":data:`sys.int_info.default_max_str_digits ` is the compiled-" +"in default limit." msgstr "" +":data:`sys.int_info.default_max_str_digits ` حد پیش فرض " +"کامپایل شده است." #: library/stdtypes.rst:5637 -msgid ":data:`sys.int_info.str_digits_check_threshold ` is the lowest accepted value for the limit (other than 0 which disables it)." +#, fuzzy +msgid "" +":data:`sys.int_info.str_digits_check_threshold ` is the lowest" +" accepted value for the limit (other than 0 which disables it)." msgstr "" +":data:`sys.int_info.str_digits_check_threshold ` کمترین مقدار " +"پذیرفته شده برای حد است (به غیر از 0 که آن را غیرفعال می کند)." #: library/stdtypes.rst:5644 -msgid "Setting a low limit *can* lead to problems. While rare, code exists that contains integer constants in decimal in their source that exceed the minimum threshold. A consequence of setting the limit is that Python source code containing decimal integer literals longer than the limit will encounter an error during parsing, usually at startup time or import time or even at installation time - anytime an up to date ``.pyc`` does not already exist for the code. A workaround for source that contains such large constants is to convert them to ``0x`` hexadecimal form as it has no limit." -msgstr "" +#, fuzzy +msgid "" +"Setting a low limit *can* lead to problems. While rare, code exists that " +"contains integer constants in decimal in their source that exceed the " +"minimum threshold. A consequence of setting the limit is that Python source " +"code containing decimal integer literals longer than the limit will " +"encounter an error during parsing, usually at startup time or import time or" +" even at installation time - anytime an up to date ``.pyc`` does not already" +" exist for the code. A workaround for source that contains such large " +"constants is to convert them to ``0x`` hexadecimal form as it has no limit." +msgstr "" +"تنظیم یک حد پایین *can* منجر به مشکلاتی می شود. در حالی که نادر است، کدی " +"وجود دارد که دارای اعداد صحیح به صورت اعشاری در منبع خود است که از حداقل " +"آستانه فراتر می رود. پیامد تنظیم محدودیت این است که کد منبع پایتون حاوی " +"اعداد صحیح اعشاری طولانی‌تر از حد مجاز، در هنگام تجزیه معمولاً در زمان " +"راه‌اندازی یا زمان وارد کردن یا حتی در زمان نصب با خطا مواجه می‌شود - هر " +"زمان که ``.pyc`` به‌روز برای کد وجود نداشته باشد. یک راه حل برای منبعی که " +"دارای چنین ثابت های بزرگی است، تبدیل آنها به شکل هگزادسیمال ``0x`` است زیرا " +"محدودیتی ندارد." #: library/stdtypes.rst:5653 -msgid "Test your application thoroughly if you use a low limit. Ensure your tests run with the limit set early via the environment or flag so that it applies during startup and even during any installation step that may invoke Python to precompile ``.py`` sources to ``.pyc`` files." +#, fuzzy +msgid "" +"Test your application thoroughly if you use a low limit. Ensure your tests " +"run with the limit set early via the environment or flag so that it applies " +"during startup and even during any installation step that may invoke Python " +"to precompile ``.py`` sources to ``.pyc`` files." msgstr "" +"اگر از محدودیت کم استفاده می کنید، برنامه خود را به طور کامل آزمایش کنید. " +"مطمئن شوید که آزمایش‌های شما با محدودیتی که از طریق محیط یا پرچم تعیین شده " +"است اجرا می‌شوند تا در هنگام راه‌اندازی و حتی در طول هر مرحله نصبی که ممکن " +"است پایتون را برای کامپایل کردن منابع ``.py`` به فایل‌های ``.pyc`` از پیش " +"فراخوانی کند، اعمال شود." #: library/stdtypes.rst:5659 +#, fuzzy msgid "Recommended configuration" -msgstr "" +msgstr "پیکربندی توصیه شده" #: library/stdtypes.rst:5661 -msgid "The default :data:`sys.int_info.default_max_str_digits` is expected to be reasonable for most applications. If your application requires a different limit, set it from your main entry point using Python version agnostic code as these APIs were added in security patch releases in versions before 3.12." +#, fuzzy +msgid "" +"The default :data:`sys.int_info.default_max_str_digits` is expected to be " +"reasonable for most applications. If your application requires a different " +"limit, set it from your main entry point using Python version agnostic code " +"as these APIs were added in security patch releases in versions before 3.12." msgstr "" +"انتظار می رود :data:`sys.int_info.default_max_str_digits` پیش فرض برای اکثر " +"برنامه ها معقول باشد. اگر برنامه شما به محدودیت دیگری نیاز دارد، آن را از " +"نقطه ورودی اصلی خود با استفاده از کد آگنوستیک نسخه پایتون تنظیم کنید زیرا " +"این APIها در نسخه های قبل از 3.12 در نسخه های وصله امنیتی منتشر شده اضافه " +"شده اند." #: library/stdtypes.rst:5666 +#, fuzzy msgid "Example::" -msgstr "" +msgstr "مثال::" #: library/stdtypes.rst:5668 -msgid ">>> import sys\n" +#, fuzzy +msgid "" +">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" "... upper_bound = 68000\n" "... lower_bound = 4004\n" @@ -5407,850 +10957,979 @@ msgid ">>> import sys\n" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" +">>> import sys\n" +">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" +"... upper_bound = 68000\n" +"... lower_bound = 4004\n" +"... current_limit = sys.get_int_max_str_digits()\n" +"... if current_limit == 0 or current_limit > upper_bound:\n" +"... sys.set_int_max_str_digits(upper_bound)\n" +"... elif current_limit < lower_bound:\n" +"... sys.set_int_max_str_digits(lower_bound)" #: library/stdtypes.rst:5678 +#, fuzzy msgid "If you need to disable it entirely, set it to ``0``." -msgstr "" +msgstr "اگر باید آن را به طور کامل غیرفعال کنید، آن را روی ``0`` تنظیم کنید." #: library/stdtypes.rst:5682 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: library/stdtypes.rst:5683 -msgid "Additional information on these special methods may be found in the Python Reference Manual (:ref:`customization`)." +#, fuzzy +msgid "" +"Additional information on these special methods may be found in the Python " +"Reference Manual (:ref:`customization`)." msgstr "" +"اطلاعات اضافی در مورد این روش‌های خاص را می‌توانید در راهنمای مرجع پایتون " +"(:ref:`customization`) پیدا کنید." #: library/stdtypes.rst:5686 -msgid "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples." +#, fuzzy +msgid "" +"As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``," +" and similarly for tuples." msgstr "" +"در نتیجه، لیست ``[1, 2]`` برابر با ``[1.0, 2.0]`` و به طور مشابه برای تاپل " +"ها در نظر گرفته می شود." #: library/stdtypes.rst:5689 +#, fuzzy msgid "They must have since the parser can't tell the type of the operands." msgstr "" +"آنها باید داشته باشند زیرا تجزیه کننده نمی تواند نوع عملوندها را تشخیص دهد." #: library/stdtypes.rst:5691 -msgid "Cased characters are those with general category property being one of \"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, titlecase)." +#, fuzzy +msgid "" +"Cased characters are those with general category property being one of " +"\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " +"titlecase)." msgstr "" +"نویسه‌های حروف کوچک، آنهایی هستند که ویژگی دسته‌بندی عمومی آنها یکی از «Lu» " +"(حروف, بزرگ)، «Ll» (حروف, حروف کوچک), یا «Lt» (حروف, حروف عنوان) است." #: library/stdtypes.rst:5694 -msgid "To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted." +#, fuzzy +msgid "" +"To format only a tuple you should therefore provide a singleton tuple whose " +"only element is the tuple to be formatted." msgstr "" +"برای فرمت کردن فقط یک تاپل، باید یک تاپل تک تنی تهیه کنید که تنها عنصر آن " +"تاپلی است که باید قالب بندی شود." #: library/stdtypes.rst:13 +#, fuzzy msgid "built-in" -msgstr "" +msgstr "ساخته شده است" -#: library/stdtypes.rst:13 -#: library/stdtypes.rst:316 -#: library/stdtypes.rst:393 -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:1117 -#: library/stdtypes.rst:1139 -#: library/stdtypes.rst:1154 -#: library/stdtypes.rst:4435 -#: library/stdtypes.rst:5419 +#: library/stdtypes.rst:13 library/stdtypes.rst:316 library/stdtypes.rst:393 +#: library/stdtypes.rst:950 library/stdtypes.rst:1117 +#: library/stdtypes.rst:1139 library/stdtypes.rst:1154 +#: library/stdtypes.rst:4435 library/stdtypes.rst:5419 +#, fuzzy msgid "types" -msgstr "" +msgstr "انواع" -#: library/stdtypes.rst:34 -#: library/stdtypes.rst:1154 -#: library/stdtypes.rst:4435 +#: library/stdtypes.rst:34 library/stdtypes.rst:1154 library/stdtypes.rst:4435 +#, fuzzy msgid "statement" -msgstr "" +msgstr "بیانیه" #: library/stdtypes.rst:34 +#, fuzzy msgid "if" -msgstr "" +msgstr "اگر" #: library/stdtypes.rst:34 +#, fuzzy msgid "while" -msgstr "" +msgstr "در حالی که" #: library/stdtypes.rst:34 +#, fuzzy msgid "truth" -msgstr "" +msgstr "حقیقت" #: library/stdtypes.rst:34 +#, fuzzy msgid "value" -msgstr "" +msgstr "ارزش" -#: library/stdtypes.rst:34 -#: library/stdtypes.rst:81 -#: library/stdtypes.rst:208 +#: library/stdtypes.rst:34 library/stdtypes.rst:81 library/stdtypes.rst:208 #: library/stdtypes.rst:817 +#, fuzzy msgid "Boolean" -msgstr "" +msgstr "بولی" -#: library/stdtypes.rst:34 -#: library/stdtypes.rst:81 -#: library/stdtypes.rst:393 +#: library/stdtypes.rst:34 library/stdtypes.rst:81 library/stdtypes.rst:393 +#, fuzzy msgid "operations" -msgstr "" +msgstr "عملیات" #: library/stdtypes.rst:34 +#, fuzzy msgid "false" -msgstr "" +msgstr "نادرست" #: library/stdtypes.rst:44 +#, fuzzy msgid "true" -msgstr "" +msgstr "درست است" #: library/stdtypes.rst:52 +#, fuzzy msgid "None (Built-in object)" -msgstr "" +msgstr "هیچ (شیء داخلی)" #: library/stdtypes.rst:52 +#, fuzzy msgid "False (Built-in object)" -msgstr "" +msgstr "نادرست (شیء داخلی)" -#: library/stdtypes.rst:64 -#: library/stdtypes.rst:98 -#: library/stdtypes.rst:123 -#: library/stdtypes.rst:195 -#: library/stdtypes.rst:246 -#: library/stdtypes.rst:393 +#: library/stdtypes.rst:64 library/stdtypes.rst:98 library/stdtypes.rst:123 +#: library/stdtypes.rst:195 library/stdtypes.rst:246 library/stdtypes.rst:393 #: library/stdtypes.rst:950 +#, fuzzy msgid "operator" -msgstr "" +msgstr "اپراتور" -#: library/stdtypes.rst:64 -#: library/stdtypes.rst:98 +#: library/stdtypes.rst:64 library/stdtypes.rst:98 +#, fuzzy msgid "or" -msgstr "" +msgstr "یا" -#: library/stdtypes.rst:64 -#: library/stdtypes.rst:98 +#: library/stdtypes.rst:64 library/stdtypes.rst:98 +#, fuzzy msgid "and" -msgstr "" +msgstr "و" -#: library/stdtypes.rst:64 -#: library/stdtypes.rst:817 +#: library/stdtypes.rst:64 library/stdtypes.rst:817 +#, fuzzy msgid "False" -msgstr "" +msgstr "نادرست" -#: library/stdtypes.rst:64 -#: library/stdtypes.rst:817 +#: library/stdtypes.rst:64 library/stdtypes.rst:817 +#, fuzzy msgid "True" -msgstr "" +msgstr "درست است" #: library/stdtypes.rst:98 +#, fuzzy msgid "not" -msgstr "" +msgstr "نه" #: library/stdtypes.rst:123 +#, fuzzy msgid "chaining" -msgstr "" +msgstr "زنجیر زدن" #: library/stdtypes.rst:123 +#, fuzzy msgid "comparisons" -msgstr "" +msgstr "مقایسه ها" #: library/stdtypes.rst:123 +#, fuzzy msgid "comparison" -msgstr "" +msgstr "مقایسه" #: library/stdtypes.rst:123 +#, fuzzy msgid "==" -msgstr "" +msgstr "#ERROR!" #: library/stdtypes.rst:123 +#, fuzzy msgid "< (less)" -msgstr "" +msgstr "< (کمتر)" #: library/stdtypes.rst:123 +#, fuzzy msgid "<=" -msgstr "" +msgstr "<=" #: library/stdtypes.rst:123 +#, fuzzy msgid "> (greater)" -msgstr "" +msgstr "> (بزرگتر)" #: library/stdtypes.rst:123 +#, fuzzy msgid ">=" -msgstr "" +msgstr ">=" #: library/stdtypes.rst:123 +#, fuzzy msgid "!=" -msgstr "" +msgstr "!=" #: library/stdtypes.rst:123 +#, fuzzy msgid "is" -msgstr "" +msgstr "است" #: library/stdtypes.rst:123 +#, fuzzy msgid "is not" -msgstr "" - -#: library/stdtypes.rst:163 -#: library/stdtypes.rst:208 -#: library/stdtypes.rst:934 -#: library/stdtypes.rst:1117 -#: library/stdtypes.rst:1139 -#: library/stdtypes.rst:1260 -#: library/stdtypes.rst:1339 -#: library/stdtypes.rst:1383 -#: library/stdtypes.rst:1504 -#: library/stdtypes.rst:1540 -#: library/stdtypes.rst:2526 -#: library/stdtypes.rst:2545 -#: library/stdtypes.rst:2652 -#: library/stdtypes.rst:4233 -#: library/stdtypes.rst:4435 -#: library/stdtypes.rst:4914 -#: library/stdtypes.rst:5169 -#: library/stdtypes.rst:5339 -#: library/stdtypes.rst:5383 +msgstr "نیست" + +#: library/stdtypes.rst:163 library/stdtypes.rst:208 library/stdtypes.rst:934 +#: library/stdtypes.rst:1117 library/stdtypes.rst:1139 +#: library/stdtypes.rst:1260 library/stdtypes.rst:1339 +#: library/stdtypes.rst:1383 library/stdtypes.rst:1504 +#: library/stdtypes.rst:1540 library/stdtypes.rst:2526 +#: library/stdtypes.rst:2545 library/stdtypes.rst:2652 +#: library/stdtypes.rst:4233 library/stdtypes.rst:4435 +#: library/stdtypes.rst:4914 library/stdtypes.rst:5169 +#: library/stdtypes.rst:5339 library/stdtypes.rst:5383 +#, fuzzy msgid "object" -msgstr "" +msgstr "شی" -#: library/stdtypes.rst:163 -#: library/stdtypes.rst:208 -#: library/stdtypes.rst:229 -#: library/stdtypes.rst:316 -#: library/stdtypes.rst:335 +#: library/stdtypes.rst:163 library/stdtypes.rst:208 library/stdtypes.rst:229 +#: library/stdtypes.rst:316 library/stdtypes.rst:335 +#, fuzzy msgid "numeric" -msgstr "" +msgstr "عددی" #: library/stdtypes.rst:163 +#, fuzzy msgid "objects" -msgstr "" +msgstr "اشیاء" #: library/stdtypes.rst:163 +#, fuzzy msgid "comparing" -msgstr "" +msgstr "مقایسه کردن" #: library/stdtypes.rst:173 +#, fuzzy msgid "__eq__() (instance method)" -msgstr "" +msgstr "__eq__() (روش نمونه)" #: library/stdtypes.rst:173 +#, fuzzy msgid "__ne__() (instance method)" -msgstr "" +msgstr "__ne__() (روش نمونه)" #: library/stdtypes.rst:173 +#, fuzzy msgid "__lt__() (instance method)" -msgstr "" +msgstr "__lt__() (روش نمونه)" #: library/stdtypes.rst:173 +#, fuzzy msgid "__le__() (instance method)" -msgstr "" +msgstr "__le__() (روش نمونه)" #: library/stdtypes.rst:173 +#, fuzzy msgid "__gt__() (instance method)" -msgstr "" +msgstr "__gt__() (روش نمونه)" #: library/stdtypes.rst:173 +#, fuzzy msgid "__ge__() (instance method)" -msgstr "" +msgstr "__ge__() (روش نمونه)" -#: library/stdtypes.rst:195 -#: library/stdtypes.rst:950 +#: library/stdtypes.rst:195 library/stdtypes.rst:950 +#, fuzzy msgid "in" -msgstr "" +msgstr "در" -#: library/stdtypes.rst:195 -#: library/stdtypes.rst:950 +#: library/stdtypes.rst:195 library/stdtypes.rst:950 +#, fuzzy msgid "not in" -msgstr "" +msgstr "نه در" -#: library/stdtypes.rst:208 -#: library/stdtypes.rst:229 -#: library/stdtypes.rst:393 +#: library/stdtypes.rst:208 library/stdtypes.rst:229 library/stdtypes.rst:393 +#, fuzzy msgid "integer" -msgstr "" +msgstr "عدد صحیح" -#: library/stdtypes.rst:208 -#: library/stdtypes.rst:229 +#: library/stdtypes.rst:208 library/stdtypes.rst:229 +#, fuzzy msgid "floating-point" -msgstr "" +msgstr "ممیز شناور" -#: library/stdtypes.rst:208 -#: library/stdtypes.rst:229 +#: library/stdtypes.rst:208 library/stdtypes.rst:229 +#, fuzzy msgid "complex number" -msgstr "" +msgstr "عدد مختلط" #: library/stdtypes.rst:208 +#, fuzzy msgid "C" -msgstr "" +msgstr "سی" #: library/stdtypes.rst:208 +#, fuzzy msgid "language" -msgstr "" +msgstr "زبان" #: library/stdtypes.rst:229 +#, fuzzy msgid "literals" -msgstr "" +msgstr "به معنای واقعی کلمه" #: library/stdtypes.rst:229 +#, fuzzy msgid "hexadecimal" -msgstr "" +msgstr "هگزادسیمال" #: library/stdtypes.rst:229 +#, fuzzy msgid "octal" -msgstr "" +msgstr "هشتی" #: library/stdtypes.rst:229 +#, fuzzy msgid "binary" -msgstr "" +msgstr "باینری" #: library/stdtypes.rst:246 +#, fuzzy msgid "arithmetic" -msgstr "" +msgstr "حسابی" -#: library/stdtypes.rst:246 -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:1117 -#: library/stdtypes.rst:4435 -#: library/stdtypes.rst:5390 -#: library/stdtypes.rst:5404 -#: library/stdtypes.rst:5419 +#: library/stdtypes.rst:246 library/stdtypes.rst:950 library/stdtypes.rst:1117 +#: library/stdtypes.rst:4435 library/stdtypes.rst:5390 +#: library/stdtypes.rst:5404 library/stdtypes.rst:5419 +#, fuzzy msgid "built-in function" -msgstr "" +msgstr "عملکرد داخلی" #: library/stdtypes.rst:246 +#, fuzzy msgid "int" -msgstr "" +msgstr "بین المللی" #: library/stdtypes.rst:246 +#, fuzzy msgid "float" -msgstr "" +msgstr "شناور" #: library/stdtypes.rst:246 +#, fuzzy msgid "complex" -msgstr "" +msgstr "مجتمع" -#: library/stdtypes.rst:246 -#: library/stdtypes.rst:2402 +#: library/stdtypes.rst:246 library/stdtypes.rst:2402 #: library/stdtypes.rst:3621 +#, fuzzy msgid "+ (plus)" -msgstr "" +msgstr "+ (plus)" #: library/stdtypes.rst:246 +#, fuzzy msgid "unary operator" -msgstr "" +msgstr "اپراتور unary" #: library/stdtypes.rst:246 +#, fuzzy msgid "binary operator" -msgstr "" +msgstr "عملگر باینری" -#: library/stdtypes.rst:246 -#: library/stdtypes.rst:2402 +#: library/stdtypes.rst:246 library/stdtypes.rst:2402 #: library/stdtypes.rst:3621 +#, fuzzy msgid "- (minus)" -msgstr "" +msgstr "- (minus)" -#: library/stdtypes.rst:246 -#: library/stdtypes.rst:2359 +#: library/stdtypes.rst:246 library/stdtypes.rst:2359 #: library/stdtypes.rst:3578 +#, fuzzy msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" #: library/stdtypes.rst:246 +#, fuzzy msgid "/ (slash)" -msgstr "" +msgstr "/ (اسلش)" #: library/stdtypes.rst:246 +#, fuzzy msgid "//" -msgstr "" +msgstr "//" -#: library/stdtypes.rst:246 -#: library/stdtypes.rst:2323 +#: library/stdtypes.rst:246 library/stdtypes.rst:2323 #: library/stdtypes.rst:3546 +#, fuzzy msgid "% (percent)" -msgstr "" +msgstr "% (درصد)" #: library/stdtypes.rst:246 +#, fuzzy msgid "**" -msgstr "" +msgstr "**" -#: library/stdtypes.rst:316 -#: library/stdtypes.rst:393 -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:1154 -#: library/stdtypes.rst:4435 +#: library/stdtypes.rst:316 library/stdtypes.rst:393 library/stdtypes.rst:950 +#: library/stdtypes.rst:1154 library/stdtypes.rst:4435 +#, fuzzy msgid "operations on" -msgstr "" +msgstr "عملیات بر روی" #: library/stdtypes.rst:316 +#, fuzzy msgid "conjugate() (complex number method)" -msgstr "" +msgstr "conjugate() (روش اعداد مختلط)" -#: library/stdtypes.rst:335 -#: library/stdtypes.rst:1606 -#: library/stdtypes.rst:2526 -#: library/stdtypes.rst:5419 +#: library/stdtypes.rst:335 library/stdtypes.rst:1606 +#: library/stdtypes.rst:2526 library/stdtypes.rst:5419 +#, fuzzy msgid "module" -msgstr "" +msgstr "ماژول" #: library/stdtypes.rst:335 +#, fuzzy msgid "math" -msgstr "" +msgstr "ریاضی" #: library/stdtypes.rst:335 +#, fuzzy msgid "floor() (in module math)" -msgstr "" +msgstr "floor() (در ریاضیات ماژول)" #: library/stdtypes.rst:335 +#, fuzzy msgid "ceil() (in module math)" -msgstr "" +msgstr "ceil() (در ریاضیات ماژول)" #: library/stdtypes.rst:335 +#, fuzzy msgid "trunc() (in module math)" -msgstr "" +msgstr "trunc() (در ریاضیات ماژول)" #: library/stdtypes.rst:335 +#, fuzzy msgid "conversions" -msgstr "" +msgstr "تبدیل ها" #: library/stdtypes.rst:393 +#, fuzzy msgid "bitwise" -msgstr "" +msgstr "به صورت بیتی" #: library/stdtypes.rst:393 +#, fuzzy msgid "shifting" -msgstr "" +msgstr "جابجایی" #: library/stdtypes.rst:393 +#, fuzzy msgid "masking" -msgstr "" +msgstr "پوشاندن" #: library/stdtypes.rst:393 +#, fuzzy msgid "| (vertical bar)" -msgstr "" +msgstr "| (نوار عمودی)" #: library/stdtypes.rst:393 +#, fuzzy msgid "^ (caret)" -msgstr "" +msgstr "^ (کارت)" #: library/stdtypes.rst:393 +#, fuzzy msgid "& (ampersand)" -msgstr "" +msgstr "& (امپرسند)" #: library/stdtypes.rst:393 +#, fuzzy msgid "<<" -msgstr "" +msgstr "<<" #: library/stdtypes.rst:393 +#, fuzzy msgid ">>" -msgstr "" +msgstr ">>" #: library/stdtypes.rst:393 +#, fuzzy msgid "~ (tilde)" -msgstr "" +msgstr "~ (tilde)" #: library/stdtypes.rst:817 +#, fuzzy msgid "values" -msgstr "" +msgstr "ارزش ها" #: library/stdtypes.rst:847 +#, fuzzy msgid "iterator protocol" -msgstr "" +msgstr "پروتکل تکرار کننده" -#: library/stdtypes.rst:847 -#: library/stdtypes.rst:4829 +#: library/stdtypes.rst:847 library/stdtypes.rst:4829 +#, fuzzy msgid "protocol" -msgstr "" +msgstr "پروتکل" #: library/stdtypes.rst:847 +#, fuzzy msgid "iterator" -msgstr "" +msgstr "تکرار کننده" -#: library/stdtypes.rst:847 -#: library/stdtypes.rst:934 -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:1117 -#: library/stdtypes.rst:1139 +#: library/stdtypes.rst:847 library/stdtypes.rst:934 library/stdtypes.rst:950 +#: library/stdtypes.rst:1117 library/stdtypes.rst:1139 #: library/stdtypes.rst:1154 +#, fuzzy msgid "sequence" -msgstr "" +msgstr "دنباله" #: library/stdtypes.rst:847 +#, fuzzy msgid "iteration" -msgstr "" +msgstr "تکرار" #: library/stdtypes.rst:847 +#, fuzzy msgid "container" -msgstr "" +msgstr "ظرف" #: library/stdtypes.rst:847 +#, fuzzy msgid "iteration over" -msgstr "" +msgstr "تکرار به پایان رسید" -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:4435 +#: library/stdtypes.rst:950 library/stdtypes.rst:4435 +#, fuzzy msgid "len" -msgstr "" +msgstr "لن" #: library/stdtypes.rst:950 +#, fuzzy msgid "min" -msgstr "" +msgstr "دقیقه" #: library/stdtypes.rst:950 +#, fuzzy msgid "max" -msgstr "" +msgstr "حداکثر" #: library/stdtypes.rst:950 +#, fuzzy msgid "concatenation" -msgstr "" +msgstr "الحاق" #: library/stdtypes.rst:950 +#, fuzzy msgid "operation" -msgstr "" +msgstr "عملیات" #: library/stdtypes.rst:950 +#, fuzzy msgid "repetition" -msgstr "" +msgstr "تکرار" -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:1154 +#: library/stdtypes.rst:950 library/stdtypes.rst:1154 +#, fuzzy msgid "subscript" -msgstr "" +msgstr "زیرنویس" -#: library/stdtypes.rst:950 -#: library/stdtypes.rst:1154 +#: library/stdtypes.rst:950 library/stdtypes.rst:1154 +#, fuzzy msgid "slice" -msgstr "" +msgstr "برش" #: library/stdtypes.rst:950 +#, fuzzy msgid "count() (sequence method)" -msgstr "" +msgstr "count() (روش دنباله ای)" #: library/stdtypes.rst:950 +#, fuzzy msgid "index() (sequence method)" -msgstr "" +msgstr "index() (روش دنباله ای)" #: library/stdtypes.rst:1006 +#, fuzzy msgid "loop" -msgstr "" +msgstr "حلقه" #: library/stdtypes.rst:1006 +#, fuzzy msgid "over mutable sequence" -msgstr "" +msgstr "بیش از توالی قابل تغییر" #: library/stdtypes.rst:1006 +#, fuzzy msgid "mutable sequence" -msgstr "" +msgstr "توالی قابل تغییر" #: library/stdtypes.rst:1006 +#, fuzzy msgid "loop over" -msgstr "" +msgstr "حلقه روی" #: library/stdtypes.rst:1117 +#, fuzzy msgid "immutable" -msgstr "" +msgstr "تغییرناپذیر" -#: library/stdtypes.rst:1117 -#: library/stdtypes.rst:1339 +#: library/stdtypes.rst:1117 library/stdtypes.rst:1339 +#, fuzzy msgid "tuple" -msgstr "" +msgstr "چندتایی" #: library/stdtypes.rst:1117 +#, fuzzy msgid "hash" -msgstr "" +msgstr "هش" #: library/stdtypes.rst:1139 +#, fuzzy msgid "mutable" -msgstr "" +msgstr "قابل تغییر" -#: library/stdtypes.rst:1139 -#: library/stdtypes.rst:1154 +#: library/stdtypes.rst:1139 library/stdtypes.rst:1154 #: library/stdtypes.rst:1260 +#, fuzzy msgid "list" -msgstr "" +msgstr "فهرست" -#: library/stdtypes.rst:1139 -#: library/stdtypes.rst:2526 -#: library/stdtypes.rst:2652 -#: library/stdtypes.rst:2724 +#: library/stdtypes.rst:1139 library/stdtypes.rst:2526 +#: library/stdtypes.rst:2652 library/stdtypes.rst:2724 #: library/stdtypes.rst:3546 +#, fuzzy msgid "bytearray" -msgstr "" +msgstr "بایت آرایه" -#: library/stdtypes.rst:1154 -#: library/stdtypes.rst:4435 -#: library/stdtypes.rst:5169 -#: library/stdtypes.rst:5419 +#: library/stdtypes.rst:1154 library/stdtypes.rst:4435 +#: library/stdtypes.rst:5169 library/stdtypes.rst:5419 +#, fuzzy msgid "type" -msgstr "" +msgstr "نوع" #: library/stdtypes.rst:1154 +#, fuzzy msgid "assignment" -msgstr "" +msgstr "تکلیف" -#: library/stdtypes.rst:1154 -#: library/stdtypes.rst:4435 +#: library/stdtypes.rst:1154 library/stdtypes.rst:4435 +#, fuzzy msgid "del" -msgstr "" +msgstr "دل" #: library/stdtypes.rst:1154 +#, fuzzy msgid "append() (sequence method)" -msgstr "" +msgstr "append() (روش دنباله ای)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "clear() (sequence method)" -msgstr "" +msgstr "clear() (روش دنباله ای)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "copy() (sequence method)" -msgstr "" +msgstr "copy() (روش دنباله ای)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "extend() (sequence method)" -msgstr "" +msgstr "extend() (روش دنباله ای)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "insert() (sequence method)" -msgstr "" +msgstr "insert() (روش دنباله)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "pop() (sequence method)" -msgstr "" +msgstr "pop() (روش دنباله ای)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "remove() (sequence method)" -msgstr "" +msgstr "remove() (روش دنباله ای)" #: library/stdtypes.rst:1154 +#, fuzzy msgid "reverse() (sequence method)" -msgstr "" +msgstr "reverse() (روش دنباله ای)" #: library/stdtypes.rst:1383 +#, fuzzy msgid "range" -msgstr "" +msgstr "محدوده" -#: library/stdtypes.rst:1504 -#: library/stdtypes.rst:1553 -#: library/stdtypes.rst:1598 -#: library/stdtypes.rst:2323 +#: library/stdtypes.rst:1504 library/stdtypes.rst:1553 +#: library/stdtypes.rst:1598 library/stdtypes.rst:2323 +#, fuzzy msgid "string" -msgstr "" +msgstr "رشته" #: library/stdtypes.rst:1504 +#, fuzzy msgid "text sequence type" -msgstr "" +msgstr "نوع دنباله متن" -#: library/stdtypes.rst:1504 -#: library/stdtypes.rst:1553 +#: library/stdtypes.rst:1504 library/stdtypes.rst:1553 #: library/stdtypes.rst:1571 +#, fuzzy msgid "str (built-in class)" -msgstr "" +msgstr "خیابان (کلاس توکار)" #: library/stdtypes.rst:1504 +#, fuzzy msgid "(see also string)" -msgstr "" +msgstr "(همچنین به رشته مراجعه کنید)" #: library/stdtypes.rst:1540 +#, fuzzy msgid "io.StringIO" -msgstr "" +msgstr "io.StringIO" -#: library/stdtypes.rst:1571 -#: library/stdtypes.rst:2518 +#: library/stdtypes.rst:1571 library/stdtypes.rst:2518 +#, fuzzy msgid "buffer protocol" -msgstr "" +msgstr "پروتکل بافر" -#: library/stdtypes.rst:1571 -#: library/stdtypes.rst:2526 -#: library/stdtypes.rst:2545 -#: library/stdtypes.rst:2724 +#: library/stdtypes.rst:1571 library/stdtypes.rst:2526 +#: library/stdtypes.rst:2545 library/stdtypes.rst:2724 #: library/stdtypes.rst:3546 +#, fuzzy msgid "bytes" -msgstr "" +msgstr "بایت ها" -#: library/stdtypes.rst:1598 -#: library/stdtypes.rst:2724 +#: library/stdtypes.rst:1598 library/stdtypes.rst:2724 +#, fuzzy msgid "methods" -msgstr "" +msgstr "روش ها" #: library/stdtypes.rst:1606 +#, fuzzy msgid "re" -msgstr "" +msgstr "دوباره" -#: library/stdtypes.rst:2131 -#: library/stdtypes.rst:3400 +#: library/stdtypes.rst:2131 library/stdtypes.rst:3400 +#, fuzzy msgid "universal newlines" -msgstr "" +msgstr "خطوط جدید جهانی" #: library/stdtypes.rst:2131 +#, fuzzy msgid "str.splitlines method" -msgstr "" +msgstr "روش str.splitlines" #: library/stdtypes.rst:2323 +#, fuzzy msgid "formatting, string (%)" -msgstr "" +msgstr "قالب بندی، رشته (%)" #: library/stdtypes.rst:2323 +#, fuzzy msgid "interpolation, string (%)" -msgstr "" +msgstr "درون یابی، رشته (%)" #: library/stdtypes.rst:2323 +#, fuzzy msgid "formatting, printf" -msgstr "" +msgstr "formatting, printf" #: library/stdtypes.rst:2323 +#, fuzzy msgid "interpolation, printf" -msgstr "" +msgstr "interpolation, printf" -#: library/stdtypes.rst:2323 -#: library/stdtypes.rst:3546 +#: library/stdtypes.rst:2323 library/stdtypes.rst:3546 +#, fuzzy msgid "printf-style formatting" -msgstr "" +msgstr "قالب بندی به سبک printf" -#: library/stdtypes.rst:2323 -#: library/stdtypes.rst:3546 +#: library/stdtypes.rst:2323 library/stdtypes.rst:3546 +#, fuzzy msgid "sprintf-style formatting" -msgstr "" +msgstr "قالب بندی به سبک sprintf" -#: library/stdtypes.rst:2359 -#: library/stdtypes.rst:3578 +#: library/stdtypes.rst:2359 library/stdtypes.rst:3578 +#, fuzzy msgid "() (parentheses)" -msgstr "" +msgstr "() (parentheses)" -#: library/stdtypes.rst:2359 -#: library/stdtypes.rst:2402 -#: library/stdtypes.rst:3578 -#: library/stdtypes.rst:3621 +#: library/stdtypes.rst:2359 library/stdtypes.rst:2402 +#: library/stdtypes.rst:3578 library/stdtypes.rst:3621 +#, fuzzy msgid "in printf-style formatting" -msgstr "" +msgstr "در قالب بندی به سبک printf" -#: library/stdtypes.rst:2359 -#: library/stdtypes.rst:3578 +#: library/stdtypes.rst:2359 library/stdtypes.rst:3578 +#, fuzzy msgid ". (dot)" -msgstr "" +msgstr ". (نقطه)" -#: library/stdtypes.rst:2402 -#: library/stdtypes.rst:3621 +#: library/stdtypes.rst:2402 library/stdtypes.rst:3621 +#, fuzzy msgid "# (hash)" -msgstr "" +msgstr "# (hash)" -#: library/stdtypes.rst:2402 -#: library/stdtypes.rst:3621 +#: library/stdtypes.rst:2402 library/stdtypes.rst:3621 +#, fuzzy msgid "space" -msgstr "" +msgstr "فضا" #: library/stdtypes.rst:2518 +#, fuzzy msgid "binary sequence types" -msgstr "" +msgstr "انواع توالی باینری" #: library/stdtypes.rst:2526 +#, fuzzy msgid "memoryview" -msgstr "" +msgstr "مموری ویو" #: library/stdtypes.rst:2526 +#, fuzzy msgid "array" -msgstr "" +msgstr "آرایه" #: library/stdtypes.rst:3400 +#, fuzzy msgid "bytes.splitlines method" -msgstr "" +msgstr "روش bytes.splitlines" #: library/stdtypes.rst:3400 +#, fuzzy msgid "bytearray.splitlines method" -msgstr "" +msgstr "روش bytearray.splitlines" #: library/stdtypes.rst:3546 +#, fuzzy msgid "formatting" -msgstr "" +msgstr "قالب بندی" #: library/stdtypes.rst:3546 +#, fuzzy msgid "bytes (%)" -msgstr "" +msgstr "بایت (%)" #: library/stdtypes.rst:3546 +#, fuzzy msgid "bytearray (%)" -msgstr "" +msgstr "آرایه بایت (%)" #: library/stdtypes.rst:3546 +#, fuzzy msgid "interpolation" -msgstr "" +msgstr "درون یابی" #: library/stdtypes.rst:4233 +#, fuzzy msgid "set" -msgstr "" +msgstr "مجموعه" #: library/stdtypes.rst:4435 +#, fuzzy msgid "mapping" -msgstr "" +msgstr "نقشه برداری" #: library/stdtypes.rst:4435 +#, fuzzy msgid "dictionary" -msgstr "" +msgstr "فرهنگ لغت" #: library/stdtypes.rst:4518 +#, fuzzy msgid "__missing__()" -msgstr "" +msgstr "__missing__()" #: library/stdtypes.rst:4829 +#, fuzzy msgid "context manager" -msgstr "" +msgstr "مدیر زمینه" #: library/stdtypes.rst:4829 +#, fuzzy msgid "context management protocol" -msgstr "" +msgstr "پروتکل مدیریت زمینه" #: library/stdtypes.rst:4829 +#, fuzzy msgid "context management" -msgstr "" +msgstr "مدیریت زمینه" #: library/stdtypes.rst:4902 +#, fuzzy msgid "annotation" -msgstr "" +msgstr "حاشیه نویسی" #: library/stdtypes.rst:4902 +#, fuzzy msgid "type annotation; type hint" -msgstr "" +msgstr "حاشیه نویسی را تایپ کنید. اشاره را تایپ کنید" #: library/stdtypes.rst:4914 +#, fuzzy msgid "GenericAlias" -msgstr "" +msgstr "GenericAlias" #: library/stdtypes.rst:4914 +#, fuzzy msgid "Generic" -msgstr "" +msgstr "عمومی" #: library/stdtypes.rst:4914 +#, fuzzy msgid "Alias" -msgstr "" +msgstr "نام مستعار" #: library/stdtypes.rst:5169 +#, fuzzy msgid "Union" -msgstr "" +msgstr "اتحادیه" #: library/stdtypes.rst:5169 +#, fuzzy msgid "union" -msgstr "" +msgstr "اتحادیه" #: library/stdtypes.rst:5339 +#, fuzzy msgid "method" -msgstr "" +msgstr "روش" #: library/stdtypes.rst:5383 +#, fuzzy msgid "code" -msgstr "" +msgstr "کد" #: library/stdtypes.rst:5383 +#, fuzzy msgid "code object" -msgstr "" +msgstr "شی کد" #: library/stdtypes.rst:5390 +#, fuzzy msgid "compile" -msgstr "" +msgstr "کامپایل کردن" #: library/stdtypes.rst:5390 +#, fuzzy msgid "__code__ (function object attribute)" -msgstr "" +msgstr "__code__ (ویژگی شی تابع)" #: library/stdtypes.rst:5404 +#, fuzzy msgid "exec" -msgstr "" +msgstr "اجرایی" #: library/stdtypes.rst:5404 +#, fuzzy msgid "eval" -msgstr "" +msgstr "ارزیابی" #: library/stdtypes.rst:5443 +#, fuzzy msgid "..." -msgstr "" +msgstr "..." #: library/stdtypes.rst:5443 +#, fuzzy msgid "ellipsis literal" -msgstr "" +msgstr "بیضی به معنای واقعی کلمه" diff --git a/scripts/fix_commas.py b/scripts/fix_commas.py new file mode 100644 index 00000000..77bb07d9 --- /dev/null +++ b/scripts/fix_commas.py @@ -0,0 +1,171 @@ +import polib +import re +import sys +import os +import glob + +code_patterns = [ + # Basic patterns + r"\([^)]*،[^)]*\)", # foo(3.0، -4.5) + r"\[[^]]*،[^]]*\]", # ['a'، 'b'، 'c'] + r"\{[^}]*،[^}]*\}", # {'Sjoerd': 4127، 'Jack': 4098} + # Function and class definitions + r"def\s+\w+\s*\([^)]*،[^)]*\)", # def __init__(self، name) + r"class\s+\w+\s*\([^)]*،[^)]*\)", # class AsyncZip(threading.Thread، file) + r"__init__\([^)]*،[^)]*\)", # __init__(self، realpart، imagpart) + # Method and function calls + r"\w+\([^)]*،[^)]*\)", # round(Decimal('0.70')، 2) + r"__import__\([^،]*(?:،\s*[^،)]*){0,4}\)", # __import__('spam.ham'، globals()، locals()) + r"(?:globals|locals)\(\)،\s*(?:globals|locals)\(\)", # globals()، locals() + # Variable assignments and operations + r"for\s+\w+،\s*\w+\s+in\s+", # for a، b in table.items() + r"print\([^)]*،[^)]*\)", # print(a، end=' ') + # Variable and attribute access + r"\w+\.\w+،\s*\w+\.\w+", # x.r، x.i + r"(?:\w+\([^)]*\)|'[^']*'|\"[^\"]*\"|[)\]])،\s*\w+", # os.open('mydata.db'، 'rb') + # Dictionary operations + r"{\s*'[^']*':\s*\w+،", # {'primary': یک، 'secondary': دو} + r"for\s+\w+،\s*\w+\s+in\s+\w+\.items\(\)", # for a، b in table.items() + r">>>.*،.*", # >>> a، b +] + + +def is_code_pattern(text: str) -> bool: + """ + Check if the text matches common code patterns + where virgules should be converted to commas. + """ + + return any(re.search(pattern, text) for pattern in code_patterns) + + +def fix_virgules_in_code(entry): + """ + Fix virgules in code sections while preserving them in regular text. + Returns True if any changes were made. + """ + modified = False + + # Check if original message is complete Python code + if is_complete_python_code(entry.msgid): + if entry.msgid != entry.msgstr and entry.msgstr != "": + entry.msgstr = entry.msgid + modified = True + return modified + + # If the text appears to be code, replace virgules + if is_code_pattern(entry.msgstr): + new_text = entry.msgstr + + # Handle matches + def replace_virgules(match): + return match.group().replace("،", ",") + + # Use the same patterns from is_code_pattern + for pattern in code_patterns: + new_text = re.sub(pattern, replace_virgules, new_text) + + if new_text != entry.msgstr: + entry.msgstr = new_text + modified = True + + return modified + + +def is_complete_python_code(text: str) -> bool: + """ + Check if the text is complete, runnable Python code. + """ + if ( + len(text.split()) == 1 + and "_" not in text + and "(" not in text + and ")" not in text + and "," not in text + ): + return False + + try: + compile(text, "", "exec") + return True + except SyntaxError: + pass + + try: + # remove >>> and ... prompts + text_without_prompts = re.sub(r"^>>> |^\.\.\. ", "", text, flags=re.MULTILINE) + compile(text_without_prompts, "", "exec") + return True + except SyntaxError: + pass + + try: + # remove >>> and ... prompts except the last one (might be the output) + text_without_prompts = re.sub(r"^>>> |^\.\.\. ", "", text, flags=re.MULTILINE) + text_without_prompts = re.sub( + r"^>>> |^\.\.\. ", "", text_without_prompts, count=1, flags=re.MULTILINE + ) + compile(text_without_prompts, "", "exec") + return True + except SyntaxError: + pass + + +def process_po_file(po_file): + """Process a single PO file.""" + try: + po = polib.pofile(po_file) + fixed_entries = 0 + + for entry in po: + if fix_virgules_in_code(entry): + fixed_entries += 1 + + if fixed_entries > 0: + po.save() + print(f"Fixed {fixed_entries} entries in {po_file}") + + except Exception as e: + print(f"Error processing {po_file}: {e}") + + +def collect_po_files(path): + """ + Given a path (wildcard, file, or directory), return a list of .po files. + """ + files = [] + if os.path.isfile(path) and path.endswith(".po"): + files.append(path) + elif os.path.isdir(path): + for root, _, filenames in os.walk(path): + for filename in filenames: + if filename.endswith(".po"): + files.append(os.path.join(root, filename)) + else: + # Handle wildcards + for p in glob.glob(path, recursive=True): + if os.path.isfile(p) and p.endswith(".po"): + files.append(p) + return files + + +def main(paths): + processed_files = set() + for path in paths: + for po_file in collect_po_files(path): + if po_file not in processed_files: + process_po_file(po_file) + processed_files.add(po_file) + + if not processed_files: + print("No PO files found.") + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print( + "Usage: python fix_code_virgules.py " + " [additional paths...]" + ) + sys.exit(1) + main(sys.argv[1:]) diff --git a/scripts/translation_manager.py b/scripts/translation_manager.py new file mode 100644 index 00000000..85a312b0 --- /dev/null +++ b/scripts/translation_manager.py @@ -0,0 +1,205 @@ +import os +import re +import polib +import itertools +import argparse +from typing import Dict, Tuple +from openpyxl import Workbook, load_workbook + +_patterns = [ + ":c:func:`[^`]+`", + ":c:type:`[^`]+`", + ":c:macro:`[^`]+`", + ":c:member:`[^`]+`", + ":c:data:`[^`]+`", + ":py:data:`[^`]+`", + ":py:mod:`[^`]+`", + ":func:`[^`]+`", + ":mod:`[^`]+`", + ":ref:`[^`]+`", + ":class:`[^`]+`", + ":pep:`[^`]+`", + ":data:`[^`]+`", + ":exc:`[^`]+`", + ":term:`[^`]+`", + ":meth:`[^`]+`", + ":envvar:`[^`]+`", + ":file:`[^`]+`", + ":attr:`[^`]+`", + ":const:`[^`]+`", + ":issue:`[^`]+`", + ":opcode:`[^`]+`", + ":option:`[^`]+`", + ":program:`[^`]+`", + ":keyword:`[^`]+`", + ":RFC:`[^`]+`", + ":rfc:`[^`]+`", + ":doc:`[^`]+`", + ":source:`[^`]+`", + ":manpage:`[^`]+`", + ":mimetype:`[^`]+`", + ":sup:`[^`]+`", + ":kbd:`[^`]+`", + ":const:`[^`]+`", + "``[^`]+``", + "`[^`]+`__", + "`[^`]+`_", + r"\*\*[^\*]+\*\*", # bold text between ** + r"\*[^\*]+\*", # italic text between * +] +_exps = [re.compile(e) for e in _patterns] + + +class Normalizer: + @staticmethod + def protect_sphinx_directives(s: str) -> Tuple[Dict[str, str], str]: + """ + Replace Sphinx directives in the input string with placeholders. + + Parameters: + s: The original string containing Sphinx directives. + Returns: + A tuple (placeholders, new_s) where 'placeholders' maps placeholders + to the original directives and 'new_s' is the string with placeholders. + """ + placeholders: Dict[str, str] = {} + counter = itertools.count() + + def repl(match): + ph = f"XASDF{next(counter):02}" + placeholders[ph] = match.group(0) + return ph + + combined_pattern = "|".join(f"({p})" for p in _patterns) + combined_regex = re.compile(combined_pattern) + new_s = combined_regex.sub(repl, s) + return placeholders, new_s + + @staticmethod + def undo_sphinx_directives_protection( + placeholders: Dict[str, str], translated_text: str + ) -> str: + """ + Restore the original Sphinx directives in the translated text. + """ + for ph, value in placeholders.items(): + translated_text = translated_text.replace(ph, value) + return translated_text + + +class POExtractor: + """Extracts unique strings from .po files in given directories and exports them to an Excel file.""" + + def __init__(self, directories): + self.directories = directories + self.strings = {} + + def extract_strings_from_po(self, po_path: str) -> None: + po = polib.pofile(po_path) + for entry in po: + if entry.msgid: + self.strings[entry.msgid] = None + + def process_directories(self) -> None: + for base_dir in self.directories: + for root, _, files in os.walk(base_dir): + for file in files: + if file.endswith(".po"): + po_path = os.path.join(root, file) + self.extract_strings_from_po(po_path) + + def generate_excel(self, output_excel: str) -> None: + wb = Workbook() + ws = wb.active + ws.title = "Translations" + ws.append(["Original", "Placeholders", "Temp Text", "Translation"]) + for original in self.strings: + placeholders, temp_text = Normalizer.protect_sphinx_directives(original) + ws.append([original, str(placeholders), temp_text, ""]) + wb.save(output_excel) + print(f"Excel file saved to {output_excel}.") + + +class POUpdater: + """Updates .po files with translations from an Excel file.""" + + def __init__(self, directories, excel_file: str): + self.directories = directories + self.excel_file = excel_file + self.translations = {} + + def load_translations(self) -> None: + wb = load_workbook(self.excel_file) + ws = wb.active + for row in ws.iter_rows(min_row=2, values_only=True): + if row[0]: + original = row[0] + placeholders = eval(row[1]) + translated = row[3] + translated = Normalizer.undo_sphinx_directives_protection( + placeholders, translated + ) + self.translations[original] = translated + + def update_po_file(self, po_path: str) -> None: + po = polib.pofile(po_path) + updated = False + for entry in po: + if entry.msgid in self.translations: + new_translation = self.translations[entry.msgid] + if new_translation != entry.msgstr: + entry.msgstr = new_translation + if "fuzzy" not in entry.flags: + entry.flags.append("fuzzy") + updated = True + if updated: + po.save() + print(f"Updated translations in {po_path}") + + def update_directories(self) -> None: + self.load_translations() + if not self.translations: + print("No translations found in the Excel file.") + return + + for base_dir in self.directories: + for root, _, files in os.walk(base_dir): + for file in files: + if file.endswith(".po"): + self.update_po_file(os.path.join(root, file)) + + +def main(): + parser = argparse.ArgumentParser( + description="Extract or update PO translations using an Excel file" + ) + parser.add_argument( + "mode", + choices=["extract", "update"], + help="Choose to extract from or update PO files", + ) + parser.add_argument( + "--dir", + nargs="+", + default=["./need_to_translate"], + help="Directories containing PO files", + ) + parser.add_argument( + "--excel", + type=str, + default="translations.xlsx", + help="Excel file to read from or write to", + ) + args = parser.parse_args() + + if args.mode == "extract": + extractor = POExtractor(args.dir) + extractor.process_directories() + extractor.generate_excel(args.excel) + elif args.mode == "update": + updater = POUpdater(args.dir, args.excel) + updater.update_directories() + + +if __name__ == "__main__": + main() diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 94c1e7e2..e6b2ec0e 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -17,120 +17,305 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/appendix.rst:5 +#, fuzzy msgid "Appendix" -msgstr "" +msgstr "ضمیمه" #: tutorial/appendix.rst:11 +#, fuzzy msgid "Interactive Mode" -msgstr "" +msgstr "حالت تعاملی" #: tutorial/appendix.rst:13 -msgid "There are two variants of the interactive :term:`REPL`. The classic basic interpreter is supported on all platforms with minimal line control capabilities." +#, fuzzy +msgid "" +"There are two variants of the interactive :term:`REPL`. The classic basic " +"interpreter is supported on all platforms with minimal line control " +"capabilities." msgstr "" +"دو نوع از :term:`REPL` تعاملی وجود دارد. مفسر پایه کلاسیک در تمام پلتفرم ها" +" با حداقل قابلیت های کنترل خط پشتیبانی می شود." #: tutorial/appendix.rst:17 -msgid "On Windows, or Unix-like systems with :mod:`curses` support, a new interactive shell is used by default. This one supports color, multiline editing, history browsing, and paste mode. To disable color, see :ref:`using-on-controlling-color` for details. Function keys provide some additional functionality. :kbd:`F1` enters the interactive help browser :mod:`pydoc`. :kbd:`F2` allows for browsing command-line history with neither output nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters \"paste mode\", which makes pasting larger blocks of code easier. Press :kbd:`F3` to return to the regular prompt." +#, fuzzy +msgid "" +"On Windows, or Unix-like systems with :mod:`curses` support, a new " +"interactive shell is used by default. This one supports color, multiline " +"editing, history browsing, and paste mode. To disable color, see " +":ref:`using-on-controlling-color` for details. Function keys provide some " +"additional functionality. :kbd:`F1` enters the interactive help browser " +":mod:`pydoc`. :kbd:`F2` allows for browsing command-line history with " +"neither output nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters" +" \"paste mode\", which makes pasting larger blocks of code easier. Press " +":kbd:`F3` to return to the regular prompt." msgstr "" +"در ویندوز یا سیستم‌های شبه یونیکس با پشتیبانی از :mod:`curses`، به طور " +"پیش‌فرض از یک پوسته تعاملی جدید استفاده می‌شود. این یکی از رنگ‌ها، ویرایش " +"چند خطی، مرور تاریخ و حالت چسباندن پشتیبانی می‌کند. برای غیرفعال کردن رنگ، " +"برای جزئیات بیشتر به :ref:`using-on-controlling-color` مراجعه کنید. کلیدهای" +" عملکرد برخی از عملکردهای اضافی را ارائه می دهند. :kbd:`F1` وارد مرورگر کمک " +"تعاملی :mod:`pydoc` می شود. :kbd:`F2` امکان مرور تاریخچه خط فرمان را بدون " +"خروجی و فرمان های :term:`>>>` و :term:`...` فراهم می کند. :kbd:`F3` وارد " +"\"حالت چسباندن\" می شود که چسباندن بلوک های بزرگتر کد را آسان تر می کند. " +"برای بازگشت به دستور معمولی, :kbd:`F3` را فشار دهید." #: tutorial/appendix.rst:28 -msgid "When using the new interactive shell, exit the shell by typing :kbd:`exit` or :kbd:`quit`. Adding call parentheses after those commands is not required." +#, fuzzy +msgid "" +"When using the new interactive shell, exit the shell by typing :kbd:`exit` " +"or :kbd:`quit`. Adding call parentheses after those commands is not " +"required." msgstr "" +"هنگام استفاده از پوسته تعاملی جدید، با تایپ :kbd:`exit` یا :kbd:`quit` از " +"پوسته خارج شوید. اضافه کردن پرانتز تماس بعد از آن دستورات لازم نیست." #: tutorial/appendix.rst:32 -msgid "If the new interactive shell is not desired, it can be disabled via the :envvar:`PYTHON_BASIC_REPL` environment variable." +#, fuzzy +msgid "" +"If the new interactive shell is not desired, it can be disabled via the " +":envvar:`PYTHON_BASIC_REPL` environment variable." msgstr "" +"اگر پوسته تعاملی جدید مورد نظر نباشد، می توان آن را از طریق متغیر محیطی " +":envvar:`PYTHON_BASIC_REPL` غیرفعال کرد." #: tutorial/appendix.rst:38 +#, fuzzy msgid "Error Handling" -msgstr "" +msgstr "رسیدگی به خطا" #: tutorial/appendix.rst:40 -msgid "When an error occurs, the interpreter prints an error message and a stack trace. In interactive mode, it then returns to the primary prompt; when input came from a file, it exits with a nonzero exit status after printing the stack trace. (Exceptions handled by an :keyword:`except` clause in a :keyword:`try` statement are not errors in this context.) Some errors are unconditionally fatal and cause an exit with a nonzero exit status; this applies to internal inconsistencies and some cases of running out of memory. All error messages are written to the standard error stream; normal output from executed commands is written to standard output." +#, fuzzy +msgid "" +"When an error occurs, the interpreter prints an error message and a stack " +"trace. In interactive mode, it then returns to the primary prompt; when " +"input came from a file, it exits with a nonzero exit status after printing " +"the stack trace. (Exceptions handled by an :keyword:`except` clause in a " +":keyword:`try` statement are not errors in this context.) Some errors are " +"unconditionally fatal and cause an exit with a nonzero exit status; this " +"applies to internal inconsistencies and some cases of running out of memory." +" All error messages are written to the standard error stream; normal output" +" from executed commands is written to standard output." msgstr "" +"هنگامی که یک خطا رخ می دهد، مترجم یک پیام خطا و یک ردیابی پشته را چاپ می " +"کند. در حالت تعاملی، سپس به اعلان اولیه باز می گردد. هنگامی که ورودی از یک " +"فایل می آید، پس از چاپ ردیابی پشته، با وضعیت خروج غیر صفر خارج می شود. " +"(استثناهایی که توسط یک بند :keyword:`except` در دستور :keyword:`try` استفاده" +" می شود, در این زمینه خطا نیستند.) برخی از خطاها بدون قید و شرط کشنده هستند " +"و باعث خروجی با وضعیت خروج غیر صفر می شوند. این در مورد ناهماهنگی های داخلی " +"و برخی موارد تمام شدن حافظه صدق می کند. همه پیام های خطا در جریان خطای " +"استاندارد نوشته می شوند. خروجی عادی از دستورات اجرا شده در خروجی استاندارد " +"نوشته می شود." #: tutorial/appendix.rst:50 -msgid "Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) to the primary or secondary prompt cancels the input and returns to the primary prompt. [#]_ Typing an interrupt while a command is executing raises the :exc:`KeyboardInterrupt` exception, which may be handled by a :keyword:`try` statement." +#, fuzzy +msgid "" +"Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) " +"to the primary or secondary prompt cancels the input and returns to the " +"primary prompt. [#]_ Typing an interrupt while a command is executing raises" +" the :exc:`KeyboardInterrupt` exception, which may be handled by a " +":keyword:`try` statement." msgstr "" +"تایپ کاراکتر وقفه (معمولا :kbd:`Control-C` یا :kbd:`Delete`) در اعلان اولیه " +"یا ثانویه، ورودی را لغو می کند و به اعلان اصلی باز می گردد. [#]_ تایپ یک " +"وقفه در حین اجرای فرمان، استثناء :exc:`KeyboardInterrupt` را افزایش می‌دهد، " +"که ممکن است توسط یک دستور :keyword:`try` مدیریت شود." #: tutorial/appendix.rst:60 +#, fuzzy msgid "Executable Python Scripts" -msgstr "" +msgstr "اسکریپت های اجرایی پایتون" #: tutorial/appendix.rst:62 -msgid "On BSD'ish Unix systems, Python scripts can be made directly executable, like shell scripts, by putting the line ::" +#, fuzzy +msgid "" +"On BSD'ish Unix systems, Python scripts can be made directly executable, " +"like shell scripts, by putting the line ::" msgstr "" +"در سیستم‌های BSD'ish Unix، اسکریپت‌های پایتون را می‌توان مستقیماً مانند " +"اسکریپت‌های پوسته با قرار دادن خط :: قابل اجرا ساخت." #: tutorial/appendix.rst:65 +#, fuzzy msgid "#!/usr/bin/env python3" -msgstr "" +msgstr "#!/usr/bin/env python3" #: tutorial/appendix.rst:67 -msgid "(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning of the script and giving the file an executable mode. The ``#!`` must be the first two characters of the file. On some platforms, this first line must end with a Unix-style line ending (``'\\n'``), not a Windows (``'\\r\\n'``) line ending. Note that the hash, or pound, character, ``'#'``, is used to start a comment in Python." +#, fuzzy +msgid "" +"(assuming that the interpreter is on the user's :envvar:`PATH`) at the " +"beginning of the script and giving the file an executable mode. The ``#!`` " +"must be the first two characters of the file. On some platforms, this first" +" line must end with a Unix-style line ending (``'\\n'``), not a Windows " +"(``'\\r\\n'``) line ending. Note that the hash, or pound, character, " +"``'#'``, is used to start a comment in Python." msgstr "" +"(با فرض اینکه مفسر روی :envvar:`PATH` کاربر باشد) در ابتدای اسکریپت و دادن " +"حالت اجرایی به فایل. ``#!`` باید دو کاراکتر اول فایل باشد. در برخی از " +"پلتفرم‌ها، این خط اول باید با پایان خط به سبک یونیکس (``'\\n'``) به پایان " +"برسد، نه پایان خط ویندوز (``'\\r\\n'``). توجه داشته باشید که کاراکتر هش یا " +"پوند، ``'#'``، برای شروع یک نظر در پایتون استفاده می شود." #: tutorial/appendix.rst:74 -msgid "The script can be given an executable mode, or permission, using the :program:`chmod` command." +#, fuzzy +msgid "" +"The script can be given an executable mode, or permission, using the " +":program:`chmod` command." msgstr "" +"با استفاده از دستور :program:`chmod` می توان به اسکریپت یک حالت اجرایی یا " +"مجوز داد." #: tutorial/appendix.rst:77 +#, fuzzy msgid "$ chmod +x myscript.py" -msgstr "" +msgstr "$ chmod +x myscript.py" #: tutorial/appendix.rst:81 -msgid "On Windows systems, there is no notion of an \"executable mode\". The Python installer automatically associates ``.py`` files with ``python.exe`` so that a double-click on a Python file will run it as a script. The extension can also be ``.pyw``, in that case, the console window that normally appears is suppressed." +#, fuzzy +msgid "" +"On Windows systems, there is no notion of an \"executable mode\". The " +"Python installer automatically associates ``.py`` files with ``python.exe`` " +"so that a double-click on a Python file will run it as a script. The " +"extension can also be ``.pyw``, in that case, the console window that " +"normally appears is suppressed." msgstr "" +"در سیستم های ویندوز، هیچ مفهومی از \"حالت اجرایی\" وجود ندارد. نصب‌کننده " +"پایتون به‌طور خودکار فایل‌های ``.py`` را با ``python.exe`` مرتبط می‌کند تا " +"با دوبار کلیک کردن روی فایل پایتون آن را به‌عنوان یک اسکریپت اجرا کند. " +"پسوند همچنین می تواند ``.pyw`` باشد، در این صورت، پنجره کنسولی که به طور " +"معمول ظاهر می شود، سرکوب می شود." #: tutorial/appendix.rst:91 +#, fuzzy msgid "The Interactive Startup File" -msgstr "" +msgstr "فایل راه اندازی تعاملی" #: tutorial/appendix.rst:93 -msgid "When you use Python interactively, it is frequently handy to have some standard commands executed every time the interpreter is started. You can do this by setting an environment variable named :envvar:`PYTHONSTARTUP` to the name of a file containing your start-up commands. This is similar to the :file:`.profile` feature of the Unix shells." +#, fuzzy +msgid "" +"When you use Python interactively, it is frequently handy to have some " +"standard commands executed every time the interpreter is started. You can " +"do this by setting an environment variable named :envvar:`PYTHONSTARTUP` to " +"the name of a file containing your start-up commands. This is similar to " +"the :file:`.profile` feature of the Unix shells." msgstr "" +"هنگامی که از پایتون به صورت تعاملی استفاده می کنید، هر بار که مفسر شروع می " +"شود، اجرای برخی از دستورات استاندارد اغلب مفید است. شما می توانید این کار " +"را با تنظیم یک متغیر محیطی به نام :envvar:`PYTHONSTARTUP` به نام فایل حاوی " +"دستورات راه اندازی انجام دهید. این شبیه به ویژگی :file:`.profile` پوسته های" +" یونیکس است." #: tutorial/appendix.rst:99 -msgid "This file is only read in interactive sessions, not when Python reads commands from a script, and not when :file:`/dev/tty` is given as the explicit source of commands (which otherwise behaves like an interactive session). It is executed in the same namespace where interactive commands are executed, so that objects that it defines or imports can be used without qualification in the interactive session. You can also change the prompts ``sys.ps1`` and ``sys.ps2`` in this file." +#, fuzzy +msgid "" +"This file is only read in interactive sessions, not when Python reads " +"commands from a script, and not when :file:`/dev/tty` is given as the " +"explicit source of commands (which otherwise behaves like an interactive " +"session). It is executed in the same namespace where interactive commands " +"are executed, so that objects that it defines or imports can be used without" +" qualification in the interactive session. You can also change the prompts " +"``sys.ps1`` and ``sys.ps2`` in this file." msgstr "" +"این فایل فقط در جلسات تعاملی خوانده می شود، نه زمانی که پایتون دستورات را از" +" یک اسکریپت می خواند، و نه زمانی که :file:`/dev/tty` به عنوان منبع صریح " +"دستورات داده می شود (که در غیر این صورت مانند یک جلسه تعاملی رفتار می کند)." +" در همان فضای نامی که دستورات تعاملی اجرا می‌شوند اجرا می‌شود، به طوری که " +"اشیایی را که تعریف می‌کند یا وارد می‌کند، می‌توانند بدون صلاحیت در جلسه " +"تعاملی استفاده شوند. همچنین می توانید دستورات ``sys.ps1`` و ``sys.ps2`` را " +"در این فایل تغییر دهید." #: tutorial/appendix.rst:107 -msgid "If you want to read an additional start-up file from the current directory, you can program this in the global start-up file using code like ``if os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you want to use the startup file in a script, you must do this explicitly in the script::" +#, fuzzy +msgid "" +"If you want to read an additional start-up file from the current directory, " +"you can program this in the global start-up file using code like ``if " +"os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you " +"want to use the startup file in a script, you must do this explicitly in the" +" script::" msgstr "" +"اگر می‌خواهید یک فایل راه‌اندازی اضافی را از دایرکتوری فعلی بخوانید، " +"می‌توانید آن را در فایل راه‌اندازی جهانی با استفاده از کدهایی مانند ``if " +"os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())`` " +"برنامه‌ریزی کنید. اگر می خواهید از فایل راه اندازی در یک اسکریپت استفاده " +"کنید، باید این کار را به صراحت در اسکریپت انجام دهید:" #: tutorial/appendix.rst:113 -msgid "import os\n" +#, fuzzy +msgid "" +"import os\n" "filename = os.environ.get('PYTHONSTARTUP')\n" "if filename and os.path.isfile(filename):\n" " with open(filename) as fobj:\n" " startup_file = fobj.read()\n" " exec(startup_file)" msgstr "" +"import os\n" +"filename = os.environ.get('PYTHONSTARTUP')\n" +"if filename and os.path.isfile(filename):\n" +" with open(filename) as fobj:\n" +" startup_file = fobj.read()\n" +" exec(startup_file)" #: tutorial/appendix.rst:124 +#, fuzzy msgid "The Customization Modules" -msgstr "" +msgstr "ماژول های سفارشی سازی" #: tutorial/appendix.rst:126 -msgid "Python provides two hooks to let you customize it: :index:`sitecustomize` and :index:`usercustomize`. To see how it works, you need first to find the location of your user site-packages directory. Start Python and run this code::" +#, fuzzy +msgid "" +"Python provides two hooks to let you customize it: :index:`sitecustomize` " +"and :index:`usercustomize`. To see how it works, you need first to find the" +" location of your user site-packages directory. Start Python and run this " +"code::" msgstr "" +"پایتون دو قلاب برای سفارشی کردن آن فراهم می کند: :index:`sitecustomize` و " +":index:`usercustomize`. برای اینکه ببینید چگونه کار می‌کند، ابتدا باید مکان " +"فهرست بسته‌های سایت کاربر خود را پیدا کنید. پایتون را راه اندازی کنید و این" +" کد را اجرا کنید:" #: tutorial/appendix.rst:130 -msgid ">>> import site\n" +#, fuzzy +msgid "" +">>> import site\n" ">>> site.getusersitepackages()\n" "'/home/user/.local/lib/python3.x/site-packages'" msgstr "" +">>> import site\n" +">>> site.getusersitepackages()\n" +"'/home/user/.local/lib/python3.x/site-packages'" #: tutorial/appendix.rst:134 -msgid "Now you can create a file named :file:`usercustomize.py` in that directory and put anything you want in it. It will affect every invocation of Python, unless it is started with the :option:`-s` option to disable the automatic import." +#, fuzzy +msgid "" +"Now you can create a file named :file:`usercustomize.py` in that directory " +"and put anything you want in it. It will affect every invocation of Python," +" unless it is started with the :option:`-s` option to disable the automatic " +"import." msgstr "" +"حالا می توانید یک فایل به نام :file:`usercustomize.py` در آن دایرکتوری ایجاد" +" کنید و هر چیزی را که می خواهید در آن قرار دهید. هر فراخوانی پایتون را تحت " +"تأثیر قرار می دهد، مگر اینکه با گزینه :option:`-s` شروع شود تا واردات خودکار" +" غیرفعال شود." #: tutorial/appendix.rst:138 -msgid ":index:`sitecustomize` works in the same way, but is typically created by an administrator of the computer in the global site-packages directory, and is imported before :index:`usercustomize`. See the documentation of the :mod:`site` module for more details." +#, fuzzy +msgid "" +":index:`sitecustomize` works in the same way, but is typically created by an" +" administrator of the computer in the global site-packages directory, and is" +" imported before :index:`usercustomize`. See the documentation of the " +":mod:`site` module for more details." msgstr "" +":index:`sitecustomize` به همین روش کار می‌کند، اما معمولاً توسط یک مدیر " +"رایانه در فهرست جهانی بسته‌های سایت ایجاد می‌شود و قبل از " +":index:`usercustomize` وارد می‌شود. برای جزئیات بیشتر به مستندات ماژول " +":mod:`site` مراجعه کنید." #: tutorial/appendix.rst:145 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/appendix.rst:146 +#, fuzzy msgid "A problem with the GNU Readline package may prevent this." -msgstr "" +msgstr "یک مشکل در بسته Readline گنو ممکن است از این امر جلوگیری کند." diff --git a/tutorial/appetite.po b/tutorial/appetite.po index 259939ed..767f8888 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -17,69 +17,217 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/appetite.rst:5 +#, fuzzy msgid "Whetting Your Appetite" -msgstr "" +msgstr "باز کردن اشتهای شما" #: tutorial/appetite.rst:7 -msgid "If you do much work on computers, eventually you find that there's some task you'd like to automate. For example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bunch of photo files in a complicated way. Perhaps you'd like to write a small custom database, or a specialized GUI application, or a simple game." -msgstr "" +#, fuzzy +msgid "" +"If you do much work on computers, eventually you find that there's some task" +" you'd like to automate. For example, you may wish to perform a search-and-" +"replace over a large number of text files, or rename and rearrange a bunch " +"of photo files in a complicated way. Perhaps you'd like to write a small " +"custom database, or a specialized GUI application, or a simple game." +msgstr "" +"اگر کار زیادی روی رایانه انجام می‌دهید، در نهایت متوجه می‌شوید که کاری وجود " +"دارد که می‌خواهید آن را خودکار کنید. به عنوان مثال، ممکن است بخواهید روی " +"تعداد زیادی فایل متنی جستجو و جایگزینی انجام دهید، یا دسته ای از فایل های " +"عکس را به روشی پیچیده تغییر نام داده و مرتب کنید. شاید بخواهید یک پایگاه " +"داده سفارشی کوچک، یا یک برنامه رابط کاربری گرافیکی تخصصی، یا یک بازی ساده " +"بنویسید." #: tutorial/appetite.rst:13 -msgid "If you're a professional software developer, you may have to work with several C/C++/Java libraries but find the usual write/compile/test/re-compile cycle is too slow. Perhaps you're writing a test suite for such a library and find writing the testing code a tedious task. Or maybe you've written a program that could use an extension language, and you don't want to design and implement a whole new language for your application." -msgstr "" +#, fuzzy +msgid "" +"If you're a professional software developer, you may have to work with " +"several C/C++/Java libraries but find the usual write/compile/test/re-" +"compile cycle is too slow. Perhaps you're writing a test suite for such a " +"library and find writing the testing code a tedious task. Or maybe you've " +"written a program that could use an extension language, and you don't want " +"to design and implement a whole new language for your application." +msgstr "" +"اگر یک توسعه‌دهنده نرم‌افزار حرفه‌ای هستید، ممکن است مجبور شوید با چندین " +"کتابخانه C/C++/Java کار کنید، اما دریابید که چرخه معمول " +"نوشتن/کامپایل/تست/کامپایل مجدد بسیار کند است. شاید شما در حال نوشتن یک " +"مجموعه آزمایشی برای چنین کتابخانه ای هستید و نوشتن کد تست را کاری خسته کننده" +" می دانید. یا شاید برنامه‌ای نوشته‌اید که می‌تواند از یک زبان افزونه " +"استفاده کند و نمی‌خواهید یک زبان کاملاً جدید برای برنامه خود طراحی و " +"پیاده‌سازی کنید." #: tutorial/appetite.rst:20 +#, fuzzy msgid "Python is just the language for you." -msgstr "" +msgstr "پایتون فقط زبان شماست." #: tutorial/appetite.rst:22 -msgid "You could write a Unix shell script or Windows batch files for some of these tasks, but shell scripts are best at moving around files and changing text data, not well-suited for GUI applications or games. You could write a C/C++/Java program, but it can take a lot of development time to get even a first-draft program. Python is simpler to use, available on Windows, macOS, and Unix operating systems, and will help you get the job done more quickly." -msgstr "" +#, fuzzy +msgid "" +"You could write a Unix shell script or Windows batch files for some of these" +" tasks, but shell scripts are best at moving around files and changing text " +"data, not well-suited for GUI applications or games. You could write a " +"C/C++/Java program, but it can take a lot of development time to get even a " +"first-draft program. Python is simpler to use, available on Windows, macOS," +" and Unix operating systems, and will help you get the job done more " +"quickly." +msgstr "" +"می‌توانید برای برخی از این کارها یک اسکریپت پوسته یونیکس یا فایل‌های دسته‌ای" +" ویندوز بنویسید، اما اسکریپت‌های پوسته در جابجایی فایل‌ها و تغییر داده‌های " +"متنی بهترین هستند و برای برنامه‌های رابط کاربری گرافیکی یا بازی‌ها مناسب " +"نیستند. شما می توانید یک برنامه C/C++/Java بنویسید، اما ممکن است زمان زیادی " +"برای توسعه نیاز باشد تا حتی یک برنامه پیش نویس اول را دریافت کنید. استفاده " +"از Python ساده‌تر است و در سیستم‌عامل‌های Windows، macOS و Unix موجود است و " +"به شما کمک می‌کند کار را سریع‌تر انجام دهید." #: tutorial/appetite.rst:29 -msgid "Python is simple to use, but it is a real programming language, offering much more structure and support for large programs than shell scripts or batch files can offer. On the other hand, Python also offers much more error checking than C, and, being a *very-high-level language*, it has high-level data types built in, such as flexible arrays and dictionaries. Because of its more general data types Python is applicable to a much larger problem domain than Awk or even Perl, yet many things are at least as easy in Python as in those languages." -msgstr "" +#, fuzzy +msgid "" +"Python is simple to use, but it is a real programming language, offering " +"much more structure and support for large programs than shell scripts or " +"batch files can offer. On the other hand, Python also offers much more " +"error checking than C, and, being a *very-high-level language*, it has high-" +"level data types built in, such as flexible arrays and dictionaries. " +"Because of its more general data types Python is applicable to a much larger" +" problem domain than Awk or even Perl, yet many things are at least as easy " +"in Python as in those languages." +msgstr "" +"استفاده از پایتون ساده است، اما یک زبان برنامه نویسی واقعی است که ساختار و " +"پشتیبانی بسیار بیشتری از برنامه های بزرگ را نسبت به اسکریپت های پوسته یا " +"فایل های دسته ای ارائه می دهد. از سوی دیگر، پایتون نیز بررسی خطای بسیار " +"بیشتری را نسبت به C ارائه می‌کند، و با توجه به *very-high-level language*، " +"انواع داده‌های سطح بالایی مانند آرایه‌های انعطاف‌پذیر و دیکشنری‌ها را در خود" +" جای داده است. به دلیل انواع داده‌های عمومی‌تر، پایتون برای یک دامنه مشکل " +"بسیار بزرگ‌تر از Awk یا حتی Perl قابل استفاده است، اما بسیاری از کارها حداقل" +" در پایتون به آسانی آن زبان‌ها هستند." #: tutorial/appetite.rst:37 -msgid "Python allows you to split your program into modules that can be reused in other Python programs. It comes with a large collection of standard modules that you can use as the basis of your programs --- or as examples to start learning to program in Python. Some of these modules provide things like file I/O, system calls, sockets, and even interfaces to graphical user interface toolkits like Tk." -msgstr "" +#, fuzzy +msgid "" +"Python allows you to split your program into modules that can be reused in " +"other Python programs. It comes with a large collection of standard modules" +" that you can use as the basis of your programs --- or as examples to start " +"learning to program in Python. Some of these modules provide things like " +"file I/O, system calls, sockets, and even interfaces to graphical user " +"interface toolkits like Tk." +msgstr "" +"پایتون به شما این امکان را می دهد که برنامه خود را به ماژول هایی تقسیم کنید " +"که می توانند در سایر برنامه های پایتون مورد استفاده مجدد قرار گیرند. همراه " +"با مجموعه بزرگی از ماژول های استاندارد است که می توانید از آنها به عنوان " +"پایه برنامه های خود --- یا به عنوان مثال برای شروع یادگیری برنامه نویسی در " +"پایتون استفاده کنید. برخی از این ماژول‌ها مواردی مانند ورودی/خروجی فایل، " +"تماس‌های سیستمی، سوکت‌ها و حتی رابط‌هایی را برای جعبه‌ابزارهای رابط کاربری " +"گرافیکی مانند Tk فراهم می‌کنند." #: tutorial/appetite.rst:44 -msgid "Python is an interpreted language, which can save you considerable time during program development because no compilation and linking is necessary. The interpreter can be used interactively, which makes it easy to experiment with features of the language, to write throw-away programs, or to test functions during bottom-up program development. It is also a handy desk calculator." -msgstr "" +#, fuzzy +msgid "" +"Python is an interpreted language, which can save you considerable time " +"during program development because no compilation and linking is necessary." +" The interpreter can be used interactively, which makes it easy to " +"experiment with features of the language, to write throw-away programs, or " +"to test functions during bottom-up program development. It is also a handy " +"desk calculator." +msgstr "" +"پایتون یک زبان تفسیری است که می تواند زمان قابل توجهی را در طول توسعه برنامه" +" صرفه جویی کند زیرا نیازی به کامپایل و پیوند نیست. مفسر را می توان به صورت " +"تعاملی مورد استفاده قرار داد، که آزمایش با ویژگی های زبان، نوشتن برنامه های " +"دور ریختنی، یا آزمایش توابع در طول توسعه برنامه از پایین به بالا را آسان می " +"کند. همچنین یک ماشین حساب میز کار مفید است." #: tutorial/appetite.rst:50 -msgid "Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, C++, or Java programs, for several reasons:" +#, fuzzy +msgid "" +"Python enables programs to be written compactly and readably. Programs " +"written in Python are typically much shorter than equivalent C, C++, or " +"Java programs, for several reasons:" msgstr "" +"پایتون برنامه ها را قادر می سازد تا به صورت فشرده و خوانا نوشته شوند. " +"برنامه های نوشته شده در پایتون معمولاً به چند دلیل بسیار کوتاه تر از برنامه " +"های C، C++ یا جاوا هستند:" #: tutorial/appetite.rst:54 -msgid "the high-level data types allow you to express complex operations in a single statement;" +#, fuzzy +msgid "" +"the high-level data types allow you to express complex operations in a " +"single statement;" msgstr "" +"انواع داده های سطح بالا به شما امکان می دهند عملیات پیچیده را در یک عبارت " +"واحد بیان کنید." #: tutorial/appetite.rst:57 -msgid "statement grouping is done by indentation instead of beginning and ending brackets;" +#, fuzzy +msgid "" +"statement grouping is done by indentation instead of beginning and ending " +"brackets;" msgstr "" +"گروه بندی بیانیه به جای پرانتزهای آغاز و پایان با تورفتگی انجام می شود." #: tutorial/appetite.rst:60 +#, fuzzy msgid "no variable or argument declarations are necessary." -msgstr "" +msgstr "هیچ تعریف متغیر یا آرگومانی لازم نیست." #: tutorial/appetite.rst:62 -msgid "Python is *extensible*: if you know how to program in C it is easy to add a new built-in function or module to the interpreter, either to perform critical operations at maximum speed, or to link Python programs to libraries that may only be available in binary form (such as a vendor-specific graphics library). Once you are really hooked, you can link the Python interpreter into an application written in C and use it as an extension or command language for that application." -msgstr "" +#, fuzzy +msgid "" +"Python is *extensible*: if you know how to program in C it is easy to add a " +"new built-in function or module to the interpreter, either to perform " +"critical operations at maximum speed, or to link Python programs to " +"libraries that may only be available in binary form (such as a vendor-" +"specific graphics library). Once you are really hooked, you can link the " +"Python interpreter into an application written in C and use it as an " +"extension or command language for that application." +msgstr "" +"پایتون *extensible* است: اگر می‌دانید چگونه به زبان C برنامه‌نویسی کنید، به " +"راحتی می‌توانید یک تابع یا ماژول داخلی جدید را به مفسر اضافه کنید، یا برای " +"انجام عملیات حیاتی با حداکثر سرعت، یا پیوند دادن برنامه‌های پایتون به " +"کتابخانه‌هایی که ممکن است فقط به صورت باینری در دسترس باشند (مانند یک " +"کتابخانه گرافیکی خاص فروشنده). هنگامی که واقعاً قلاب شدید، می‌توانید مفسر " +"پایتون را به برنامه‌ای که به زبان C نوشته شده است پیوند دهید و از آن به " +"عنوان یک برنامه افزودنی یا زبان دستوری برای آن برنامه استفاده کنید." #: tutorial/appetite.rst:70 -msgid "By the way, the language is named after the BBC show \"Monty Python's Flying Circus\" and has nothing to do with reptiles. Making references to Monty Python skits in documentation is not only allowed, it is encouraged!" +#, fuzzy +msgid "" +"By the way, the language is named after the BBC show \"Monty Python's Flying" +" Circus\" and has nothing to do with reptiles. Making references to Monty " +"Python skits in documentation is not only allowed, it is encouraged!" msgstr "" +"به هر حال، نام این زبان از برنامه بی بی سی \"سیرک پرنده مونتی پایتون\" گرفته" +" شده است و ربطی به خزندگان ندارد. ارجاع به اسکیت های مونتی پایتون در اسناد " +"نه تنها مجاز است، بلکه تشویق می شود!" #: tutorial/appetite.rst:74 -msgid "Now that you are all excited about Python, you'll want to examine it in some more detail. Since the best way to learn a language is to use it, the tutorial invites you to play with the Python interpreter as you read." +#, fuzzy +msgid "" +"Now that you are all excited about Python, you'll want to examine it in some" +" more detail. Since the best way to learn a language is to use it, the " +"tutorial invites you to play with the Python interpreter as you read." msgstr "" +"اکنون که همه شما در مورد پایتون هیجان زده اید، می خواهید آن را با جزئیات " +"بیشتری بررسی کنید. از آنجایی که بهترین راه برای یادگیری زبان استفاده از آن " +"است، این آموزش از شما دعوت می کند که در حین خواندن با مفسر پایتون بازی کنید." #: tutorial/appetite.rst:78 -msgid "In the next chapter, the mechanics of using the interpreter are explained. This is rather mundane information, but essential for trying out the examples shown later." +#, fuzzy +msgid "" +"In the next chapter, the mechanics of using the interpreter are explained. " +"This is rather mundane information, but essential for trying out the " +"examples shown later." msgstr "" +"در فصل بعد مکانیزم استفاده از مفسر توضیح داده شده است. این اطلاعات نسبتا " +"پیش پا افتاده است، اما برای آزمایش نمونه هایی که بعدا نشان داده شده است " +"ضروری است." #: tutorial/appetite.rst:82 -msgid "The rest of the tutorial introduces various features of the Python language and system through examples, beginning with simple expressions, statements and data types, through functions and modules, and finally touching upon advanced concepts like exceptions and user-defined classes." -msgstr "" +#, fuzzy +msgid "" +"The rest of the tutorial introduces various features of the Python language " +"and system through examples, beginning with simple expressions, statements " +"and data types, through functions and modules, and finally touching upon " +"advanced concepts like exceptions and user-defined classes." +msgstr "" +"ادامه آموزش ویژگی‌های مختلف زبان و سیستم پایتون را از طریق مثال‌ها معرفی " +"می‌کند، با عبارات ساده، عبارات و انواع داده‌ها، از طریق توابع و ماژول‌ها " +"شروع می‌شود و در نهایت به مفاهیم پیشرفته مانند استثناها و کلاس‌های تعریف‌شده" +" توسط کاربر اشاره می‌کند." diff --git a/tutorial/classes.po b/tutorial/classes.po index edea8840..20f834eb 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -17,119 +17,399 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/classes.rst:5 +#, fuzzy msgid "Classes" -msgstr "" +msgstr "کلاس ها" #: tutorial/classes.rst:7 -msgid "Classes provide a means of bundling data and functionality together. Creating a new class creates a new *type* of object, allowing new *instances* of that type to be made. Each class instance can have attributes attached to it for maintaining its state. Class instances can also have methods (defined by its class) for modifying its state." -msgstr "" +#, fuzzy +msgid "" +"Classes provide a means of bundling data and functionality together. " +"Creating a new class creates a new *type* of object, allowing new " +"*instances* of that type to be made. Each class instance can have " +"attributes attached to it for maintaining its state. Class instances can " +"also have methods (defined by its class) for modifying its state." +msgstr "" +"کلاس‌ها وسیله‌ای برای جمع‌کردن داده‌ها و عملکرد با هم فراهم می‌کنند. ایجاد " +"یک کلاس جدید، یک شیء *type* جدید ایجاد می کند، که اجازه می دهد *instances* " +"جدید از آن نوع ساخته شود. هر نمونه کلاس می تواند ویژگی هایی را برای حفظ " +"حالت خود به آن متصل کند. نمونه‌های کلاس همچنین می‌توانند متدهایی (که توسط " +"کلاس آن تعریف می‌شوند) برای تغییر حالت آن داشته باشند." #: tutorial/classes.rst:13 -msgid "Compared with other programming languages, Python's class mechanism adds classes with a minimum of new syntax and semantics. It is a mixture of the class mechanisms found in C++ and Modula-3. Python classes provide all the standard features of Object Oriented Programming: the class inheritance mechanism allows multiple base classes, a derived class can override any methods of its base class or classes, and a method can call the method of a base class with the same name. Objects can contain arbitrary amounts and kinds of data. As is true for modules, classes partake of the dynamic nature of Python: they are created at runtime, and can be modified further after creation." -msgstr "" +#, fuzzy +msgid "" +"Compared with other programming languages, Python's class mechanism adds " +"classes with a minimum of new syntax and semantics. It is a mixture of the " +"class mechanisms found in C++ and Modula-3. Python classes provide all the " +"standard features of Object Oriented Programming: the class inheritance " +"mechanism allows multiple base classes, a derived class can override any " +"methods of its base class or classes, and a method can call the method of a " +"base class with the same name. Objects can contain arbitrary amounts and " +"kinds of data. As is true for modules, classes partake of the dynamic " +"nature of Python: they are created at runtime, and can be modified further " +"after creation." +msgstr "" +"در مقایسه با سایر زبان‌های برنامه‌نویسی، مکانیسم کلاس پایتون کلاس‌هایی را با" +" حداقل نحو و معنای جدید اضافه می‌کند. این ترکیبی از مکانیسم‌های کلاس موجود " +"در C++ و Modula-3 است. کلاس‌های پایتون تمام ویژگی‌های استاندارد " +"برنامه‌نویسی شی‌گرا را ارائه می‌کنند: مکانیسم وراثت کلاس به چندین کلاس پایه " +"اجازه می‌دهد، یک کلاس مشتق شده می‌تواند هر روشی از کلاس یا کلاس‌های پایه خود" +" را لغو کند، و یک متد می‌تواند متد یک کلاس پایه را با همان نام فراخوانی کند." +" اشیاء می توانند حاوی مقادیر دلخواه و انواع داده باشند. همانطور که برای " +"ماژول ها صدق می کند، کلاس ها از ماهیت پویای پایتون سهیم هستند: آنها در زمان " +"اجرا ایجاد می شوند و می توانند بعد از ایجاد تغییرات بیشتری داشته باشند." #: tutorial/classes.rst:23 -msgid "In C++ terminology, normally class members (including the data members) are *public* (except see below :ref:`tut-private`), and all member functions are *virtual*. As in Modula-3, there are no shorthands for referencing the object's members from its methods: the method function is declared with an explicit first argument representing the object, which is provided implicitly by the call. As in Smalltalk, classes themselves are objects. This provides semantics for importing and renaming. Unlike C++ and Modula-3, built-in types can be used as base classes for extension by the user. Also, like in C++, most built-in operators with special syntax (arithmetic operators, subscripting etc.) can be redefined for class instances." -msgstr "" +#, fuzzy +msgid "" +"In C++ terminology, normally class members (including the data members) are " +"*public* (except see below :ref:`tut-private`), and all member functions are" +" *virtual*. As in Modula-3, there are no shorthands for referencing the " +"object's members from its methods: the method function is declared with an " +"explicit first argument representing the object, which is provided " +"implicitly by the call. As in Smalltalk, classes themselves are objects. " +"This provides semantics for importing and renaming. Unlike C++ and " +"Modula-3, built-in types can be used as base classes for extension by the " +"user. Also, like in C++, most built-in operators with special syntax " +"(arithmetic operators, subscripting etc.) can be redefined for class " +"instances." +msgstr "" +"در اصطلاحات C++، معمولاً اعضای کلاس (شامل اعضای داده) *public* هستند (به جز " +"نگاه کنید به زیر :ref:`tut-private`), و همه توابع عضو *virtual* هستند. " +"همانطور که در Modula-3، هیچ کوتاه نویسی برای ارجاع اعضای شی از متدهای آن " +"وجود ندارد: تابع متد با اولین آرگومان صریح که نشان دهنده شیء است، اعلام می " +"شود که به طور ضمنی توسط فراخوانی ارائه می شود. همانطور که در Smalltalk، " +"کلاس ها خود شی هستند. این امر معنایی را برای وارد کردن و تغییر نام فراهم می" +" کند. برخلاف C++ و Modula-3، انواع داخلی می توانند به عنوان کلاس های پایه " +"برای توسعه توسط کاربر استفاده شوند. همچنین، مانند C++، اکثر عملگرهای داخلی " +"با نحو خاص (عملگرهای حسابی, اشتراک و غیره) می‌توانند برای نمونه‌های کلاس " +"دوباره تعریف شوند." #: tutorial/classes.rst:34 -msgid "(Lacking universally accepted terminology to talk about classes, I will make occasional use of Smalltalk and C++ terms. I would use Modula-3 terms, since its object-oriented semantics are closer to those of Python than C++, but I expect that few readers have heard of it.)" +#, fuzzy +msgid "" +"(Lacking universally accepted terminology to talk about classes, I will make" +" occasional use of Smalltalk and C++ terms. I would use Modula-3 terms, " +"since its object-oriented semantics are closer to those of Python than C++, " +"but I expect that few readers have heard of it.)" msgstr "" +"(به دلیل نداشتن اصطلاحات پذیرفته شده جهانی برای صحبت در مورد کلاس ها, من " +"گهگاه از اصطلاحات Smalltalk و C++ استفاده می کنم. از اصطلاحات Modula-3 " +"استفاده می کنم, زیرا معنایی شی گرا آن به زبان پایتون نزدیکتر از C++ است, اما" +" انتظار دارم که تعداد کمی از خوانندگان درباره آن چیزی شنیده باشند.)" #: tutorial/classes.rst:43 +#, fuzzy msgid "A Word About Names and Objects" -msgstr "" +msgstr "سخنی در مورد نام ها و اشیاء" #: tutorial/classes.rst:45 -msgid "Objects have individuality, and multiple names (in multiple scopes) can be bound to the same object. This is known as aliasing in other languages. This is usually not appreciated on a first glance at Python, and can be safely ignored when dealing with immutable basic types (numbers, strings, tuples). However, aliasing has a possibly surprising effect on the semantics of Python code involving mutable objects such as lists, dictionaries, and most other types. This is usually used to the benefit of the program, since aliases behave like pointers in some respects. For example, passing an object is cheap since only a pointer is passed by the implementation; and if a function modifies an object passed as an argument, the caller will see the change --- this eliminates the need for two different argument passing mechanisms as in Pascal." -msgstr "" +#, fuzzy +msgid "" +"Objects have individuality, and multiple names (in multiple scopes) can be " +"bound to the same object. This is known as aliasing in other languages. " +"This is usually not appreciated on a first glance at Python, and can be " +"safely ignored when dealing with immutable basic types (numbers, strings, " +"tuples). However, aliasing has a possibly surprising effect on the " +"semantics of Python code involving mutable objects such as lists, " +"dictionaries, and most other types. This is usually used to the benefit of " +"the program, since aliases behave like pointers in some respects. For " +"example, passing an object is cheap since only a pointer is passed by the " +"implementation; and if a function modifies an object passed as an argument, " +"the caller will see the change --- this eliminates the need for two " +"different argument passing mechanisms as in Pascal." +msgstr "" +"اشیاء دارای فردیت هستند و نام های متعدد (در حوزه های متعدد) را می توان به یک" +" شی محدود کرد. این در زبان های دیگر به نام مستعار شناخته می شود. معمولاً " +"در نگاه اول پایتون به این موضوع توجهی نمی‌شود، و می‌توان با خیال راحت از " +"انواع اولیه تغییرناپذیر (اعداد, رشته‌ها, تاپل‌ها) صرف نظر کرد. با این حال، " +"نام مستعار یک اثر احتمالاً شگفت‌انگیز بر معنایی کد پایتون شامل اشیاء قابل " +"تغییر مانند فهرست‌ها، دیکشنری‌ها و بسیاری از انواع دیگر دارد. این معمولاً به" +" نفع برنامه استفاده می شود، زیرا نام مستعار در برخی موارد مانند اشاره گر عمل" +" می کنند. به عنوان مثال، ارسال یک شی ارزان است زیرا تنها یک اشاره گر توسط " +"پیاده سازی ارسال می شود. و اگر تابعی شیء ارسال شده به عنوان آرگومان را تغییر" +" دهد، فراخواننده این تغییر را مشاهده خواهد کرد --- این امر نیاز به دو " +"مکانیسم مختلف ارسال آرگومان مانند پاسکال را از بین می برد." #: tutorial/classes.rst:61 +#, fuzzy msgid "Python Scopes and Namespaces" -msgstr "" +msgstr "دامنه ها و فضاهای نام پایتون" #: tutorial/classes.rst:63 -msgid "Before introducing classes, I first have to tell you something about Python's scope rules. Class definitions play some neat tricks with namespaces, and you need to know how scopes and namespaces work to fully understand what's going on. Incidentally, knowledge about this subject is useful for any advanced Python programmer." -msgstr "" +#, fuzzy +msgid "" +"Before introducing classes, I first have to tell you something about " +"Python's scope rules. Class definitions play some neat tricks with " +"namespaces, and you need to know how scopes and namespaces work to fully " +"understand what's going on. Incidentally, knowledge about this subject is " +"useful for any advanced Python programmer." +msgstr "" +"قبل از معرفی کلاس ها، ابتدا باید چیزی در مورد قوانین محدوده پایتون به شما " +"بگویم. تعاریف کلاس‌ها چند ترفند ساده با فضاهای نام بازی می‌کنند، و شما باید" +" بدانید که دامنه‌ها و فضاهای نام چگونه کار می‌کنند تا به طور کامل بفهمید که " +"چه اتفاقی می‌افتد. اتفاقاً دانش این موضوع برای هر برنامه نویس پیشرفته پایتون" +" مفید است." #: tutorial/classes.rst:69 +#, fuzzy msgid "Let's begin with some definitions." -msgstr "" +msgstr "بیایید با برخی از تعاریف شروع کنیم." #: tutorial/classes.rst:71 -msgid "A *namespace* is a mapping from names to objects. Most namespaces are currently implemented as Python dictionaries, but that's normally not noticeable in any way (except for performance), and it may change in the future. Examples of namespaces are: the set of built-in names (containing functions such as :func:`abs`, and built-in exception names); the global names in a module; and the local names in a function invocation. In a sense the set of attributes of an object also form a namespace. The important thing to know about namespaces is that there is absolutely no relation between names in different namespaces; for instance, two different modules may both define a function ``maximize`` without confusion --- users of the modules must prefix it with the module name." -msgstr "" +#, fuzzy +msgid "" +"A *namespace* is a mapping from names to objects. Most namespaces are " +"currently implemented as Python dictionaries, but that's normally not " +"noticeable in any way (except for performance), and it may change in the " +"future. Examples of namespaces are: the set of built-in names (containing " +"functions such as :func:`abs`, and built-in exception names); the global " +"names in a module; and the local names in a function invocation. In a sense" +" the set of attributes of an object also form a namespace. The important " +"thing to know about namespaces is that there is absolutely no relation " +"between names in different namespaces; for instance, two different modules " +"may both define a function ``maximize`` without confusion --- users of the " +"modules must prefix it with the module name." +msgstr "" +"*namespace* یک نقشه برداری از نام ها به اشیاء است. اکثر فضاهای نام در حال " +"حاضر به عنوان فرهنگ لغت پایتون پیاده سازی می شوند، اما معمولاً به هیچ وجه " +"(به جز عملکرد) قابل توجه نیست و ممکن است در آینده تغییر کند. نمونه هایی از " +"فضاهای نام عبارتند از: مجموعه ای از نام های داخلی (شامل توابعی مانند " +":func:`abs` و نام های استثنای داخلی). نام های جهانی در یک ماژول؛ و نام های " +"محلی در فراخوانی تابع. به یک معنا مجموعه صفات یک شی نیز یک فضای نام را " +"تشکیل می دهد. نکته مهمی که باید در مورد فضاهای نام بدانید این است که مطلقاً" +" هیچ رابطه ای بین نام ها در فضای نام های مختلف وجود ندارد. به عنوان مثال، دو" +" ماژول مختلف ممکن است هر دو یک تابع ``maximize`` را بدون سردرگمی تعریف کنند " +"--- کاربران ماژول ها باید آن را با نام ماژول پیشوند کنند." #: tutorial/classes.rst:82 -msgid "By the way, I use the word *attribute* for any name following a dot --- for example, in the expression ``z.real``, ``real`` is an attribute of the object ``z``. Strictly speaking, references to names in modules are attribute references: in the expression ``modname.funcname``, ``modname`` is a module object and ``funcname`` is an attribute of it. In this case there happens to be a straightforward mapping between the module's attributes and the global names defined in the module: they share the same namespace! [#]_" -msgstr "" +#, fuzzy +msgid "" +"By the way, I use the word *attribute* for any name following a dot --- for " +"example, in the expression ``z.real``, ``real`` is an attribute of the " +"object ``z``. Strictly speaking, references to names in modules are " +"attribute references: in the expression ``modname.funcname``, ``modname`` is" +" a module object and ``funcname`` is an attribute of it. In this case there" +" happens to be a straightforward mapping between the module's attributes and" +" the global names defined in the module: they share the same namespace! " +"[#]_" +msgstr "" +"به هر حال، من از کلمه *attribute* برای هر نامی به دنبال نقطه استفاده می کنم " +"--- به عنوان مثال، در عبارت ``z.real``، ``real`` یک ویژگی شی ``z`` است. به " +"طور دقیق، ارجاع به نام ها در ماژول ها ارجاعات ویژگی هستند: در عبارت " +"``modname.funcname``، ``modname`` یک شی ماژول و ``funcname`` یک ویژگی آن " +"است. در این مورد، نگاشت مستقیمی بین ویژگی‌های ماژول و نام‌های کلی تعریف‌شده" +" در ماژول وجود دارد: آنها فضای نام یکسانی دارند! [#]_" #: tutorial/classes.rst:90 -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 "" +#, fuzzy +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`` حذف می " +"کند." #: tutorial/classes.rst:96 -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 "" +#, fuzzy +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` " +"نامیده می شود.)" #: tutorial/classes.rst:106 -msgid "The local namespace for a function is created when the function is called, and deleted when the function returns or raises an exception that is not handled within the function. (Actually, forgetting would be a better way to describe what actually happens.) Of course, recursive invocations each have their own local namespace." -msgstr "" +#, fuzzy +msgid "" +"The local namespace for a function is created when the function is called, " +"and deleted when the function returns or raises an exception that is not " +"handled within the function. (Actually, forgetting would be a better way to" +" describe what actually happens.) Of course, recursive invocations each " +"have their own local namespace." +msgstr "" +"فضای نام محلی برای یک تابع هنگام فراخوانی تابع ایجاد می‌شود و زمانی که تابع " +"استثنایی را که در تابع مدیریت نمی‌شود برمی‌گرداند یا ایجاد می‌کند، حذف " +"می‌شود. (در واقع, فراموش کردن راه بهتری برای توصیف آنچه در واقع اتفاق " +"می‌افتد خواهد بود.) البته، فراخوان‌های بازگشتی هر کدام فضای نام محلی خود را " +"دارند." #: tutorial/classes.rst:112 -msgid "A *scope* is a textual region of a Python program where a namespace is directly accessible. \"Directly accessible\" here means that an unqualified reference to a name attempts to find the name in the namespace." +#, fuzzy +msgid "" +"A *scope* is a textual region of a Python program where a namespace is " +"directly accessible. \"Directly accessible\" here means that an unqualified" +" reference to a name attempts to find the name in the namespace." msgstr "" +"*scope* یک منطقه متنی از یک برنامه پایتون است که در آن فضای نام مستقیماً " +"قابل دسترسی است. \"دسترسی مستقیم\" در اینجا به این معنی است که یک ارجاع " +"غیرمجاز به یک نام سعی می کند نام را در فضای نام پیدا کند." #: tutorial/classes.rst:116 -msgid "Although scopes are determined statically, they are used dynamically. At any time during execution, there are 3 or 4 nested scopes whose namespaces are directly accessible:" +#, fuzzy +msgid "" +"Although scopes are determined statically, they are used dynamically. At any" +" time during execution, there are 3 or 4 nested scopes whose namespaces are " +"directly accessible:" msgstr "" +"اگرچه دامنه ها به صورت استاتیک تعیین می شوند، اما به صورت پویا مورد استفاده " +"قرار می گیرند. در هر زمان در طول اجرا، 3 یا 4 محدوده تو در تو وجود دارد که " +"فضای نام آنها مستقیماً قابل دسترسی است:" #: tutorial/classes.rst:120 +#, fuzzy msgid "the innermost scope, which is searched first, contains the local names" -msgstr "" +msgstr "درونی‌ترین محدوده، که ابتدا جستجو می‌شود، حاوی نام‌های محلی است" #: tutorial/classes.rst:121 -msgid "the scopes of any enclosing functions, which are searched starting with the nearest enclosing scope, contain non-local, but also non-global names" +#, fuzzy +msgid "" +"the scopes of any enclosing functions, which are searched starting with the " +"nearest enclosing scope, contain non-local, but also non-global names" msgstr "" +"دامنه هر توابع محصور کننده ای که با شروع با نزدیک ترین محدوده محصور جستجو می" +" شود، حاوی نام های غیر محلی، بلکه غیرکلی نیز می باشد." #: tutorial/classes.rst:123 +#, fuzzy msgid "the next-to-last scope contains the current module's global names" -msgstr "" +msgstr "دامنه بعدی تا آخر شامل نام های سراسری ماژول فعلی است" #: tutorial/classes.rst:124 -msgid "the outermost scope (searched last) is the namespace containing built-in names" +#, fuzzy +msgid "" +"the outermost scope (searched last) is the namespace containing built-in " +"names" msgstr "" +"بیرونی ترین محدوده (آخرین جستجو شده) فضای نامی است که شامل نام های داخلی است" #: tutorial/classes.rst:126 -msgid "If a name is declared global, then all references and assignments go directly to the next-to-last scope containing the module's global names. To rebind variables found outside of the innermost scope, the :keyword:`nonlocal` statement can be used; if not declared nonlocal, those variables are read-only (an attempt to write to such a variable will simply create a *new* local variable in the innermost scope, leaving the identically named outer variable unchanged)." -msgstr "" +#, fuzzy +msgid "" +"If a name is declared global, then all references and assignments go " +"directly to the next-to-last scope containing the module's global names. To" +" rebind variables found outside of the innermost scope, the " +":keyword:`nonlocal` statement can be used; if not declared nonlocal, those " +"variables are read-only (an attempt to write to such a variable will simply " +"create a *new* local variable in the innermost scope, leaving the " +"identically named outer variable unchanged)." +msgstr "" +"اگر نامی جهانی اعلام شود، آنگاه همه ارجاعات و تخصیص ها مستقیماً به محدوده " +"بعدی تا آخرین حاوی نام های جهانی ماژول می روند. برای اتصال مجدد متغیرهایی " +"که خارج از درونی ترین محدوده یافت می شوند، می توان از دستور " +":keyword:`nonlocal` استفاده کرد. اگر غیرمحلی اعلام نشود، آن متغیرها فقط " +"خواندنی هستند (تلاش برای نوشتن روی چنین متغیری به سادگی یک متغیر محلی *new* " +"در درونی‌ترین محدوده ایجاد می‌کند و متغیر بیرونی با نام مشابه را بدون تغییر " +"می‌گذارد)." #: tutorial/classes.rst:133 -msgid "Usually, the local scope references the local names of the (textually) current function. Outside functions, the local scope references the same namespace as the global scope: the module's namespace. Class definitions place yet another namespace in the local scope." +#, fuzzy +msgid "" +"Usually, the local scope references the local names of the (textually) " +"current function. Outside functions, the local scope references the same " +"namespace as the global scope: the module's namespace. Class definitions " +"place yet another namespace in the local scope." msgstr "" +"معمولاً محدوده محلی به نام های محلی تابع فعلی (از نظر متنی) ارجاع می دهد. " +"خارج از توابع، محدوده محلی به فضای نامی مشابه با دامنه جهانی ارجاع می دهد: " +"فضای نام ماژول. تعاریف کلاس ها فضای نام دیگری را در محدوده محلی قرار می " +"دهند." #: tutorial/classes.rst:138 -msgid "It is important to realize that scopes are determined textually: the global scope of a function defined in a module is that module's namespace, no matter from where or by what alias the function is called. On the other hand, the actual search for names is done dynamically, at run time --- however, the language definition is evolving towards static name resolution, at \"compile\" time, so don't rely on dynamic name resolution! (In fact, local variables are already determined statically.)" -msgstr "" +#, fuzzy +msgid "" +"It is important to realize that scopes are determined textually: the global " +"scope of a function defined in a module is that module's namespace, no " +"matter from where or by what alias the function is called. On the other " +"hand, the actual search for names is done dynamically, at run time --- " +"however, the language definition is evolving towards static name resolution," +" at \"compile\" time, so don't rely on dynamic name resolution! (In fact, " +"local variables are already determined statically.)" +msgstr "" +"مهم است که بدانیم دامنه ها به صورت متنی تعیین می شوند: محدوده جهانی یک تابع " +"تعریف شده در یک ماژول، فضای نام آن ماژول است، مهم نیست که از کجا یا با چه " +"نام مستعار تابع نامیده می شود. از سوی دیگر، جستجوی واقعی نام ها به صورت " +"پویا و در زمان اجرا انجام می شود --- با این حال، تعریف زبان به سمت وضوح نام " +"ثابت در زمان \"کامپایل\" در حال تکامل است، بنابراین به وضوح نام پویا تکیه " +"نکنید! (در واقع, متغیرهای محلی قبلاً به صورت ایستا تعیین شده اند.)" #: tutorial/classes.rst:146 -msgid "A special quirk of Python is that -- if no :keyword:`global` or :keyword:`nonlocal` statement is in effect -- assignments to names always go into the innermost scope. Assignments do not copy data --- they just bind names to objects. The same is true for deletions: the statement ``del x`` removes the binding of ``x`` from the namespace referenced by the local scope. In fact, all operations that introduce new names use the local scope: in particular, :keyword:`import` statements and function definitions bind the module or function name in the local scope." -msgstr "" +#, fuzzy +msgid "" +"A special quirk of Python is that -- if no :keyword:`global` or " +":keyword:`nonlocal` statement is in effect -- assignments to names always go" +" into the innermost scope. Assignments do not copy data --- they just bind " +"names to objects. The same is true for deletions: the statement ``del x`` " +"removes the binding of ``x`` from the namespace referenced by the local " +"scope. In fact, all operations that introduce new names use the local " +"scope: in particular, :keyword:`import` statements and function definitions " +"bind the module or function name in the local scope." +msgstr "" +"یک ویژگی خاص پایتون این است که -- اگر هیچ دستور :keyword:`global` یا " +":keyword:`nonlocal` در کار نباشد -- انتساب به نام ها همیشه در درونی ترین " +"محدوده قرار می گیرد. تکالیف داده ها را کپی نمی کنند --- آنها فقط نام ها را " +"به اشیا متصل می کنند. همین امر در مورد حذف ها نیز صادق است: عبارت ``del x``" +" اتصال ``x`` را از فضای نامی که توسط محدوده محلی ارجاع داده شده است حذف می " +"کند. در واقع، تمام عملیاتی که نام‌های جدید معرفی می‌کنند، از محدوده محلی " +"استفاده می‌کنند: به ویژه، عبارات :keyword:`import` و تعاریف تابع، نام ماژول " +"یا تابع را در محدوده محلی متصل می‌کنند." #: tutorial/classes.rst:154 -msgid "The :keyword:`global` statement can be used to indicate that particular variables live in the global scope and should be rebound there; the :keyword:`nonlocal` statement indicates that particular variables live in an enclosing scope and should be rebound there." +#, fuzzy +msgid "" +"The :keyword:`global` statement can be used to indicate that particular " +"variables live in the global scope and should be rebound there; the " +":keyword:`nonlocal` statement indicates that particular variables live in an" +" enclosing scope and should be rebound there." msgstr "" +"دستور :keyword:`global` را می توان برای نشان دادن اینکه متغیرهای خاص در " +"محدوده جهانی زندگی می کنند و باید در آنجا بازگردند استفاده شود. عبارت " +":keyword:`nonlocal` نشان می دهد که متغیرهای خاص در یک محدوده محصور زندگی می " +"کنند و باید در آنجا بازگردند." #: tutorial/classes.rst:162 +#, fuzzy msgid "Scopes and Namespaces Example" -msgstr "" +msgstr "مثال محدوده ها و فضاهای نام" #: tutorial/classes.rst:164 -msgid "This is an example demonstrating how to reference the different scopes and namespaces, and how :keyword:`global` and :keyword:`nonlocal` affect variable binding::" +#, fuzzy +msgid "" +"This is an example demonstrating how to reference the different scopes and " +"namespaces, and how :keyword:`global` and :keyword:`nonlocal` affect " +"variable binding::" msgstr "" +"این مثالی است که نشان می‌دهد چگونه به دامنه‌ها و فضاهای نام مختلف ارجاع داده" +" شود و چگونه :keyword:`global` و :keyword:`nonlocal` بر اتصال متغیر تأثیر " +"می‌گذارند:" #: tutorial/classes.rst:168 -msgid "def scope_test():\n" +#, fuzzy +msgid "" +"def scope_test():\n" " def do_local():\n" " spam = \"local spam\"\n" "\n" @@ -152,124 +432,300 @@ msgid "def scope_test():\n" "scope_test()\n" "print(\"In global scope:\", spam)" msgstr "" +"def scope_test():\n" +" def do_local():\n" +" spam = \"local spam\"\n" +"\n" +" def do_nonlocal():\n" +" nonlocal spam\n" +" spam = \"nonlocal spam\"\n" +"\n" +" def do_global():\n" +" global spam\n" +" spam = \"global spam\"\n" +"\n" +" spam = \"test spam\"\n" +" do_local()\n" +" print(\"After local assignment:\", spam)\n" +" do_nonlocal()\n" +" print(\"After nonlocal assignment:\", spam)\n" +" do_global()\n" +" print(\"After global assignment:\", spam)\n" +"\n" +"scope_test()\n" +"print(\"In global scope:\", spam)" #: tutorial/classes.rst:191 +#, fuzzy msgid "The output of the example code is:" -msgstr "" +msgstr "خروجی کد مثال به صورت زیر است:" #: tutorial/classes.rst:193 -msgid "After local assignment: test spam\n" +#, fuzzy +msgid "" +"After local assignment: test spam\n" "After nonlocal assignment: nonlocal spam\n" "After global assignment: nonlocal spam\n" "In global scope: global spam" msgstr "" +"پس از انتساب محلی: هرزنامه را آزمایش کنید\n" +"پس از تخصیص غیر محلی: هرزنامه غیرمحلی\n" +"پس از تخصیص جهانی: هرزنامه غیر محلی\n" +"در حوزه جهانی: هرزنامه جهانی" #: tutorial/classes.rst:200 -msgid "Note how the *local* assignment (which is default) didn't change *scope_test*\\'s binding of *spam*. The :keyword:`nonlocal` assignment changed *scope_test*\\'s binding of *spam*, and the :keyword:`global` assignment changed the module-level binding." +#, fuzzy +msgid "" +"Note how the *local* assignment (which is default) didn't change " +"*scope_test*\\'s binding of *spam*. The :keyword:`nonlocal` assignment " +"changed *scope_test*\\'s binding of *spam*, and the :keyword:`global` " +"assignment changed the module-level binding." msgstr "" +"توجه داشته باشید که چگونه تخصیص *local* (که پیش‌فرض است) پیوند *scope_test* " +"را تغییر نداد. تخصیص :keyword:`nonlocal` اتصال *scope_test* به *spam* را " +"تغییر داد و تخصیص :keyword:`global` اتصال سطح ماژول را تغییر داد." #: tutorial/classes.rst:205 -msgid "You can also see that there was no previous binding for *spam* before the :keyword:`global` assignment." +#, fuzzy +msgid "" +"You can also see that there was no previous binding for *spam* before the " +":keyword:`global` assignment." msgstr "" +"همچنین می توانید ببینید که قبل از تخصیص :keyword:`global`، هیچ اتصال قبلی " +"برای *spam* وجود نداشت." #: tutorial/classes.rst:212 +#, fuzzy msgid "A First Look at Classes" -msgstr "" +msgstr "نگاه اول به کلاس ها" #: tutorial/classes.rst:214 -msgid "Classes introduce a little bit of new syntax, three new object types, and some new semantics." +#, fuzzy +msgid "" +"Classes introduce a little bit of new syntax, three new object types, and " +"some new semantics." msgstr "" +"کلاس ها کمی نحو جدید، سه نوع شیء جدید و برخی از معناشناسی جدید را معرفی می " +"کنند." #: tutorial/classes.rst:221 +#, fuzzy msgid "Class Definition Syntax" -msgstr "" +msgstr "نحو تعریف کلاس" #: tutorial/classes.rst:223 +#, fuzzy msgid "The simplest form of class definition looks like this::" -msgstr "" +msgstr "ساده ترین شکل تعریف کلاس به صورت زیر است:" #: tutorial/classes.rst:225 -msgid "class ClassName:\n" +#, fuzzy +msgid "" +"class ClassName:\n" " \n" " .\n" " .\n" " .\n" " " msgstr "" +"نام کلاس:\n" +" \n" +" .\n" +" .\n" +" .\n" +" " #: tutorial/classes.rst:232 -msgid "Class definitions, like function definitions (:keyword:`def` statements) must be executed before they have any effect. (You could conceivably place a class definition in a branch of an :keyword:`if` statement, or inside a function.)" +#, fuzzy +msgid "" +"Class definitions, like function definitions (:keyword:`def` statements) " +"must be executed before they have any effect. (You could conceivably place " +"a class definition in a branch of an :keyword:`if` statement, or inside a " +"function.)" msgstr "" +"تعاریف کلاس، مانند تعاریف تابع (عبارات :keyword:`def`) باید قبل از اینکه " +"اثری داشته باشند، اجرا شوند. (شما می توانید یک تعریف کلاس را در شاخه ای از " +"دستور :keyword:`if` یا داخل یک تابع قرار دهید.)" #: tutorial/classes.rst:236 -msgid "In practice, the statements inside a class definition will usually be function definitions, but other statements are allowed, and sometimes useful --- we'll come back to this later. The function definitions inside a class normally have a peculiar form of argument list, dictated by the calling conventions for methods --- again, this is explained later." -msgstr "" +#, fuzzy +msgid "" +"In practice, the statements inside a class definition will usually be " +"function definitions, but other statements are allowed, and sometimes useful" +" --- we'll come back to this later. The function definitions inside a class" +" normally have a peculiar form of argument list, dictated by the calling " +"conventions for methods --- again, this is explained later." +msgstr "" +"در عمل، عبارات داخل تعریف کلاس معمولاً تعاریف تابع هستند، اما عبارات دیگر " +"مجاز هستند و گاهی اوقات مفید هستند --- بعداً به این موضوع باز خواهیم گشت. " +"تعاریف تابع در داخل یک کلاس معمولاً یک شکل خاص از فهرست آرگومان دارند که " +"توسط قراردادهای فراخوانی متدها دیکته می شود --- دوباره، این بعداً توضیح داده" +" می شود." #: tutorial/classes.rst:242 -msgid "When a class definition is entered, a new namespace is created, and used as the local scope --- thus, all assignments to local variables go into this new namespace. In particular, function definitions bind the name of the new function here." +#, fuzzy +msgid "" +"When a class definition is entered, a new namespace is created, and used as " +"the local scope --- thus, all assignments to local variables go into this " +"new namespace. In particular, function definitions bind the name of the new" +" function here." msgstr "" +"هنگامی که یک تعریف کلاس وارد می شود، یک فضای نام جدید ایجاد می شود، و به " +"عنوان محدوده محلی استفاده می شود --- بنابراین، تمام انتساب به متغیرهای محلی " +"به این فضای نام جدید می رود. به طور خاص، تعاریف تابع نام تابع جدید را در " +"اینجا پیوند می دهد." #: tutorial/classes.rst:247 -msgid "When a class definition is left normally (via the end), a *class object* is created. This is basically a wrapper around the contents of the namespace created by the class definition; we'll learn more about class objects in the next section. The original local scope (the one in effect just before the class definition was entered) is reinstated, and the class object is bound here to the class name given in the class definition header (:class:`!ClassName` in the example)." -msgstr "" +#, fuzzy +msgid "" +"When a class definition is left normally (via the end), a *class object* is " +"created. This is basically a wrapper around the contents of the namespace " +"created by the class definition; we'll learn more about class objects in the" +" next section. The original local scope (the one in effect just before the " +"class definition was entered) is reinstated, and the class object is bound " +"here to the class name given in the class definition header " +"(:class:`!ClassName` in the example)." +msgstr "" +"هنگامی که یک تعریف کلاس به طور معمول (از طریق انتهای) باقی می ماند، یک " +"*class object* ایجاد می شود. این اساساً یک بسته بندی در اطراف محتویات فضای " +"نام ایجاد شده توسط تعریف کلاس است. در بخش بعدی در مورد اشیاء کلاس بیشتر " +"خواهیم آموخت. محدوده محلی اصلی (محدوده ای که درست قبل از وارد کردن تعریف " +"کلاس وجود داشت) بازیابی می شود، و شی کلاس در اینجا به نام کلاس ارائه شده در " +"هدر تعریف کلاس (:class:`!ClassName` در مثال) محدود می شود." #: tutorial/classes.rst:259 +#, fuzzy msgid "Class Objects" -msgstr "" +msgstr "اشیاء کلاس" #: tutorial/classes.rst:261 -msgid "Class objects support two kinds of operations: attribute references and instantiation." +#, fuzzy +msgid "" +"Class objects support two kinds of operations: attribute references and " +"instantiation." msgstr "" +"اشیاء کلاس از دو نوع عملیات پشتیبانی می کنند: ارجاعات مشخصه و نمونه سازی." #: tutorial/classes.rst:264 -msgid "*Attribute references* use the standard syntax used for all attribute references in Python: ``obj.name``. Valid attribute names are all the names that were in the class's namespace when the class object was created. So, if the class definition looked like this::" +#, fuzzy +msgid "" +"*Attribute references* use the standard syntax used for all attribute " +"references in Python: ``obj.name``. Valid attribute names are all the names" +" that were in the class's namespace when the class object was created. So, " +"if the class definition looked like this::" msgstr "" +"*Attribute references* از نحو استاندارد مورد استفاده برای همه ارجاعات ویژگی " +"در پایتون استفاده می کند: ``obj.name``. نام‌های مشخصه معتبر همه نام‌هایی " +"هستند که در هنگام ایجاد شی کلاس در فضای نام کلاس وجود داشتند. بنابراین، اگر" +" تعریف کلاس به این صورت بود:" #: tutorial/classes.rst:269 -msgid "class MyClass:\n" +#, fuzzy +msgid "" +"class MyClass:\n" " \"\"\"A simple example class\"\"\"\n" " i = 12345\n" "\n" " def f(self):\n" " return 'hello world'" msgstr "" +"class MyClass:\n" +" \"\"\"A simple example class\"\"\"\n" +" i = 12345\n" +"\n" +" def f(self):\n" +" return 'hello world'" #: tutorial/classes.rst:276 -msgid "then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, returning an integer and a function object, respectively. Class attributes can also be assigned to, so you can change the value of ``MyClass.i`` by assignment. :attr:`~type.__doc__` is also a valid attribute, returning the docstring belonging to the class: ``\"A simple example class\"``." -msgstr "" +#, fuzzy +msgid "" +"then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, " +"returning an integer and a function object, respectively. Class attributes " +"can also be assigned to, so you can change the value of ``MyClass.i`` by " +"assignment. :attr:`~type.__doc__` is also a valid attribute, returning the " +"docstring belonging to the class: ``\"A simple example class\"``." +msgstr "" +"سپس ``MyClass.i`` و ``MyClass.f`` مراجع مشخصه معتبری هستند که به ترتیب یک " +"عدد صحیح و یک شی تابع را برمی‌گردانند. ویژگی های کلاس را نیز می توان به آن " +"اختصاص داد، بنابراین می توانید مقدار ``MyClass.i`` را با انتساب تغییر دهید. " +":attr:`~type.__doc__` نیز یک ویژگی معتبر است که رشته مستند متعلق به کلاس: " +"``\"A simple example class\"`` را برمی گرداند." #: tutorial/classes.rst:282 -msgid "Class *instantiation* uses function notation. Just pretend that the class object is a parameterless function that returns a new instance of the class. For example (assuming the above class)::" +#, fuzzy +msgid "" +"Class *instantiation* uses function notation. Just pretend that the class " +"object is a parameterless function that returns a new instance of the class." +" For example (assuming the above class)::" msgstr "" +"کلاس *instantiation* از نشانه گذاری تابع استفاده می کند. فقط وانمود کنید که" +" شی کلاس یک تابع بدون پارامتر است که نمونه جدیدی از کلاس را برمی گرداند. به " +"عنوان مثال (با فرض کلاس بالا):" -#: tutorial/classes.rst:286 -#: tutorial/classes.rst:303 +#: tutorial/classes.rst:286 tutorial/classes.rst:303 +#, fuzzy msgid "x = MyClass()" -msgstr "" +msgstr "x = MyClass()" #: tutorial/classes.rst:288 -msgid "creates a new *instance* of the class and assigns this object to the local variable ``x``." +#, fuzzy +msgid "" +"creates a new *instance* of the class and assigns this object to the local " +"variable ``x``." msgstr "" +"یک *instance* جدید از کلاس ایجاد می کند و این شی را به متغیر محلی ``x`` " +"اختصاص می دهد." #: tutorial/classes.rst:291 -msgid "The instantiation operation (\"calling\" a class object) creates an empty object. Many classes like to create objects with instances customized to a specific initial state. Therefore a class may define a special method named :meth:`~object.__init__`, like this::" +#, fuzzy +msgid "" +"The instantiation operation (\"calling\" a class object) creates an empty " +"object. Many classes like to create objects with instances customized to a " +"specific initial state. Therefore a class may define a special method named " +":meth:`~object.__init__`, like this::" msgstr "" +"عملیات نمونه سازی (\" فراخوانی \" یک شی کلاس) یک شی خالی ایجاد می کند. " +"بسیاری از کلاس ها دوست دارند اشیایی را با نمونه های سفارشی شده برای یک حالت " +"اولیه خاص ایجاد کنند. بنابراین یک کلاس ممکن است متد خاصی به نام " +":meth:`~object.__init__` را تعریف کند، مانند:" #: tutorial/classes.rst:296 -msgid "def __init__(self):\n" +#, fuzzy +msgid "" +"def __init__(self):\n" " self.data = []" msgstr "" +"def __init__(self):\n" +" self.data = []" #: tutorial/classes.rst:299 -msgid "When a class defines an :meth:`~object.__init__` method, class instantiation automatically invokes :meth:`!__init__` for the newly created class instance. So in this example, a new, initialized instance can be obtained by::" +#, fuzzy +msgid "" +"When a class defines an :meth:`~object.__init__` method, class instantiation" +" automatically invokes :meth:`!__init__` for the newly created class " +"instance. So in this example, a new, initialized instance can be obtained " +"by::" msgstr "" +"هنگامی که یک کلاس یک متد :meth:`~object.__init__` را تعریف می کند، نمونه " +"سازی کلاس به طور خودکار :meth:`!__init__` را برای نمونه کلاس تازه ایجاد شده " +"فراخوانی می کند. بنابراین در این مثال، یک نمونه جدید و مقداردهی اولیه را می" +" توان با استفاده از:" #: tutorial/classes.rst:305 -msgid "Of course, the :meth:`~object.__init__` method may have arguments for greater flexibility. In that case, arguments given to the class instantiation operator are passed on to :meth:`!__init__`. For example, ::" +#, fuzzy +msgid "" +"Of course, the :meth:`~object.__init__` method may have arguments for " +"greater flexibility. In that case, arguments given to the class " +"instantiation operator are passed on to :meth:`!__init__`. For example, ::" msgstr "" +"البته روش :meth:`~object.__init__` ممکن است استدلال هایی برای انعطاف پذیری " +"بیشتر داشته باشد. در آن صورت، آرگومان های داده شده به عملگر نمونه سازی کلاس" +" به :meth:`!__init__` منتقل می شود. به عنوان مثال، ::" #: tutorial/classes.rst:309 -msgid ">>> class Complex:\n" +#, fuzzy +msgid "" +">>> class Complex:\n" "... def __init__(self, realpart, imagpart):\n" "... self.r = realpart\n" "... self.i = imagpart\n" @@ -278,83 +734,200 @@ msgid ">>> class Complex:\n" ">>> x.r, x.i\n" "(3.0, -4.5)" msgstr "" +">>> class Complex:\n" +"... def __init__(self, realpart, imagpart):\n" +"... self.r = realpart\n" +"... self.i = imagpart\n" +"...\n" +">>> x = Complex(3.0, -4.5)\n" +">>> x.r, x.i\n" +"(3.0, -4.5)" #: tutorial/classes.rst:322 +#, fuzzy msgid "Instance Objects" -msgstr "" +msgstr "اشیاء نمونه" #: tutorial/classes.rst:324 -msgid "Now what can we do with instance objects? The only operations understood by instance objects are attribute references. There are two kinds of valid attribute names: data attributes and methods." +#, fuzzy +msgid "" +"Now what can we do with instance objects? The only operations understood by" +" instance objects are attribute references. There are two kinds of valid " +"attribute names: data attributes and methods." msgstr "" +"حالا با اشیاء نمونه چه کنیم؟ تنها عملیات درک شده توسط اشیاء نمونه، ارجاعات " +"ویژگی هستند. دو نوع نام مشخصه معتبر وجود دارد: ویژگی های داده و روش ها." #: tutorial/classes.rst:328 -msgid "*data attributes* correspond to \"instance variables\" in Smalltalk, and to \"data members\" in C++. Data attributes need not be declared; like local variables, they spring into existence when they are first assigned to. For example, if ``x`` is the instance of :class:`!MyClass` created above, the following piece of code will print the value ``16``, without leaving a trace::" -msgstr "" +#, fuzzy +msgid "" +"*data attributes* correspond to \"instance variables\" in Smalltalk, and to " +"\"data members\" in C++. Data attributes need not be declared; like local " +"variables, they spring into existence when they are first assigned to. For " +"example, if ``x`` is the instance of :class:`!MyClass` created above, the " +"following piece of code will print the value ``16``, without leaving a " +"trace::" +msgstr "" +"*data attributes* با \"متغیرهای نمونه\" در Smalltalk و به \"اعضای داده\" در " +"C++ مطابقت دارد. ویژگی های داده نیازی به اعلان ندارند. مانند متغیرهای محلی،" +" زمانی که برای اولین بار به آنها اختصاص داده می شوند، به وجود می آیند. به " +"عنوان مثال، اگر ``x`` نمونه ای از :class:`!MyClass` باشد که در بالا ایجاد " +"شده است، کد زیر مقدار ``16`` را بدون گذاشتن ردی چاپ می کند:" #: tutorial/classes.rst:334 -msgid "x.counter = 1\n" +#, fuzzy +msgid "" +"x.counter = 1\n" "while x.counter < 10:\n" " x.counter = x.counter * 2\n" "print(x.counter)\n" "del x.counter" msgstr "" +"x.counter = 1\n" +"while x.counter < 10:\n" +" x.counter = x.counter * 2\n" +"print(x.counter)\n" +"del x.counter" #: tutorial/classes.rst:340 -msgid "The other kind of instance attribute reference is a *method*. A method is a function that \"belongs to\" an object." +#, fuzzy +msgid "" +"The other kind of instance attribute reference is a *method*. A method is a " +"function that \"belongs to\" an object." msgstr "" +"نوع دیگر مرجع ویژگی نمونه *method* است. متد تابعی است که «متعلق به» یک شی " +"است." #: tutorial/classes.rst:345 -msgid "Valid method names of an instance object depend on its class. By definition, all attributes of a class that are function objects define corresponding methods of its instances. So in our example, ``x.f`` is a valid method reference, since ``MyClass.f`` is a function, but ``x.i`` is not, since ``MyClass.i`` is not. But ``x.f`` is not the same thing as ``MyClass.f`` --- it is a *method object*, not a function object." -msgstr "" +#, fuzzy +msgid "" +"Valid method names of an instance object depend on its class. By " +"definition, all attributes of a class that are function objects define " +"corresponding methods of its instances. So in our example, ``x.f`` is a " +"valid method reference, since ``MyClass.f`` is a function, but ``x.i`` is " +"not, since ``MyClass.i`` is not. But ``x.f`` is not the same thing as " +"``MyClass.f`` --- it is a *method object*, not a function object." +msgstr "" +"نام متدهای معتبر یک شیء نمونه به کلاس آن بستگی دارد. طبق تعریف، تمام " +"ویژگی‌های یک کلاس که شی تابع هستند، متدهای مربوط به نمونه‌های آن را تعریف " +"می‌کنند. بنابراین در مثال ما، ``x.f`` یک مرجع متد معتبر است، زیرا " +"``MyClass.f`` یک تابع است، اما ``x.i`` نیست، زیرا ``MyClass.i`` نیست. اما " +"``x.f`` مشابه ``MyClass.f`` نیست --- یک *method object* است نه یک شی تابع." #: tutorial/classes.rst:356 +#, fuzzy msgid "Method Objects" -msgstr "" +msgstr "اشیاء روش" #: tutorial/classes.rst:358 +#, fuzzy msgid "Usually, a method is called right after it is bound::" -msgstr "" +msgstr "معمولاً یک متد بلافاصله پس از محدود شدن فراخوانی می شود:" #: tutorial/classes.rst:360 +#, fuzzy msgid "x.f()" -msgstr "" +msgstr "x.f()" #: tutorial/classes.rst:362 -msgid "In the :class:`!MyClass` example, this will return the string ``'hello world'``. However, it is not necessary to call a method right away: ``x.f`` is a method object, and can be stored away and called at a later time. For example::" +#, fuzzy +msgid "" +"In the :class:`!MyClass` example, this will return the string ``'hello " +"world'``. However, it is not necessary to call a method right away: ``x.f`` " +"is a method object, and can be stored away and called at a later time. For " +"example::" msgstr "" +"در مثال :class:`!MyClass`، این رشته ``'hello world'`` را برمی گرداند. با این" +" حال، لازم نیست فوراً یک متد را فراخوانی کنید: ``x.f`` یک شی متد است و " +"می‌توان آن را ذخیره کرد و در زمان دیگری فراخوانی کرد. به عنوان مثال::" #: tutorial/classes.rst:366 -msgid "xf = x.f\n" +#, fuzzy +msgid "" +"xf = x.f\n" "while True:\n" " print(xf())" msgstr "" +"xf = x.f\n" +"while True:\n" +" print(xf())" #: tutorial/classes.rst:370 +#, fuzzy msgid "will continue to print ``hello world`` until the end of time." -msgstr "" +msgstr "چاپ ``hello world`` تا پایان زمان ادامه خواهد داشت." #: tutorial/classes.rst:372 -msgid "What exactly happens when a method is called? You may have noticed that ``x.f()`` was called without an argument above, even though the function definition for :meth:`!f` specified an argument. What happened to the argument? Surely Python raises an exception when a function that requires an argument is called without any --- even if the argument isn't actually used..." -msgstr "" +#, fuzzy +msgid "" +"What exactly happens when a method is called? You may have noticed that " +"``x.f()`` was called without an argument above, even though the function " +"definition for :meth:`!f` specified an argument. What happened to the " +"argument? Surely Python raises an exception when a function that requires an" +" argument is called without any --- even if the argument isn't actually " +"used..." +msgstr "" +"وقتی یک متد فراخوانی می شود دقیقا چه اتفاقی می افتد؟ ممکن است متوجه شده " +"باشید که ``x.f()`` بدون آرگومان در بالا فراخوانی شده است، حتی اگر تعریف تابع" +" برای :meth:`!f` یک آرگومان را مشخص کرده باشد. بحث چه شد؟ مطمئنا پایتون یک " +"استثنا ایجاد می کند زمانی که تابعی که به آرگومان نیاز دارد بدون هیچ --- " +"فراخوانی شود، حتی اگر آرگومان در واقع استفاده نشده باشد..." #: tutorial/classes.rst:378 -msgid "Actually, you may have guessed the answer: the special thing about methods is that the instance object is passed as the first argument of the function. In our example, the call ``x.f()`` is exactly equivalent to ``MyClass.f(x)``. In general, calling a method with a list of *n* arguments is equivalent to calling the corresponding function with an argument list that is created by inserting the method's instance object before the first argument." -msgstr "" +#, fuzzy +msgid "" +"Actually, you may have guessed the answer: the special thing about methods " +"is that the instance object is passed as the first argument of the function." +" In our example, the call ``x.f()`` is exactly equivalent to " +"``MyClass.f(x)``. In general, calling a method with a list of *n* arguments" +" is equivalent to calling the corresponding function with an argument list " +"that is created by inserting the method's instance object before the first " +"argument." +msgstr "" +"در واقع، ممکن است پاسخ را حدس زده باشید: نکته ویژه در مورد متدها این است که " +"شی نمونه به عنوان اولین آرگومان تابع ارسال می شود. در مثال ما، فراخوانی " +"``x.f()`` دقیقاً معادل ``MyClass.f(x)`` است. به طور کلی، فراخوانی یک متد با" +" لیستی از آرگومان های *n* معادل فراخوانی تابع مربوطه با یک لیست آرگومان است " +"که با قرار دادن شی نمونه متد قبل از اولین آرگومان ایجاد می شود." #: tutorial/classes.rst:385 -msgid "In general, methods work as follows. When a non-data attribute of an instance is referenced, the instance's class is searched. If the name denotes a valid class attribute that is a function object, references to both the instance object and the function object are packed into a method object. When the method object is called with an argument list, a new argument list is constructed from the instance object and the argument list, and the function object is called with this new argument list." -msgstr "" +#, fuzzy +msgid "" +"In general, methods work as follows. When a non-data attribute of an " +"instance is referenced, the instance's class is searched. If the name " +"denotes a valid class attribute that is a function object, references to " +"both the instance object and the function object are packed into a method " +"object. When the method object is called with an argument list, a new " +"argument list is constructed from the instance object and the argument list," +" and the function object is called with this new argument list." +msgstr "" +"به طور کلی روش ها به شرح زیر عمل می کنند. هنگامی که یک ویژگی غیر داده ای از" +" یک نمونه ارجاع داده می شود، کلاس نمونه جستجو می شود. اگر نام یک ویژگی کلاس " +"معتبر را نشان می دهد که یک شی تابع است، ارجاعات به شی نمونه و شی تابع در یک " +"شی متد بسته بندی می شوند. هنگامی که شی متد با یک لیست آرگومان فراخوانی می " +"شود، یک لیست آرگومان جدید از شی نمونه و لیست آرگومان ساخته می شود و شی تابع " +"با این لیست آرگومان جدید فراخوانی می شود." #: tutorial/classes.rst:398 +#, fuzzy msgid "Class and Instance Variables" -msgstr "" +msgstr "متغیرهای کلاس و نمونه" #: tutorial/classes.rst:400 -msgid "Generally speaking, instance variables are for data unique to each instance and class variables are for attributes and methods shared by all instances of the class::" +#, fuzzy +msgid "" +"Generally speaking, instance variables are for data unique to each instance " +"and class variables are for attributes and methods shared by all instances " +"of the class::" msgstr "" +"به طور کلی، متغیرهای نمونه برای داده‌های منحصر به فرد برای هر نمونه و " +"متغیرهای کلاس برای ویژگی‌ها و روش‌هایی هستند که توسط همه نمونه‌های کلاس به " +"اشتراک گذاشته می‌شوند:" #: tutorial/classes.rst:404 -msgid "class Dog:\n" +#, fuzzy +msgid "" +"class Dog:\n" "\n" " kind = 'canine' # class variable shared by all instances\n" "\n" @@ -372,13 +945,43 @@ msgid "class Dog:\n" ">>> e.name # unique to e\n" "'Buddy'" msgstr "" +"class Dog:\n" +"\n" +" kind = 'canine' # class variable shared by all instances\n" +"\n" +" def __init__(self, name):\n" +" self.name = name # instance variable unique to each instance\n" +"\n" +">>> d = Dog('Fido')\n" +">>> e = Dog('Buddy')\n" +">>> d.kind # shared by all dogs\n" +"'canine'\n" +">>> e.kind # shared by all dogs\n" +"'canine'\n" +">>> d.name # unique to d\n" +"'Fido'\n" +">>> e.name # unique to e\n" +"'Buddy'" #: tutorial/classes.rst:422 -msgid "As discussed in :ref:`tut-object`, shared data can have possibly surprising effects with 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 "" +#, fuzzy +msgid "" +"As discussed in :ref:`tut-object`, shared data can have possibly surprising " +"effects with 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* به اشتراک گذاشته می شود:" #: tutorial/classes.rst:428 -msgid "class Dog:\n" +#, fuzzy +msgid "" +"class Dog:\n" "\n" " tricks = [] # mistaken use of a class variable\n" "\n" @@ -395,13 +998,32 @@ msgid "class Dog:\n" ">>> d.tricks # unexpectedly shared by all dogs\n" "['roll over', 'play dead']" msgstr "" +"class Dog:\n" +"\n" +" tricks = [] # mistaken use of a class variable\n" +"\n" +" def __init__(self, name):\n" +" self.name = name\n" +"\n" +" def add_trick(self, trick):\n" +" self.tricks.append(trick)\n" +"\n" +">>> d = Dog('Fido')\n" +">>> e = Dog('Buddy')\n" +">>> d.add_trick('roll over')\n" +">>> e.add_trick('play dead')\n" +">>> d.tricks # unexpectedly shared by all dogs\n" +"['roll over', 'play dead']" #: tutorial/classes.rst:445 +#, fuzzy msgid "Correct design of the class should use an instance variable instead::" -msgstr "" +msgstr "در طراحی صحیح کلاس باید از یک متغیر نمونه استفاده شود:" #: tutorial/classes.rst:447 -msgid "class Dog:\n" +#, fuzzy +msgid "" +"class Dog:\n" "\n" " def __init__(self, name):\n" " self.name = name\n" @@ -419,17 +1041,42 @@ msgid "class Dog:\n" ">>> e.tricks\n" "['play dead']" msgstr "" +"class Dog:\n" +"\n" +" def __init__(self, name):\n" +" self.name = name\n" +" self.tricks = [] # creates a new empty list for each dog\n" +"\n" +" def add_trick(self, trick):\n" +" self.tricks.append(trick)\n" +"\n" +">>> d = Dog('Fido')\n" +">>> e = Dog('Buddy')\n" +">>> d.add_trick('roll over')\n" +">>> e.add_trick('play dead')\n" +">>> d.tricks\n" +"['roll over']\n" +">>> e.tricks\n" +"['play dead']" #: tutorial/classes.rst:469 +#, fuzzy msgid "Random Remarks" -msgstr "" +msgstr "اظهارات تصادفی" #: tutorial/classes.rst:473 -msgid "If the same attribute name occurs in both an instance and in a class, then attribute lookup prioritizes the instance::" +#, fuzzy +msgid "" +"If the same attribute name occurs in both an instance and in a class, then " +"attribute lookup prioritizes the instance::" msgstr "" +"اگر نام مشخصه یکسانی هم در یک نمونه و هم در یک کلاس وجود داشته باشد، جستجوی " +"ویژگی، نمونه را اولویت بندی می کند::" #: tutorial/classes.rst:476 -msgid ">>> class Warehouse:\n" +#, fuzzy +msgid "" +">>> class Warehouse:\n" "... purpose = 'storage'\n" "... region = 'west'\n" "...\n" @@ -441,29 +1088,98 @@ msgid ">>> class Warehouse:\n" ">>> print(w2.purpose, w2.region)\n" "storage east" msgstr "" +">>> انبار کلاس:\n" +"... هدف = \"ذخیره سازی\"\n" +"... منطقه = \"غرب\"\n" +"...\n" +">>> w1 = انبار()\n" +">>> چاپ (w1.purpose, w1.region)\n" +"انباری غرب\n" +">>> w2 = انبار()\n" +">>> w2.region = 'شرق'\n" +">>> چاپ (w2.purpose, w2.region)\n" +"ذخیره سازی شرق" #: tutorial/classes.rst:488 -msgid "Data attributes may be referenced by methods as well as by ordinary users (\"clients\") of an object. In other words, classes are not usable to implement pure abstract data types. In fact, nothing in Python makes it possible to enforce data hiding --- it is all based upon convention. (On the other hand, the Python implementation, written in C, can completely hide implementation details and control access to an object if necessary; this can be used by extensions to Python written in C.)" -msgstr "" +#, fuzzy +msgid "" +"Data attributes may be referenced by methods as well as by ordinary users " +"(\"clients\") of an object. In other words, classes are not usable to " +"implement pure abstract data types. In fact, nothing in Python makes it " +"possible to enforce data hiding --- it is all based upon convention. (On " +"the other hand, the Python implementation, written in C, can completely hide" +" implementation details and control access to an object if necessary; this " +"can be used by extensions to Python written in C.)" +msgstr "" +"ویژگی های داده ممکن است توسط روش ها و همچنین توسط کاربران عادی (\"مشتریان\")" +" یک شی ارجاع داده شوند. به عبارت دیگر، کلاس ها برای پیاده سازی انواع داده " +"های انتزاعی خالص قابل استفاده نیستند. در واقع، هیچ چیز در پایتون امکان " +"اعمال مخفی کردن داده ها را فراهم نمی کند --- همه اینها بر اساس قرارداد است." +" (از سوی دیگر, پیاده‌سازی پایتون که به زبان C نوشته شده است, می‌تواند " +"جزئیات پیاده‌سازی را کاملاً مخفی کند و در صورت لزوم دسترسی به یک شی را کنترل" +" کند؛ این می‌تواند توسط پسوندهای پایتون نوشته شده در C استفاده شود.)" #: tutorial/classes.rst:496 -msgid "Clients should use data attributes with care --- clients may mess up invariants maintained by the methods by stamping on their data attributes. Note that clients may add data attributes of their own to an instance object without affecting the validity of the methods, as long as name conflicts are avoided --- again, a naming convention can save a lot of headaches here." -msgstr "" +#, fuzzy +msgid "" +"Clients should use data attributes with care --- clients may mess up " +"invariants maintained by the methods by stamping on their data attributes. " +"Note that clients may add data attributes of their own to an instance object" +" without affecting the validity of the methods, as long as name conflicts " +"are avoided --- again, a naming convention can save a lot of headaches here." +msgstr "" +"مشتریان باید با احتیاط از ویژگی های داده استفاده کنند --- مشتریان ممکن است " +"با مهر زدن بر روی ویژگی های داده خود، متغیرهای حفظ شده توسط روش ها را خراب " +"کنند. توجه داشته باشید که کلاینت‌ها ممکن است ویژگی‌های داده خود را به یک " +"شیء نمونه اضافه کنند، بدون اینکه بر اعتبار روش‌ها تأثیر بگذارد، تا زمانی که " +"از تضاد نام اجتناب شود --- باز هم، یک قرارداد نام‌گذاری می‌تواند در اینجا " +"سردردهای زیادی را نجات دهد." #: tutorial/classes.rst:502 -msgid "There is no shorthand for referencing data attributes (or other methods!) from within methods. I find that this actually increases the readability of methods: there is no chance of confusing local variables and instance variables when glancing through a method." +#, fuzzy +msgid "" +"There is no shorthand for referencing data attributes (or other methods!) " +"from within methods. I find that this actually increases the readability of" +" methods: there is no chance of confusing local variables and instance " +"variables when glancing through a method." msgstr "" +"هیچ مختصری برای ارجاع ویژگی های داده (یا روش های دیگر!) از درون متدها وجود " +"ندارد. من متوجه شدم که این در واقع خوانایی روش ها را افزایش می دهد: هیچ " +"شانسی برای اشتباه گرفتن متغیرهای محلی و متغیرهای نمونه در هنگام نگاه کردن به" +" یک روش وجود ندارد." #: tutorial/classes.rst:507 -msgid "Often, the first argument of a method is called ``self``. This is nothing more than a convention: the name ``self`` has absolutely no special meaning to Python. Note, however, that by not following the convention your code may be less readable to other Python programmers, and it is also conceivable that a *class browser* program might be written that relies upon such a convention." -msgstr "" +#, fuzzy +msgid "" +"Often, the first argument of a method is called ``self``. This is nothing " +"more than a convention: the name ``self`` has absolutely no special meaning " +"to Python. Note, however, that by not following the convention your code " +"may be less readable to other Python programmers, and it is also conceivable" +" that a *class browser* program might be written that relies upon such a " +"convention." +msgstr "" +"اغلب، اولین آرگومان یک متد ``self`` نامیده می شود. این چیزی بیش از یک " +"قرارداد نیست: نام ``self`` مطلقاً معنای خاصی برای پایتون ندارد. البته توجه " +"داشته باشید که با رعایت نکردن قرارداد ممکن است کد شما برای سایر برنامه " +"نویسان پایتون کمتر قابل خواندن باشد و همچنین می توان تصور کرد که یک برنامه " +"*class browser* ممکن است نوشته شود که بر چنین قراردادی متکی باشد." #: tutorial/classes.rst:513 -msgid "Any function object that is a class attribute defines a method for instances of that class. It is not necessary that the function definition is textually enclosed in the class definition: assigning a function object to a local variable in the class is also ok. For example::" +#, fuzzy +msgid "" +"Any function object that is a class attribute defines a method for instances" +" of that class. It is not necessary that the function definition is " +"textually enclosed in the class definition: assigning a function object to a" +" local variable in the class is also ok. For example::" msgstr "" +"هر شیء تابعی که یک ویژگی کلاس است، متدی را برای نمونه هایی از آن کلاس تعریف " +"می کند. لزومی ندارد که تعریف تابع به صورت متنی در تعریف کلاس باشد: تخصیص یک" +" شی تابع به یک متغیر محلی در کلاس نیز مشکلی ندارد. به عنوان مثال::" #: tutorial/classes.rst:518 -msgid "# Function defined outside the class\n" +#, fuzzy +msgid "" +"# Function defined outside the class\n" "def f1(self, x, y):\n" " return min(x, x+y)\n" "\n" @@ -475,17 +1191,44 @@ msgid "# Function defined outside the class\n" "\n" " h = g" msgstr "" +"# Function defined outside the class\n" +"def f1(self, x, y):\n" +" return min(x, x+y)\n" +"\n" +"class C:\n" +" f = f1\n" +"\n" +" def g(self):\n" +" return 'hello world'\n" +"\n" +" h = g" #: tutorial/classes.rst:530 -msgid "Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that refer to function objects, and consequently they are all methods of instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice usually only serves to confuse the reader of a program." +#, fuzzy +msgid "" +"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that " +"refer to function objects, and consequently they are all methods of " +"instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note " +"that this practice usually only serves to confuse the reader of a program." msgstr "" +"اکنون ``f``، ``g`` و ``h`` همگی ویژگی‌های کلاس :class:`!C` هستند که به اشیاء" +" تابع اشاره می‌کنند، و در نتیجه همه روش‌هایی هستند که نمونه‌هایی از " +":class:`!C` --- ``h`` دقیقاً معادل ``g`` هستند. توجه داشته باشید که این عمل" +" معمولا فقط باعث سردرگمی خواننده یک برنامه می شود." #: tutorial/classes.rst:535 -msgid "Methods may call other methods by using method attributes of the ``self`` argument::" +#, fuzzy +msgid "" +"Methods may call other methods by using method attributes of the ``self`` " +"argument::" msgstr "" +"متدها ممکن است با استفاده از ویژگی های متد آرگومان ``self`` متدهای دیگر را " +"فراخوانی کنند:" #: tutorial/classes.rst:538 -msgid "class Bag:\n" +#, fuzzy +msgid "" +"class Bag:\n" " def __init__(self):\n" " self.data = []\n" "\n" @@ -496,119 +1239,350 @@ msgid "class Bag:\n" " self.add(x)\n" " self.add(x)" msgstr "" +"class Bag:\n" +" def __init__(self):\n" +" self.data = []\n" +"\n" +" def add(self, x):\n" +" self.data.append(x)\n" +"\n" +" def addtwice(self, x):\n" +" self.add(x)\n" +" self.add(x)" #: tutorial/classes.rst:549 -msgid "Methods may reference global names in the same way as ordinary functions. The global scope associated with a method is the module containing its definition. (A class is never used as a global scope.) While one rarely encounters a good reason for using global data in a method, there are many legitimate uses of the global scope: for one thing, functions and modules imported into the global scope can be used by methods, as well as functions and classes defined in it. Usually, the class containing the method is itself defined in this global scope, and in the next section we'll find some good reasons why a method would want to reference its own class." -msgstr "" +#, fuzzy +msgid "" +"Methods may reference global names in the same way as ordinary functions. " +"The global scope associated with a method is the module containing its " +"definition. (A class is never used as a global scope.) While one rarely " +"encounters a good reason for using global data in a method, there are many " +"legitimate uses of the global scope: for one thing, functions and modules " +"imported into the global scope can be used by methods, as well as functions " +"and classes defined in it. Usually, the class containing the method is " +"itself defined in this global scope, and in the next section we'll find some" +" good reasons why a method would want to reference its own class." +msgstr "" +"متدها ممکن است مانند توابع معمولی به نام های سراسری ارجاع دهند. دامنه جهانی" +" مرتبط با یک روش، ماژول حاوی تعریف آن است. (یک کلاس هرگز به عنوان یک دامنه " +"جهانی استفاده نمی شود.) در حالی که به ندرت با دلیل موجهی برای استفاده از " +"داده های سراسری در یک متد مواجه می شوید، استفاده های قانونی زیادی از دامنه " +"جهانی وجود دارد: برای یک چیز، توابع و ماژول های وارد شده به دامنه جهانی را " +"می توان توسط روش ها و همچنین توابع و کلاس های تعریف شده در آن استفاده کرد. " +"معمولاً کلاسی که متد را در بر می گیرد، خود در این محدوده جهانی تعریف می شود،" +" و در بخش بعدی دلایل خوبی برای اینکه یک متد بخواهد به کلاس خود ارجاع دهد، " +"خواهیم یافت." #: tutorial/classes.rst:559 -msgid "Each value is an object, and therefore has a *class* (also called its *type*). It is stored as ``object.__class__``." +#, fuzzy +msgid "" +"Each value is an object, and therefore has a *class* (also called its " +"*type*). It is stored as ``object.__class__``." msgstr "" +"هر مقدار یک شی است و بنابراین دارای یک *class* است (که *type* آن نیز نامیده " +"می شود). به عنوان ``object.__class__`` ذخیره می شود." #: tutorial/classes.rst:566 +#, fuzzy msgid "Inheritance" -msgstr "" +msgstr "ارث" #: tutorial/classes.rst:568 -msgid "Of course, a language feature would not be worthy of the name \"class\" without supporting inheritance. The syntax for a derived class definition looks like this::" +#, fuzzy +msgid "" +"Of course, a language feature would not be worthy of the name \"class\" " +"without supporting inheritance. The syntax for a derived class definition " +"looks like this::" msgstr "" +"البته، یک ویژگی زبان بدون پشتیبانی از وراثت شایسته نام \"کلاس\" نخواهد بود." +" نحو برای تعریف کلاس مشتق شده به صورت زیر است:" #: tutorial/classes.rst:572 -msgid "class DerivedClassName(BaseClassName):\n" +#, fuzzy +msgid "" +"class DerivedClassName(BaseClassName):\n" " \n" " .\n" " .\n" " .\n" " " msgstr "" +"class DerivedClassName(BaseClassName):\n" +" \n" +" .\n" +" .\n" +" .\n" +" " #: tutorial/classes.rst:579 -msgid "The name :class:`!BaseClassName` must be defined in a namespace accessible from the scope containing the derived class definition. In place of a base class name, other arbitrary expressions are also allowed. This can be useful, for example, when the base class is defined in another module::" +#, fuzzy +msgid "" +"The name :class:`!BaseClassName` must be defined in a namespace accessible " +"from the scope containing the derived class definition. In place of a base " +"class name, other arbitrary expressions are also allowed. This can be " +"useful, for example, when the base class is defined in another module::" msgstr "" +"نام :class:`!BaseClassName` باید در یک فضای نام قابل دسترسی از محدوده حاوی " +"تعریف کلاس مشتق شده تعریف شود. به جای نام کلاس پایه، عبارات دلخواه دیگری " +"نیز مجاز هستند. این می تواند مفید باشد، برای مثال، زمانی که کلاس پایه در " +"ماژول دیگری تعریف شده است::" #: tutorial/classes.rst:585 +#, fuzzy msgid "class DerivedClassName(modname.BaseClassName):" -msgstr "" +msgstr "class DerivedClassName(modname.BaseClassName):" #: tutorial/classes.rst:587 -msgid "Execution of a derived class definition proceeds the same as for a base class. When the class object is constructed, the base class is remembered. This is used for resolving attribute references: if a requested attribute is not found in the class, the search proceeds to look in the base class. This rule is applied recursively if the base class itself is derived from some other class." -msgstr "" +#, fuzzy +msgid "" +"Execution of a derived class definition proceeds the same as for a base " +"class. When the class object is constructed, the base class is remembered. " +"This is used for resolving attribute references: if a requested attribute is" +" not found in the class, the search proceeds to look in the base class. " +"This rule is applied recursively if the base class itself is derived from " +"some other class." +msgstr "" +"اجرای تعریف کلاس مشتق شده مانند کلاس پایه پیش می رود. هنگامی که شی کلاس " +"ساخته می شود، کلاس پایه به خاطر سپرده می شود. این برای حل و فصل ارجاعات " +"ویژگی استفاده می شود: اگر ویژگی درخواستی در کلاس یافت نشد، جستجو برای جستجو " +"در کلاس پایه ادامه می یابد. اگر خود کلاس پایه از کلاس دیگری مشتق شده باشد، " +"این قانون به صورت بازگشتی اعمال می شود." #: tutorial/classes.rst:593 -msgid "There's nothing special about instantiation of derived classes: ``DerivedClassName()`` creates a new instance of the class. Method references are resolved as follows: the corresponding class attribute is searched, descending down the chain of base classes if necessary, and the method reference is valid if this yields a function object." -msgstr "" +#, fuzzy +msgid "" +"There's nothing special about instantiation of derived classes: " +"``DerivedClassName()`` creates a new instance of the class. Method " +"references are resolved as follows: the corresponding class attribute is " +"searched, descending down the chain of base classes if necessary, and the " +"method reference is valid if this yields a function object." +msgstr "" +"هیچ چیز خاصی در مورد نمونه سازی کلاس های مشتق شده وجود ندارد: " +"``DerivedClassName()`` یک نمونه جدید از کلاس ایجاد می کند. ارجاعات روش به " +"صورت زیر حل می‌شوند: ویژگی کلاس مربوطه جستجو می‌شود، در صورت لزوم از زنجیره " +"کلاس‌های پایه پایین می‌آید، و مرجع متد در صورتی معتبر است که یک شی تابع را " +"به دست آورد." #: tutorial/classes.rst:599 -msgid "Derived classes may override methods of their base classes. Because methods have no special privileges when calling other methods of the same object, a method of a base class that calls another method defined in the same base class may end up calling a method of a derived class that overrides it. (For C++ programmers: all methods in Python are effectively ``virtual``.)" -msgstr "" +#, fuzzy +msgid "" +"Derived classes may override methods of their base classes. Because methods" +" have no special privileges when calling other methods of the same object, a" +" method of a base class that calls another method defined in the same base " +"class may end up calling a method of a derived class that overrides it. " +"(For C++ programmers: all methods in Python are effectively ``virtual``.)" +msgstr "" +"کلاس های مشتق شده ممکن است روش های کلاس های پایه خود را لغو کنند. از آنجایی" +" که متدها هنگام فراخوانی متدهای دیگر یک شی، امتیاز خاصی ندارند، متدی از یک " +"کلاس پایه که متد دیگری را که در همان کلاس پایه تعریف شده است فراخوانی " +"می‌کند، ممکن است در نهایت متدی از یک کلاس مشتق شده را فراخوانی کند که آن را " +"لغو می‌کند. (برای برنامه نویسان ++C: همه روش ها در پایتون به طور موثر " +"``virtual`` هستند.)" #: tutorial/classes.rst:605 -msgid "An overriding method in a derived class may in fact want to extend rather than simply replace the base class method of the same name. There is a simple way to call the base class method directly: just call ``BaseClassName.methodname(self, arguments)``. This is occasionally useful to clients as well. (Note that this only works if the base class is accessible as ``BaseClassName`` in the global scope.)" -msgstr "" +#, fuzzy +msgid "" +"An overriding method in a derived class may in fact want to extend rather " +"than simply replace the base class method of the same name. There is a " +"simple way to call the base class method directly: just call " +"``BaseClassName.methodname(self, arguments)``. This is occasionally useful " +"to clients as well. (Note that this only works if the base class is " +"accessible as ``BaseClassName`` in the global scope.)" +msgstr "" +"یک متد overriding در یک کلاس مشتق شده ممکن است در واقع بخواهد به جای " +"جایگزینی ساده متد کلاس پایه با همان نام، گسترش یابد. یک راه ساده برای " +"فراخوانی مستقیم متد کلاس پایه وجود دارد: فقط " +"``BaseClassName.methodname(self, arguments)`` را فراخوانی کنید. این گاهی " +"اوقات برای مشتریان نیز مفید است. (توجه داشته باشید که این فقط در صورتی کار " +"می کند که کلاس پایه به عنوان ``BaseClassName`` در محدوده جهانی قابل دسترسی " +"باشد.)" #: tutorial/classes.rst:612 +#, fuzzy msgid "Python has two built-in functions that work with inheritance:" -msgstr "" +msgstr "پایتون دو تابع داخلی دارد که با وراثت کار می کنند:" #: tutorial/classes.rst:614 -msgid "Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)`` will be ``True`` only if ``obj.__class__`` is :class:`int` or some class derived from :class:`int`." +#, fuzzy +msgid "" +"Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)``" +" will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " +"derived from :class:`int`." msgstr "" +"از :func:`isinstance` برای بررسی نوع نمونه استفاده کنید: ``isinstance(obj, " +"int)`` فقط در صورتی ``True`` خواهد بود که ``obj.__class__`` :class:`int` یا " +"کلاسی مشتق شده از :class:`int` باشد." #: tutorial/classes.rst:618 -msgid "Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)`` is ``True`` since :class:`bool` is a subclass of :class:`int`. However, ``issubclass(float, int)`` is ``False`` since :class:`float` is not a subclass of :class:`int`." +#, fuzzy +msgid "" +"Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)``" +" is ``True`` since :class:`bool` is a subclass of :class:`int`. However, " +"``issubclass(float, int)`` is ``False`` since :class:`float` is not a " +"subclass of :class:`int`." msgstr "" +"از :func:`issubclass` برای بررسی وراثت کلاس استفاده کنید: ``issubclass(bool," +" int)`` ``True`` است زیرا :class:`bool` زیر کلاس :class:`int` است. با این " +"حال، ``issubclass(float, int)`` ``False`` است زیرا :class:`float` زیر کلاس " +":class:`int` نیست." #: tutorial/classes.rst:628 +#, fuzzy msgid "Multiple Inheritance" -msgstr "" +msgstr "ارث چندگانه" #: tutorial/classes.rst:630 -msgid "Python supports a form of multiple inheritance as well. A class definition with multiple base classes looks like this::" +#, fuzzy +msgid "" +"Python supports a form of multiple inheritance as well. A class definition " +"with multiple base classes looks like this::" msgstr "" +"پایتون از فرمی از وراثت چندگانه نیز پشتیبانی می کند. یک تعریف کلاس با چندین" +" کلاس پایه به صورت زیر است:" #: tutorial/classes.rst:633 -msgid "class DerivedClassName(Base1, Base2, Base3):\n" +#, fuzzy +msgid "" +"class DerivedClassName(Base1, Base2, Base3):\n" " \n" " .\n" " .\n" " .\n" " " msgstr "" +"class DerivedClassName (Base1, Base2, Base3):\n" +" \n" +" .\n" +" .\n" +" .\n" +" " #: tutorial/classes.rst:640 -msgid "For most purposes, in the simplest cases, you can think of the search for attributes inherited from a parent class as depth-first, left-to-right, not searching twice in the same class where there is an overlap in the hierarchy. Thus, if an attribute is not found in :class:`!DerivedClassName`, it is searched for in :class:`!Base1`, then (recursively) in the base classes of :class:`!Base1`, and if it was not found there, it was searched for in :class:`!Base2`, and so on." -msgstr "" +#, fuzzy +msgid "" +"For most purposes, in the simplest cases, you can think of the search for " +"attributes inherited from a parent class as depth-first, left-to-right, not " +"searching twice in the same class where there is an overlap in the " +"hierarchy. Thus, if an attribute is not found in :class:`!DerivedClassName`," +" it is searched for in :class:`!Base1`, then (recursively) in the base " +"classes of :class:`!Base1`, and if it was not found there, it was searched " +"for in :class:`!Base2`, and so on." +msgstr "" +"برای بیشتر اهداف، در ساده‌ترین موارد، می‌توانید جستجوی ویژگی‌های به ارث " +"رسیده از یک کلاس والد را به‌عنوان depth-first، از چپ به راست در نظر بگیرید، " +"نه دوبار جستجو در یک کلاس که در آن همپوشانی در سلسله مراتب وجود دارد. " +"بنابراین، اگر یک ویژگی در :class:`!DerivedClassName` یافت نشد، در " +":class:`!Base1` جستجو می شود، سپس (به صورت بازگشتی) در کلاس های پایه " +":class:`!Base1`، و اگر در آنجا یافت نشد، در :class:`!Base2` و غیره جستجو می " +"شود." #: tutorial/classes.rst:647 -msgid "In fact, it is slightly more complex than that; the method resolution order changes dynamically to support cooperative calls to :func:`super`. This approach is known in some other multiple-inheritance languages as call-next-method and is more powerful than the super call found in single-inheritance languages." +#, fuzzy +msgid "" +"In fact, it is slightly more complex than that; the method resolution order " +"changes dynamically to support cooperative calls to :func:`super`. This " +"approach is known in some other multiple-inheritance languages as call-next-" +"method and is more powerful than the super call found in single-inheritance " +"languages." msgstr "" +"در واقع، کمی پیچیده تر از آن است. ترتیب تفکیک روش به صورت پویا تغییر می کند " +"تا از فراخوان های مشارکتی به :func:`super` پشتیبانی کند. این رویکرد در برخی" +" دیگر از زبان‌های ارثی چندگانه به روش فراخوانی بعدی معروف است و قدرتمندتر از" +" فراخوانی موجود در زبان‌های ارثی تک است." #: tutorial/classes.rst:653 -msgid "Dynamic ordering is necessary because all cases of multiple inheritance exhibit one or more diamond relationships (where at least one of the parent classes can be accessed through multiple paths from the bottommost class). For example, all classes inherit from :class:`object`, so any case of multiple inheritance provides more than one path to reach :class:`object`. To keep the base classes from being accessed more than once, the dynamic algorithm linearizes the search order in a way that preserves the left-to-right ordering specified in each class, that calls each parent only once, and that is monotonic (meaning that a class can be subclassed without affecting the precedence order of its parents). Taken together, these properties make it possible to design reliable and extensible classes with multiple inheritance. For more detail, see :ref:`python_2.3_mro`." -msgstr "" +#, fuzzy +msgid "" +"Dynamic ordering is necessary because all cases of multiple inheritance " +"exhibit one or more diamond relationships (where at least one of the parent " +"classes can be accessed through multiple paths from the bottommost class). " +"For example, all classes inherit from :class:`object`, so any case of " +"multiple inheritance provides more than one path to reach :class:`object`. " +"To keep the base classes from being accessed more than once, the dynamic " +"algorithm linearizes the search order in a way that preserves the left-to-" +"right ordering specified in each class, that calls each parent only once, " +"and that is monotonic (meaning that a class can be subclassed without " +"affecting the precedence order of its parents). Taken together, these " +"properties make it possible to design reliable and extensible classes with " +"multiple inheritance. For more detail, see :ref:`python_2.3_mro`." +msgstr "" +"ترتیب پویا ضروری است زیرا همه موارد ارث چندگانه یک یا چند رابطه الماس را " +"نشان می‌دهند (که در آن حداقل یکی از کلاس‌های والد از طریق چندین مسیر از " +"پایین‌ترین کلاس قابل دسترسی است). برای مثال، همه کلاس‌ها از :class:`object`" +" ارث می‌برند، بنابراین هر مورد وراثت چندگانه، بیش از یک مسیر را برای رسیدن " +"به :class:`object` فراهم می‌کند. برای جلوگیری از دسترسی به کلاس های پایه " +"بیش از یک بار، الگوریتم پویا ترتیب جستجو را به گونه ای خطی می کند که ترتیب " +"چپ به راست مشخص شده در هر کلاس را حفظ می کند، که هر والد را فقط یک بار " +"فراخوانی می کند، و این یکنواخت است (به این معنی که یک کلاس می تواند بدون " +"تأثیر بر ترتیب اولویت والدینش, زیر طبقه بندی شود). در مجموع، این ویژگی ها " +"طراحی کلاس های قابل اعتماد و توسعه پذیر با ارث چندگانه را ممکن می سازد. " +"برای جزئیات بیشتر، به :ref:`python_2.3_mro` مراجعه کنید." #: tutorial/classes.rst:670 +#, fuzzy msgid "Private Variables" -msgstr "" +msgstr "متغیرهای خصوصی" #: tutorial/classes.rst:672 -msgid "\"Private\" instance variables that cannot be accessed except from inside an object don't exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with an underscore (e.g. ``_spam``) should be treated as a non-public part of the API (whether it is a function, a method or a data member). It should be considered an implementation detail and subject to change without notice." -msgstr "" +#, fuzzy +msgid "" +"\"Private\" instance variables that cannot be accessed except from inside an" +" object don't exist in Python. However, there is a convention that is " +"followed by most Python code: a name prefixed with an underscore (e.g. " +"``_spam``) should be treated as a non-public part of the API (whether it is " +"a function, a method or a data member). It should be considered an " +"implementation detail and subject to change without notice." +msgstr "" +"متغیرهای نمونه \"خصوصی\" که جز از داخل یک شی قابل دسترسی نیستند، در پایتون " +"وجود ندارند. با این حال، قراردادی وجود دارد که اکثر کدهای پایتون از آن " +"پیروی می کنند: نامی که پیشوند آن زیرخط است (مثلاً ``_spam``) باید به عنوان " +"بخشی غیرعمومی از API در نظر گرفته شود (خواه یک تابع, یک متد یا یک عضو داده " +"باشد). باید جزییات اجرایی در نظر گرفته شود و بدون اطلاع قبلی قابل تغییر " +"باشد." #: tutorial/classes.rst:682 -msgid "Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called :dfn:`name mangling`. Any identifier of the form ``__spam`` (at least two leading underscores, at most one trailing underscore) is textually replaced with ``_classname__spam``, where ``classname`` is the current class name with leading underscore(s) stripped. This mangling is done without regard to the syntactic position of the identifier, as long as it occurs within the definition of a class." -msgstr "" +#, fuzzy +msgid "" +"Since there is a valid use-case for class-private members (namely to avoid " +"name clashes of names with names defined by subclasses), there is limited " +"support for such a mechanism, called :dfn:`name mangling`. Any identifier " +"of the form ``__spam`` (at least two leading underscores, at most one " +"trailing underscore) is textually replaced with ``_classname__spam``, where " +"``classname`` is the current class name with leading underscore(s) stripped." +" This mangling is done without regard to the syntactic position of the " +"identifier, as long as it occurs within the definition of a class." +msgstr "" +"از آنجایی که یک مورد استفاده معتبر برای اعضای کلاس خصوصی وجود دارد (یعنی " +"برای جلوگیری از تداخل نام نام‌ها با نام‌هایی که توسط کلاس‌های فرعی تعریف " +"شده‌اند), پشتیبانی محدودی از چنین مکانیزمی به نام :dfn:`name mangling` وجود " +"دارد. هر شناسه ای از فرم ``__spam`` (حداقل دو زیرخط اصلی, حداکثر یک زیرخط " +"آخر) به صورت متنی با ``_classname__spam`` جایگزین می شود، که در آن " +"``classname`` نام کلاس فعلی با زیرخط(های) ابتدایی حذف شده است. این اختلاط " +"بدون توجه به موقعیت نحوی شناسه انجام می شود، تا زمانی که در تعریف یک کلاس رخ" +" دهد." #: tutorial/classes.rst:693 -msgid "The :ref:`private name mangling specifications ` for details and special cases." +#, fuzzy +msgid "" +"The :ref:`private name mangling specifications ` for " +"details and special cases." msgstr "" +":ref:`private name mangling specifications ` برای " +"جزئیات و موارد خاص." #: tutorial/classes.rst:696 -msgid "Name mangling is helpful for letting subclasses override methods without breaking intraclass method calls. For example::" +#, fuzzy +msgid "" +"Name mangling is helpful for letting subclasses override methods without " +"breaking intraclass method calls. For example::" msgstr "" +"مخفی کردن نام برای اجازه دادن به زیر کلاس‌ها بدون شکستن فراخوانی‌های متد " +"درون‌کلاسی، نادیده گرفته می‌شود. به عنوان مثال::" #: tutorial/classes.rst:699 -msgid "class Mapping:\n" +#, fuzzy +msgid "" +"class Mapping:\n" " def __init__(self, iterable):\n" " self.items_list = []\n" " self.__update(iterable)\n" @@ -627,29 +1601,84 @@ msgid "class Mapping:\n" " for item in zip(keys, values):\n" " self.items_list.append(item)" msgstr "" +"class Mapping:\n" +" def __init__(self, iterable):\n" +" self.items_list = []\n" +" self.__update(iterable)\n" +"\n" +" def update(self, iterable):\n" +" for item in iterable:\n" +" self.items_list.append(item)\n" +"\n" +" __update = update # private copy of original update() method\n" +"\n" +"class MappingSubclass(Mapping):\n" +"\n" +" def update(self, keys, values):\n" +" # provides new signature for update()\n" +" # but does not break __init__()\n" +" for item in zip(keys, values):\n" +" self.items_list.append(item)" #: tutorial/classes.rst:718 -msgid "The above example would work even if ``MappingSubclass`` were to introduce a ``__update`` identifier since it is replaced with ``_Mapping__update`` in the ``Mapping`` class and ``_MappingSubclass__update`` in the ``MappingSubclass`` class respectively." +#, fuzzy +msgid "" +"The above example would work even if ``MappingSubclass`` were to introduce a" +" ``__update`` identifier since it is replaced with ``_Mapping__update`` in " +"the ``Mapping`` class and ``_MappingSubclass__update`` in the " +"``MappingSubclass`` class respectively." msgstr "" +"مثال بالا حتی اگر ``MappingSubclass`` یک شناسه ``__update`` معرفی کند کار می" +" کند زیرا به ترتیب با ``_Mapping__update`` در کلاس ``Mapping`` و " +"``_MappingSubclass__update`` در کلاس ``MappingSubclass`` جایگزین شده است." #: tutorial/classes.rst:723 -msgid "Note that the mangling rules are designed mostly to avoid accidents; it still is possible to access or modify a variable that is considered private. This can even be useful in special circumstances, such as in the debugger." +#, fuzzy +msgid "" +"Note that the mangling rules are designed mostly to avoid accidents; it " +"still is possible to access or modify a variable that is considered private." +" This can even be useful in special circumstances, such as in the debugger." msgstr "" +"توجه داشته باشید که قوانین انحراف بیشتر برای جلوگیری از حوادث طراحی شده اند." +" هنوز هم می توان به متغیری که خصوصی در نظر گرفته می شود دسترسی پیدا کرد یا " +"تغییر داد. این حتی می‌تواند در شرایط خاص، مانند دیباگر، مفید باشد." #: tutorial/classes.rst:727 -msgid "Notice that code passed to ``exec()`` or ``eval()`` does not consider the classname of the invoking class to be the current class; this is similar to the effect of the ``global`` statement, the effect of which is likewise restricted to code that is byte-compiled together. The same restriction applies to ``getattr()``, ``setattr()`` and ``delattr()``, as well as when referencing ``__dict__`` directly." -msgstr "" +#, fuzzy +msgid "" +"Notice that code passed to ``exec()`` or ``eval()`` does not consider the " +"classname of the invoking class to be the current class; this is similar to " +"the effect of the ``global`` statement, the effect of which is likewise " +"restricted to code that is byte-compiled together. The same restriction " +"applies to ``getattr()``, ``setattr()`` and ``delattr()``, as well as when " +"referencing ``__dict__`` directly." +msgstr "" +"توجه داشته باشید که کد ارسال شده به ``exec()`` یا ``eval()`` نام کلاس کلاس " +"فراخوانی را کلاس فعلی در نظر نمی گیرد. این شبیه به اثر دستور ``global`` است،" +" که اثر آن نیز محدود به کدهایی است که با هم کامپایل شده اند. همین محدودیت " +"برای ``getattr()``، ``setattr()`` و ``delattr()``، و همچنین هنگام ارجاع " +"مستقیم به ``__dict__`` اعمال می شود." #: tutorial/classes.rst:738 +#, fuzzy msgid "Odds and Ends" -msgstr "" +msgstr "Odds and Ends" #: tutorial/classes.rst:740 -msgid "Sometimes it is useful to have a data type similar to the Pascal \"record\" or C \"struct\", bundling together a few named data items. The idiomatic approach is to use :mod:`dataclasses` for this purpose::" +#, fuzzy +msgid "" +"Sometimes it is useful to have a data type similar to the Pascal \"record\" " +"or C \"struct\", bundling together a few named data items. The idiomatic " +"approach is to use :mod:`dataclasses` for this purpose::" msgstr "" +"گاهی اوقات مفید است که یک نوع داده شبیه به پاسکال \"Record\" یا C \"struct\"" +" داشته باشید که چند مورد داده نامگذاری شده را با هم ترکیب می کند. رویکرد " +"اصطلاحی استفاده از :mod:`dataclasses` برای این منظور است:" #: tutorial/classes.rst:744 -msgid "from dataclasses import dataclass\n" +#, fuzzy +msgid "" +"from dataclasses import dataclass\n" "\n" "@dataclass\n" "class Employee:\n" @@ -657,33 +1686,77 @@ msgid "from dataclasses import dataclass\n" " dept: str\n" " salary: int" msgstr "" +"from dataclasses import dataclass\n" +"\n" +"@dataclass\n" +"class Employee:\n" +" name: str\n" +" dept: str\n" +" salary: int" #: tutorial/classes.rst:754 -msgid ">>> john = Employee('john', 'computer lab', 1000)\n" +#, fuzzy +msgid "" +">>> john = Employee('john', 'computer lab', 1000)\n" ">>> john.dept\n" "'computer lab'\n" ">>> john.salary\n" "1000" msgstr "" +">>> john = Employee('john', 'computer lab', 1000)\n" +">>> john.dept\n" +"'computer lab'\n" +">>> john.salary\n" +"1000" #: tutorial/classes.rst:760 -msgid "A piece of Python code that expects a particular abstract data type can often be passed a class that emulates the methods of that data type instead. For instance, if you have a function that formats some data from a file object, you can define a class with methods :meth:`~io.TextIOBase.read` and :meth:`~io.TextIOBase.readline` that get the data from a string buffer instead, and pass it as an argument." -msgstr "" +#, fuzzy +msgid "" +"A piece of Python code that expects a particular abstract data type can " +"often be passed a class that emulates the methods of that data type instead." +" For instance, if you have a function that formats some data from a file " +"object, you can define a class with methods :meth:`~io.TextIOBase.read` and " +":meth:`~io.TextIOBase.readline` that get the data from a string buffer " +"instead, and pass it as an argument." +msgstr "" +"قطعه ای از کد پایتون که انتظار یک نوع داده انتزاعی خاص را دارد، اغلب می " +"تواند به کلاسی منتقل شود که به جای آن روش های آن نوع داده را شبیه سازی می " +"کند. به عنوان مثال، اگر تابعی دارید که برخی از داده‌ها را از یک شی فایل " +"قالب‌بندی می‌کند، می‌توانید کلاسی را با متدهای :meth:`~io.TextIOBase.read` و" +" :meth:`~io.TextIOBase.readline` تعریف کنید که به جای آن داده‌ها را از یک " +"بافر رشته‌ای دریافت کرده و به عنوان آرگومان ارسال کنید." #: tutorial/classes.rst:772 -msgid ":ref:`Instance method objects ` have attributes, too: :attr:`m.__self__ ` is the instance object with the method :meth:`!m`, and :attr:`m.__func__ ` is the :ref:`function object ` corresponding to the method." +#, fuzzy +msgid "" +":ref:`Instance method objects ` have attributes, too: " +":attr:`m.__self__ ` is the instance object with the method " +":meth:`!m`, and :attr:`m.__func__ ` is the :ref:`function " +"object ` corresponding to the method." msgstr "" +":ref:`Instance method objects ` نیز ویژگی هایی دارد: " +":attr:`m.__self__ ` شی نمونه با متد :meth:`!m` است و " +":attr:`m.__func__ ` :ref:`function object ` مربوط به متد است." #: tutorial/classes.rst:782 +#, fuzzy msgid "Iterators" -msgstr "" +msgstr "تکرار کننده ها" #: tutorial/classes.rst:784 -msgid "By now you have probably noticed that most container objects can be looped over using a :keyword:`for` statement::" +#, fuzzy +msgid "" +"By now you have probably noticed that most container objects can be looped " +"over using a :keyword:`for` statement::" msgstr "" +"احتمالاً تا به حال متوجه شده اید که بیشتر اشیاء کانتینر را می توان با " +"استفاده از دستور :keyword:`for` حلقه کرد:" #: tutorial/classes.rst:787 -msgid "for element in [1, 2, 3]:\n" +#, fuzzy +msgid "" +"for element in [1, 2, 3]:\n" " print(element)\n" "for element in (1, 2, 3):\n" " print(element)\n" @@ -694,13 +1767,44 @@ msgid "for element in [1, 2, 3]:\n" "for line in open(\"myfile.txt\"):\n" " print(line, end='')" msgstr "" +"for element in [1, 2, 3]:\n" +" print(element)\n" +"for element in (1, 2, 3):\n" +" print(element)\n" +"for key in {'one':1, 'two':2}:\n" +" print(key)\n" +"for char in \"123\":\n" +" print(char)\n" +"for line in open(\"myfile.txt\"):\n" +" print(line, end='')" #: tutorial/classes.rst:798 -msgid "This style of access is clear, concise, and convenient. The use of iterators pervades and unifies Python. Behind the scenes, the :keyword:`for` statement calls :func:`iter` on the container object. The function returns an iterator object that defines the method :meth:`~iterator.__next__` which accesses elements in the container one at a time. When there are no more elements, :meth:`~iterator.__next__` raises a :exc:`StopIteration` exception which tells the :keyword:`!for` loop to terminate. You can call the :meth:`~iterator.__next__` method using the :func:`next` built-in function; this example shows how it all works::" -msgstr "" +#, fuzzy +msgid "" +"This style of access is clear, concise, and convenient. The use of " +"iterators pervades and unifies Python. Behind the scenes, the " +":keyword:`for` statement calls :func:`iter` on the container object. The " +"function returns an iterator object that defines the method " +":meth:`~iterator.__next__` which accesses elements in the container one at a" +" time. When there are no more elements, :meth:`~iterator.__next__` raises a" +" :exc:`StopIteration` exception which tells the :keyword:`!for` loop to " +"terminate. You can call the :meth:`~iterator.__next__` method using the " +":func:`next` built-in function; this example shows how it all works::" +msgstr "" +"این سبک دسترسی واضح، مختصر و راحت است. استفاده از تکرار کننده ها پایتون را " +"فرا گرفته و یکپارچه می کند. در پشت صحنه، دستور :keyword:`for` :func:`iter` " +"را روی شی کانتینر فراخوانی می کند. تابع یک شی تکرار کننده را برمی گرداند که" +" متد :meth:`~iterator.__next__` را تعریف می کند که به عناصر موجود در کانتینر" +" در یک زمان دسترسی پیدا می کند. هنگامی که هیچ عنصر دیگری وجود ندارد، " +":meth:`~iterator.__next__` یک استثنای :exc:`StopIteration` را ایجاد می کند " +"که به حلقه :keyword:`!for` می گوید خاتمه یابد. با استفاده از تابع داخلی " +":func:`next` می توانید روش :meth:`~iterator.__next__` را فراخوانی کنید. این " +"مثال نشان می دهد که چگونه همه چیز کار می کند::" #: tutorial/classes.rst:807 -msgid ">>> s = 'abc'\n" +#, fuzzy +msgid "" +">>> s = 'abc'\n" ">>> it = iter(s)\n" ">>> it\n" "\n" @@ -716,13 +1820,40 @@ msgid ">>> s = 'abc'\n" " next(it)\n" "StopIteration" msgstr "" +">>> s = 'abc'\n" +">>> آن = تکرار (ها)\n" +">>> آن را\n" +"\n" +">>> بعدی (آن)\n" +"'a'\n" +">>> بعدی (آن)\n" +"'ب'\n" +">>> بعدی (آن)\n" +"'ج'\n" +">>> بعدی (آن)\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +" بعدی (آن)\n" +"توقف تکرار" #: tutorial/classes.rst:823 -msgid "Having seen the mechanics behind the iterator protocol, it is easy to add iterator behavior to your classes. Define an :meth:`~container.__iter__` method which returns an object with a :meth:`~iterator.__next__` method. If the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return ``self``::" +#, fuzzy +msgid "" +"Having seen the mechanics behind the iterator protocol, it is easy to add " +"iterator behavior to your classes. Define an :meth:`~container.__iter__` " +"method which returns an object with a :meth:`~iterator.__next__` method. If" +" the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return" +" ``self``::" msgstr "" +"با مشاهده مکانیزم های پشت پروتکل تکرار کننده، اضافه کردن رفتار تکرار کننده " +"به کلاس های خود آسان است. یک متد :meth:`~container.__iter__` تعریف کنید که " +"یک شی را با متد :meth:`~iterator.__next__` برمی گرداند. اگر کلاس " +":meth:`!__next__` را تعریف کند، :meth:`!__iter__` فقط می تواند ``self``::" #: tutorial/classes.rst:828 -msgid "class Reverse:\n" +#, fuzzy +msgid "" +"class Reverse:\n" " \"\"\"Iterator for looping over a sequence backwards.\"\"\"\n" " def __init__(self, data):\n" " self.data = data\n" @@ -737,9 +1868,25 @@ msgid "class Reverse:\n" " self.index = self.index - 1\n" " return self.data[self.index]" msgstr "" +"class Reverse:\n" +" \"\"\"Iterator for looping over a sequence backwards.\"\"\"\n" +" def __init__(self, data):\n" +" self.data = data\n" +" self.index = len(data)\n" +"\n" +" def __iter__(self):\n" +" return self\n" +"\n" +" def __next__(self):\n" +" if self.index == 0:\n" +" raise StopIteration\n" +" self.index = self.index - 1\n" +" return self.data[self.index]" #: tutorial/classes.rst:845 -msgid ">>> rev = Reverse('spam')\n" +#, fuzzy +msgid "" +">>> rev = Reverse('spam')\n" ">>> iter(rev)\n" "<__main__.Reverse object at 0x00A1DB50>\n" ">>> for char in rev:\n" @@ -750,23 +1897,54 @@ msgid ">>> rev = Reverse('spam')\n" "p\n" "s" msgstr "" +">>> rev = معکوس ('spam')\n" +">>> تکرار (شور)\n" +"<__main__. معکوس شی در 0x00A1DB50>\n" +">>> برای کاراکتر در دور:\n" +"... چاپ (کارت)\n" +"...\n" +"متر\n" +"الف\n" +"ص\n" +"س" #: tutorial/classes.rst:860 +#, fuzzy msgid "Generators" -msgstr "" +msgstr "ژنراتورها" #: tutorial/classes.rst:862 -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 "" +#, fuzzy +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` بر روی آن فراخوانی می شود، ژنراتور از همان جایی که متوقف شده " +"بود از سر گرفته می شود (همه مقادیر داده را به خاطر می آورد و آخرین دستوری که" +" اجرا شده است). یک مثال نشان می دهد که ایجاد ژنراتورها بسیار ساده است:" #: tutorial/classes.rst:869 -msgid "def reverse(data):\n" +#, fuzzy +msgid "" +"def reverse(data):\n" " for index in range(len(data)-1, -1, -1):\n" " yield data[index]" msgstr "" +"def reverse(data):\n" +" for index in range(len(data)-1, -1, -1):\n" +" yield data[index]" #: tutorial/classes.rst:875 -msgid ">>> for char in reverse('golf'):\n" +#, fuzzy +msgid "" +">>> for char in reverse('golf'):\n" "... print(char)\n" "...\n" "f\n" @@ -774,33 +1952,83 @@ msgid ">>> for char in reverse('golf'):\n" "o\n" "g" msgstr "" +">>> for char in reverse('golf'):\n" +"... print(char)\n" +"...\n" +"f\n" +"l\n" +"o\n" +"g" #: tutorial/classes.rst:883 -msgid "Anything that can be done with generators can also be done with class-based iterators as described in the previous section. What makes generators so compact is that the :meth:`~iterator.__iter__` and :meth:`~generator.__next__` methods are created automatically." +#, fuzzy +msgid "" +"Anything that can be done with generators can also be done with class-based " +"iterators as described in the previous section. What makes generators so " +"compact is that the :meth:`~iterator.__iter__` and " +":meth:`~generator.__next__` methods are created automatically." msgstr "" +"هر کاری را که بتوان با ژنراتورها انجام داد، می‌تواند با تکرارکننده‌های مبتنی" +" بر کلاس نیز همانطور که در بخش قبل توضیح داده شد، انجام داد. چیزی که " +"ژنراتورها را بسیار فشرده می کند این است که متدهای :meth:`~iterator.__iter__`" +" و :meth:`~generator.__next__` به طور خودکار ایجاد می شوند." #: tutorial/classes.rst:888 -msgid "Another key feature is that the local variables and execution state are automatically saved between calls. This made the function easier to write and much more clear than an approach using instance variables like ``self.index`` and ``self.data``." +#, fuzzy +msgid "" +"Another key feature is that the local variables and execution state are " +"automatically saved between calls. This made the function easier to write " +"and much more clear than an approach using instance variables like " +"``self.index`` and ``self.data``." msgstr "" +"یکی دیگر از ویژگی های کلیدی این است که متغیرهای محلی و وضعیت اجرا به طور " +"خودکار بین تماس ها ذخیره می شوند. این کار نوشتن تابع را آسان‌تر و واضح‌تر " +"از رویکردی با استفاده از متغیرهای نمونه مانند ``self.index`` و ``self.data``" +" کرد." #: tutorial/classes.rst:893 -msgid "In addition to automatic method creation and saving program state, when generators terminate, they automatically raise :exc:`StopIteration`. In combination, these features make it easy to create iterators with no more effort than writing a regular function." +#, fuzzy +msgid "" +"In addition to automatic method creation and saving program state, when " +"generators terminate, they automatically raise :exc:`StopIteration`. In " +"combination, these features make it easy to create iterators with no more " +"effort than writing a regular function." msgstr "" +"علاوه بر ایجاد روش خودکار و ذخیره وضعیت برنامه، هنگامی که ژنراتورها خاتمه می" +" یابند، به طور خودکار :exc:`StopIteration` را افزایش می دهند. در ترکیب، این " +"ویژگی ها ایجاد تکرار کننده ها را بدون تلاش بیشتر از نوشتن یک تابع معمولی " +"آسان می کند." #: tutorial/classes.rst:902 +#, fuzzy msgid "Generator Expressions" -msgstr "" +msgstr "عبارات ژنراتور" #: tutorial/classes.rst:904 -msgid "Some simple generators can be coded succinctly as expressions using a syntax similar to list comprehensions but with parentheses instead of square brackets. These expressions are designed for situations where the generator is used right away by an enclosing function. Generator expressions are more compact but less versatile than full generator definitions and tend to be more memory friendly than equivalent list comprehensions." -msgstr "" +#, fuzzy +msgid "" +"Some simple generators can be coded succinctly as expressions using a syntax" +" similar to list comprehensions but with parentheses instead of square " +"brackets. These expressions are designed for situations where the generator " +"is used right away by an enclosing function. Generator expressions are more" +" compact but less versatile than full generator definitions and tend to be " +"more memory friendly than equivalent list comprehensions." +msgstr "" +"برخی از مولدهای ساده را می توان به طور خلاصه به عنوان عبارات با استفاده از " +"نحوی شبیه به درک لیست اما با پرانتز به جای پرانتز کدگذاری کرد. این عبارات " +"برای موقعیت هایی طراحی شده اند که ژنراتور بلافاصله توسط یک تابع محصور کننده " +"استفاده می شود. عبارات ژنراتور نسبت به تعاریف کامل مولد فشرده تر اما تطبیق " +"پذیری کمتری دارند و نسبت به درک لیست های معادل، حافظه دوستانه بیشتری دارند." #: tutorial/classes.rst:911 +#, fuzzy msgid "Examples::" -msgstr "" +msgstr "مثال ها::" #: tutorial/classes.rst:913 -msgid ">>> sum(i*i for i in range(10)) # sum of squares\n" +#, fuzzy +msgid "" +">>> sum(i*i for i in range(10)) # sum of squares\n" "285\n" "\n" ">>> xvec = [10, 20, 30]\n" @@ -816,27 +2044,59 @@ msgid ">>> sum(i*i for i in range(10)) # sum of squares\n" ">>> list(data[i] for i in range(len(data)-1, -1, -1))\n" "['f', 'l', 'o', 'g']" msgstr "" +">>> sum(i*i for i in range(10)) # sum of squares\n" +"285\n" +"\n" +">>> xvec = [10, 20, 30]\n" +">>> yvec = [7, 5, 3]\n" +">>> sum(x*y for x,y in zip(xvec, yvec)) # dot product\n" +"260\n" +"\n" +">>> unique_words = set(word for line in page for word in line.split())\n" +"\n" +">>> valedictorian = max((student.gpa, student.name) for student in graduates)\n" +"\n" +">>> data = 'golf'\n" +">>> list(data[i] for i in range(len(data)-1, -1, -1))\n" +"['f', 'l', 'o', 'g']" #: tutorial/classes.rst:932 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/classes.rst:933 -msgid "Except for one thing. Module objects have a secret read-only attribute called :attr:`~object.__dict__` which returns the dictionary used to implement the module's namespace; the name ``__dict__`` is an attribute but not a global name. Obviously, using this violates the abstraction of namespace implementation, and should be restricted to things like post-mortem debuggers." -msgstr "" +#, fuzzy +msgid "" +"Except for one thing. Module objects have a secret read-only attribute " +"called :attr:`~object.__dict__` which returns the dictionary used to " +"implement the module's namespace; the name ``__dict__`` is an attribute but " +"not a global name. Obviously, using this violates the abstraction of " +"namespace implementation, and should be restricted to things like post-" +"mortem debuggers." +msgstr "" +"به جز یک چیز اشیاء ماژول دارای یک ویژگی مخفی فقط خواندنی به نام " +":attr:`~object.__dict__` هستند که فرهنگ لغت مورد استفاده برای پیاده سازی " +"فضای نام ماژول را برمی گرداند. نام ``__dict__`` یک ویژگی است اما یک نام " +"جهانی نیست. بدیهی است که استفاده از این انتزاع پیاده سازی فضای نام را نقض می" +" کند و باید به مواردی مانند اشکال زدایی پس از مرگ محدود شود." #: tutorial/classes.rst:343 +#, fuzzy msgid "object" -msgstr "" +msgstr "شی" #: tutorial/classes.rst:343 +#, fuzzy msgid "method" -msgstr "" +msgstr "روش" #: tutorial/classes.rst:679 +#, fuzzy msgid "name" -msgstr "" +msgstr "نام" #: tutorial/classes.rst:679 +#, fuzzy msgid "mangling" -msgstr "" +msgstr "درهم ریختن" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index bc3bb52c..f62ea0cd 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -17,23 +17,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/controlflow.rst:5 +#, fuzzy msgid "More Control Flow Tools" -msgstr "" +msgstr "ابزارهای کنترل جریان بیشتر" #: tutorial/controlflow.rst:7 -msgid "As well as the :keyword:`while` statement just introduced, Python uses a few more that we will encounter in this chapter." +#, fuzzy +msgid "" +"As well as the :keyword:`while` statement just introduced, Python uses a few" +" more that we will encounter in this chapter." msgstr "" +"علاوه بر دستور :keyword:`while` که به تازگی معرفی شد، پایتون از چند مورد " +"دیگر نیز استفاده می کند که در این فصل با آن ها مواجه خواهیم شد." #: tutorial/controlflow.rst:14 +#, fuzzy msgid ":keyword:`!if` Statements" -msgstr "" +msgstr "بیانیه های :keyword:`!if`" #: tutorial/controlflow.rst:16 -msgid "Perhaps the most well-known statement type is the :keyword:`if` statement. For example::" +#, fuzzy +msgid "" +"Perhaps the most well-known statement type is the :keyword:`if` statement. " +"For example::" msgstr "" +"شاید شناخته شده ترین نوع عبارت عبارت :keyword:`if` باشد. به عنوان مثال::" #: tutorial/controlflow.rst:19 -msgid ">>> x = int(input(\"Please enter an integer: \"))\n" +#, fuzzy +msgid "" +">>> x = int(input(\"Please enter an integer: \"))\n" "Please enter an integer: 42\n" ">>> if x < 0:\n" "... x = 0\n" @@ -47,25 +60,73 @@ msgid ">>> x = int(input(\"Please enter an integer: \"))\n" "...\n" "More" msgstr "" +">>> x = int(input(\"لطفا یک عدد صحیح وارد کنید:\"))\n" +"لطفا یک عدد صحیح وارد کنید: 42\n" +">>> اگر x < 0:\n" +"... x = 0\n" +"... چاپ (\"منفی به صفر تغییر کرد\")\n" +"... elif x == 0:\n" +"... چاپ (\"صفر\")\n" +"... elif x == 1:\n" +"... چاپ (\"تک\")\n" +"... دیگر:\n" +"... چاپ (\"بیشتر\")\n" +"...\n" +"بیشتر" #: tutorial/controlflow.rst:33 -msgid "There can be zero or more :keyword:`elif` parts, and the :keyword:`else` part is optional. The keyword ':keyword:`!elif`' is short for 'else if', and is useful to avoid excessive indentation. An :keyword:`!if` ... :keyword:`!elif` ... :keyword:`!elif` ... sequence is a substitute for the ``switch`` or ``case`` statements found in other languages." -msgstr "" +#, fuzzy +msgid "" +"There can be zero or more :keyword:`elif` parts, and the :keyword:`else` " +"part is optional. The keyword ':keyword:`!elif`' is short for 'else if', " +"and is useful to avoid excessive indentation. An :keyword:`!if` ... " +":keyword:`!elif` ... :keyword:`!elif` ... sequence is a substitute for the " +"``switch`` or ``case`` statements found in other languages." +msgstr "" +"ممکن است تعداد قطعات :keyword:`elif` صفر یا بیشتر باشد و قسمت " +":keyword:`else` اختیاری است. کلمه کلیدی ':keyword:`!elif`' مخفف 'alse if' " +"است و برای جلوگیری از فرورفتگی بیش از حد مفید است. یک دنباله :keyword:`!if`" +" ... :keyword:`!elif` ... :keyword:`!elif` ... جایگزینی برای دستورات " +"``switch`` یا ``case`` موجود در زبان های دیگر است." #: tutorial/controlflow.rst:39 -msgid "If you're comparing the same value to several constants, or checking for specific types or attributes, you may also find the :keyword:`!match` statement useful. For more details see :ref:`tut-match`." +#, fuzzy +msgid "" +"If you're comparing the same value to several constants, or checking for " +"specific types or attributes, you may also find the :keyword:`!match` " +"statement useful. For more details see :ref:`tut-match`." msgstr "" +"اگر مقدار یکسانی را با چندین ثابت مقایسه می‌کنید، یا انواع یا ویژگی‌های خاصی" +" را بررسی می‌کنید، ممکن است دستور :keyword:`!match` را نیز مفید بدانید. برای" +" جزئیات بیشتر به :ref:`tut-match` مراجعه کنید." #: tutorial/controlflow.rst:46 +#, fuzzy msgid ":keyword:`!for` Statements" -msgstr "" +msgstr "بیانیه های :keyword:`!for`" #: tutorial/controlflow.rst:51 -msgid "The :keyword:`for` statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python's :keyword:`!for` statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended):" -msgstr "" +#, fuzzy +msgid "" +"The :keyword:`for` statement in Python differs a bit from what you may be " +"used to in C or Pascal. Rather than always iterating over an arithmetic " +"progression of numbers (like in Pascal), or giving the user the ability to " +"define both the iteration step and halting condition (as C), Python's " +":keyword:`!for` statement iterates over the items of any sequence (a list or" +" a string), in the order that they appear in the sequence. For example (no " +"pun intended):" +msgstr "" +"دستور :keyword:`for` در پایتون با آنچه ممکن است در C یا پاسکال به آن عادت " +"داشته باشید کمی متفاوت است. دستور :keyword:`!for` پایتون به جای اینکه همیشه" +" روی یک پیشرفت حسابی اعداد تکرار شود (مانند پاسکال), یا به کاربر توانایی " +"تعریف مرحله تکرار و شرط توقف (به عنوان C) را بدهد، عبارت :keyword:`!for` " +"پایتون روی آیتم‌های هر دنباله (یک لیست یا یک رشته), به ترتیب ظاهر شدن آنها " +"در دنباله تکرار می‌شود. به عنوان مثال (بدون جناس):" #: tutorial/controlflow.rst:63 -msgid ">>> # Measure some strings:\n" +#, fuzzy +msgid "" +">>> # Measure some strings:\n" ">>> words = ['cat', 'window', 'defenestrate']\n" ">>> for w in words:\n" "... print(w, len(w))\n" @@ -74,13 +135,30 @@ msgid ">>> # Measure some strings:\n" "window 6\n" "defenestrate 12" msgstr "" +">>> # تعدادی رشته را اندازه گیری کنید:\n" +">>> words = ['گربه', 'پنجره', 'دفاع']\n" +">>> برای w در کلمات:\n" +"... چاپ (w, len(w))\n" +"...\n" +"گربه 3\n" +"پنجره 6\n" +"دفاع کردن 12" #: tutorial/controlflow.rst:72 -msgid "Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection::" +#, fuzzy +msgid "" +"Code that modifies a collection while iterating over that same collection " +"can be tricky to get right. Instead, it is usually more straight-forward to" +" loop over a copy of the collection or to create a new collection::" msgstr "" +"کدی که یک مجموعه را در حین تکرار روی همان مجموعه تغییر می‌دهد، می‌تواند برای" +" درست کردن آن مشکل باشد. در عوض، معمولا ساده‌تر است که روی یک کپی از مجموعه" +" حلقه بزنید یا یک مجموعه جدید ایجاد کنید:" #: tutorial/controlflow.rst:76 -msgid "# Create a sample collection\n" +#, fuzzy +msgid "" +"# Create a sample collection\n" "users = {'Hans': 'active', 'Éléonore': 'inactive', '景太郎': 'active'}\n" "\n" "# Strategy: Iterate over a copy\n" @@ -94,17 +172,38 @@ msgid "# Create a sample collection\n" " if status == 'active':\n" " active_users[user] = status" msgstr "" +"# Create a sample collection\n" +"users = {'Hans': 'active', 'Éléonore': 'inactive', '景太郎': 'active'}\n" +"\n" +"# Strategy: Iterate over a copy\n" +"for user, status in users.copy().items():\n" +" if status == 'inactive':\n" +" del users[user]\n" +"\n" +"# Strategy: Create a new collection\n" +"active_users = {}\n" +"for user, status in users.items():\n" +" if status == 'active':\n" +" active_users[user] = status" #: tutorial/controlflow.rst:94 +#, fuzzy msgid "The :func:`range` Function" -msgstr "" +msgstr "عملکرد :func:`range`" #: tutorial/controlflow.rst:96 -msgid "If you do need to iterate over a sequence of numbers, the built-in function :func:`range` comes in handy. It generates arithmetic progressions::" +#, fuzzy +msgid "" +"If you do need to iterate over a sequence of numbers, the built-in function " +":func:`range` comes in handy. It generates arithmetic progressions::" msgstr "" +"اگر نیاز به تکرار بر روی یک دنباله از اعداد دارید، عملکرد داخلی " +":func:`range` مفید است. پیشرفت های حسابی را ایجاد می کند:" #: tutorial/controlflow.rst:99 -msgid ">>> for i in range(5):\n" +#, fuzzy +msgid "" +">>> for i in range(5):\n" "... print(i)\n" "...\n" "0\n" @@ -113,13 +212,32 @@ msgid ">>> for i in range(5):\n" "3\n" "4" msgstr "" +">>> for i in range(5):\n" +"... print(i)\n" +"...\n" +"0\n" +"1\n" +"2\n" +"3\n" +"4" #: tutorial/controlflow.rst:108 -msgid "The given end point is never part of the generated sequence; ``range(10)`` generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the 'step')::" +#, fuzzy +msgid "" +"The given end point is never part of the generated sequence; ``range(10)`` " +"generates 10 values, the legal indices for items of a sequence of length 10." +" It is possible to let the range start at another number, or to specify a " +"different increment (even negative; sometimes this is called the 'step')::" msgstr "" +"نقطه پایانی داده شده هرگز بخشی از توالی تولید شده نیست. ``range(10)`` 10 " +"مقدار تولید می کند، شاخص های قانونی برای مواردی با یک دنباله به طول 10. می " +"توان اجازه داد که محدوده از یک عدد دیگر شروع شود، یا یک افزایش متفاوت (حتی " +"منفی، گاهی اوقات به این مرحله \"گام\" می گویند:" #: tutorial/controlflow.rst:113 -msgid ">>> list(range(5, 10))\n" +#, fuzzy +msgid "" +">>> list(range(5, 10))\n" "[5, 6, 7, 8, 9]\n" "\n" ">>> list(range(0, 10, 3))\n" @@ -128,13 +246,28 @@ msgid ">>> list(range(5, 10))\n" ">>> list(range(-10, -100, -30))\n" "[-10, -40, -70]" msgstr "" +">>> list(range(5, 10))\n" +"[5, 6, 7, 8, 9]\n" +"\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +"\n" +">>> list(range(-10, -100, -30))\n" +"[-10, -40, -70]" #: tutorial/controlflow.rst:122 -msgid "To iterate over the indices of a sequence, you can combine :func:`range` and :func:`len` as follows::" +#, fuzzy +msgid "" +"To iterate over the indices of a sequence, you can combine :func:`range` and" +" :func:`len` as follows::" msgstr "" +"برای تکرار بر روی شاخص های یک دنباله، می توانید :func:`range` و :func:`len` " +"را به صورت زیر ترکیب کنید:" #: tutorial/controlflow.rst:125 -msgid ">>> a = ['Mary', 'had', 'a', 'little', 'lamb']\n" +#, fuzzy +msgid "" +">>> a = ['Mary', 'had', 'a', 'little', 'lamb']\n" ">>> for i in range(len(a)):\n" "... print(i, a[i])\n" "...\n" @@ -144,47 +277,105 @@ msgid ">>> a = ['Mary', 'had', 'a', 'little', 'lamb']\n" "3 little\n" "4 lamb" msgstr "" +">>> a = ['مریم', 'داشت', 'a', 'کوچولو', 'بره']\n" +">>> برای i در محدوده (len(a)):\n" +"... چاپ (i, a[i])\n" +"...\n" +"0 مریم\n" +"1 داشت\n" +"2 الف\n" +"3 کم\n" +"4 بره" #: tutorial/controlflow.rst:135 -msgid "In most such cases, however, it is convenient to use the :func:`enumerate` function, see :ref:`tut-loopidioms`." +#, fuzzy +msgid "" +"In most such cases, however, it is convenient to use the :func:`enumerate` " +"function, see :ref:`tut-loopidioms`." msgstr "" +"با این حال، در بیشتر چنین مواردی، استفاده از عملکرد :func:`enumerate` راحت " +"است، به :ref:`tut-loopidioms` مراجعه کنید." #: tutorial/controlflow.rst:138 +#, fuzzy msgid "A strange thing happens if you just print a range::" -msgstr "" +msgstr "اگر فقط یک محدوده را چاپ کنید یک اتفاق عجیب رخ می دهد::" #: tutorial/controlflow.rst:140 -msgid ">>> range(10)\n" +#, fuzzy +msgid "" +">>> range(10)\n" "range(0, 10)" msgstr "" +">>> range(10)\n" +"range(0, 10)" #: tutorial/controlflow.rst:143 -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." +#, fuzzy +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` برگردانده می شود طوری رفتار می " +"کند که انگار یک لیست است، اما در واقع اینطور نیست. این شیئی است که وقتی روی " +"آن تکرار می‌کنید آیتم‌های متوالی دنباله مورد نظر را برمی‌گرداند، اما واقعاً " +"در لیست قرار نمی‌گیرد، بنابراین در فضا صرفه‌جویی می‌شود." #: tutorial/controlflow.rst:148 -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 "" +#, fuzzy +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`::" #: tutorial/controlflow.rst:154 -msgid ">>> sum(range(4)) # 0 + 1 + 2 + 3\n" +#, fuzzy +msgid "" +">>> sum(range(4)) # 0 + 1 + 2 + 3\n" "6" msgstr "" +">>> sum(range(4)) # 0 + 1 + 2 + 3\n" +"6" #: tutorial/controlflow.rst:157 -msgid "Later we will see more functions that return iterables and take iterables as arguments. In chapter :ref:`tut-structures`, we will discuss in more detail about :func:`list`." +#, fuzzy +msgid "" +"Later we will see more functions that return iterables and take iterables as" +" arguments. In chapter :ref:`tut-structures`, we will discuss in more " +"detail about :func:`list`." msgstr "" +"بعداً توابع بیشتری را خواهیم دید که تکرارپذیرها را برمی‌گردانند و " +"تکرارپذیرها را به عنوان آرگومان می‌گیرند. در فصل :ref:`tut-structures`، با " +"جزئیات بیشتری در مورد :func:`list` بحث خواهیم کرد." #: tutorial/controlflow.rst:164 +#, fuzzy msgid ":keyword:`!break` and :keyword:`!continue` Statements" -msgstr "" +msgstr "بیانیه های :keyword:`!break` و :keyword:`!continue`" #: tutorial/controlflow.rst:166 -msgid "The :keyword:`break` statement breaks out of the innermost enclosing :keyword:`for` or :keyword:`while` loop::" +#, fuzzy +msgid "" +"The :keyword:`break` statement breaks out of the innermost enclosing " +":keyword:`for` or :keyword:`while` loop::" msgstr "" +"دستور :keyword:`break` از درونی ترین حلقه :keyword:`for` یا :keyword:`while`" +" خارج می شود:" #: tutorial/controlflow.rst:169 -msgid ">>> for n in range(2, 10):\n" +#, fuzzy +msgid "" +">>> for n in range(2, 10):\n" "... for x in range(2, n):\n" "... if n % x == 0:\n" "... print(f\"{n} equals {x} * {n//x}\")\n" @@ -195,13 +386,28 @@ msgid ">>> for n in range(2, 10):\n" "8 equals 2 * 4\n" "9 equals 3 * 3" msgstr "" +">>> برای n در محدوده (2, 10):\n" +"... برای x در محدوده (2, n):\n" +"... اگر n % x == 0:\n" +"... print(f\"{n} برابر است با {x} * {n//x}\")\n" +"... break\n" +"...\n" +"4 equals 2 * 2\n" +"6 برابر است با 2 * 3\n" +"8 equals 2 * 4\n" +"9 برابر 3 * 3 است" #: tutorial/controlflow.rst:180 -msgid "The :keyword:`continue` statement continues with the next iteration of the loop::" -msgstr "" +#, fuzzy +msgid "" +"The :keyword:`continue` statement continues with the next iteration of the " +"loop::" +msgstr "دستور :keyword:`continue` با تکرار بعدی حلقه ادامه می یابد:" #: tutorial/controlflow.rst:183 -msgid ">>> for num in range(2, 10):\n" +#, fuzzy +msgid "" +">>> for num in range(2, 10):\n" "... if num % 2 == 0:\n" "... print(f\"Found an even number {num}\")\n" "... continue\n" @@ -216,33 +422,79 @@ msgid ">>> for num in range(2, 10):\n" "Found an even number 8\n" "Found an odd number 9" msgstr "" +">>> برای تعداد در محدوده (2, 10):\n" +"... اگر عدد % 2 == 0:\n" +"... print(f\"یک عدد زوج پیدا شد {num}\")\n" +"... ادامه\n" +"... print(f\"یک عدد فرد پیدا شد {num}\")\n" +"...\n" +"عدد زوج 2 را پیدا کرد\n" +"یک عدد فرد 3 پیدا کرد\n" +"عدد زوج 4 را پیدا کرد\n" +"یک عدد فرد 5 پیدا کرد\n" +"عدد زوج 6 را پیدا کرد\n" +"یک عدد فرد 7 پیدا کرد\n" +"عدد زوج 8 را پیدا کرد\n" +"یک عدد فرد 9 پیدا کرد" #: tutorial/controlflow.rst:202 +#, fuzzy msgid ":keyword:`!else` Clauses on Loops" -msgstr "" +msgstr "بندهای :keyword:`!else` در حلقه ها" #: tutorial/controlflow.rst:204 -msgid "In a :keyword:`!for` or :keyword:`!while` loop the :keyword:`!break` statement may be paired with an :keyword:`!else` clause. If the loop finishes without executing the :keyword:`!break`, the :keyword:`!else` clause executes." +#, fuzzy +msgid "" +"In a :keyword:`!for` or :keyword:`!while` loop the :keyword:`!break` " +"statement may be paired with an :keyword:`!else` clause. If the loop " +"finishes without executing the :keyword:`!break`, the :keyword:`!else` " +"clause executes." msgstr "" +"در یک حلقه :keyword:`!for` یا :keyword:`!while`، دستور :keyword:`!break` " +"ممکن است با یک عبارت :keyword:`!else` جفت شود. اگر حلقه بدون اجرای " +":keyword:`!break` تمام شود، بند :keyword:`!else` اجرا می شود." #: tutorial/controlflow.rst:208 -msgid "In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the loop finishes its final iteration, that is, if no break occurred." +#, fuzzy +msgid "" +"In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " +"loop finishes its final iteration, that is, if no break occurred." msgstr "" +"در یک حلقه :keyword:`for`، بند :keyword:`!else` پس از اتمام تکرار نهایی حلقه" +" اجرا می شود، یعنی اگر شکستی رخ نداده باشد." #: tutorial/controlflow.rst:211 -msgid "In a :keyword:`while` loop, it's executed after the loop's condition becomes false." -msgstr "" +#, fuzzy +msgid "" +"In a :keyword:`while` loop, it's executed after the loop's condition becomes" +" false." +msgstr "در یک حلقه :keyword:`while`، پس از نادرست شدن شرط حلقه اجرا می شود." #: tutorial/controlflow.rst:213 -msgid "In either kind of loop, the :keyword:`!else` clause is **not** executed if the loop was terminated by a :keyword:`break`. Of course, other ways of ending the loop early, such as a :keyword:`return` or a raised exception, will also skip execution of the :keyword:`else` clause." +#, fuzzy +msgid "" +"In either kind of loop, the :keyword:`!else` clause is **not** executed if " +"the loop was terminated by a :keyword:`break`. Of course, other ways of " +"ending the loop early, such as a :keyword:`return` or a raised exception, " +"will also skip execution of the :keyword:`else` clause." msgstr "" +"در هر نوع حلقه، بند :keyword:`!else` به صورت **not** اجرا می شود اگر حلقه " +"توسط یک :keyword:`break` خاتمه یابد. البته، سایر روش‌های پایان دادن به حلقه" +" زودهنگام، مانند :keyword:`return` یا استثناء افزایش‌یافته، از اجرای بند " +":keyword:`else` نیز صرفنظر می‌کنند." #: tutorial/controlflow.rst:218 -msgid "This is exemplified in the following :keyword:`!for` loop, which searches for prime numbers::" +#, fuzzy +msgid "" +"This is exemplified in the following :keyword:`!for` loop, which searches " +"for prime numbers::" msgstr "" +"این مثال در حلقه :keyword:`!for` زیر است که اعداد اول را جستجو می کند:" #: tutorial/controlflow.rst:221 -msgid ">>> for n in range(2, 10):\n" +#, fuzzy +msgid "" +">>> for n in range(2, 10):\n" "... for x in range(2, n):\n" "... if n % x == 0:\n" "... print(n, 'equals', x, '*', n//x)\n" @@ -260,67 +512,163 @@ msgid ">>> for n in range(2, 10):\n" "8 equals 2 * 4\n" "9 equals 3 * 3" msgstr "" +">>> برای n در محدوده (2, 10):\n" +"... برای x در محدوده (2, n):\n" +"... اگر n % x == 0:\n" +"... print(n, 'برابر', x, '*', n//x)\n" +"... break\n" +"... else:\n" +"... # loop fell through without finding a factor\n" +"... print(n, 'is a prime number')\n" +"...\n" +"2 is a prime number\n" +"3 is a prime number\n" +"4 equals 2 * 2\n" +"5 عدد اول است\n" +"6 برابر است با 2 * 3\n" +"7 is a prime number\n" +"8 equals 2 * 4\n" +"9 برابر 3 * 3 است" #: tutorial/controlflow.rst:239 -msgid "(Yes, this is the correct code. Look closely: the ``else`` clause belongs to the ``for`` loop, **not** the ``if`` statement.)" +#, fuzzy +msgid "" +"(Yes, this is the correct code. Look closely: the ``else`` clause belongs " +"to the ``for`` loop, **not** the ``if`` statement.)" msgstr "" +"(بله, این کد صحیح است. به دقت نگاه کنید: عبارت ``else`` متعلق به حلقه " +"``for``, **not** عبارت ``if`` است.)" #: tutorial/controlflow.rst:242 -msgid "One way to think of the else clause is to imagine it paired with the ``if`` inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The ``if`` is inside the loop, encountered a number of times. If the condition is ever true, a ``break`` will happen. If the condition is never true, the ``else`` clause outside the loop will execute." -msgstr "" +#, fuzzy +msgid "" +"One way to think of the else clause is to imagine it paired with the ``if`` " +"inside the loop. As the loop executes, it will run a sequence like " +"if/if/if/else. The ``if`` is inside the loop, encountered a number of times." +" If the condition is ever true, a ``break`` will happen. If the condition is" +" never true, the ``else`` clause outside the loop will execute." +msgstr "" +"یک راه برای فکر کردن به عبارت else این است که آن را با ``if`` در داخل حلقه " +"جفت شده تصور کنید. همانطور که حلقه اجرا می شود، دنباله ای مانند " +"if/if/if/else را اجرا می کند. ``if`` در داخل حلقه قرار دارد و چندین بار با " +"آن مواجه شده است. اگر شرط همیشه درست باشد، یک ``break`` اتفاق می افتد. اگر " +"شرط هرگز درست نباشد، عبارت ``else`` خارج از حلقه اجرا خواهد شد." #: tutorial/controlflow.rst:248 -msgid "When used with a loop, the ``else`` clause has more in common with the ``else`` clause of a :keyword:`try` statement than it does with that of ``if`` statements: a ``try`` statement's ``else`` clause runs when no exception occurs, and a loop's ``else`` clause runs when no ``break`` occurs. For more on the ``try`` statement and exceptions, see :ref:`tut-handling`." -msgstr "" +#, fuzzy +msgid "" +"When used with a loop, the ``else`` clause has more in common with the " +"``else`` clause of a :keyword:`try` statement than it does with that of " +"``if`` statements: a ``try`` statement's ``else`` clause runs when no " +"exception occurs, and a loop's ``else`` clause runs when no ``break`` " +"occurs. For more on the ``try`` statement and exceptions, see :ref:`tut-" +"handling`." +msgstr "" +"هنگامی که با یک حلقه استفاده می شود، بند ``else`` شباهت بیشتری با بند " +"``else`` یک دستور :keyword:`try` دارد تا با عبارت ``if``: عبارت ``else`` یک " +"دستور ``try`` زمانی اجرا می شود که هیچ استثنایی رخ نمی دهد، و ``try`` یک " +"حلقه زمانی که هیچ استثنایی رخ نمی دهد اجرا می شود. برای اطلاعات بیشتر در " +"مورد دستور ``try`` و استثناها، به :ref:`tut-handling` مراجعه کنید." #: tutorial/controlflow.rst:257 +#, fuzzy msgid ":keyword:`!pass` Statements" -msgstr "" +msgstr "بیانیه های :keyword:`!pass`" #: tutorial/controlflow.rst:259 -msgid "The :keyword:`pass` statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example::" +#, fuzzy +msgid "" +"The :keyword:`pass` statement does nothing. It can be used when a statement " +"is required syntactically but the program requires no action. For example::" msgstr "" +"دستور :keyword:`pass` هیچ کاری انجام نمی دهد. زمانی می توان از آن استفاده " +"کرد که یک دستور به صورت نحوی مورد نیاز باشد اما برنامه نیازی به هیچ اقدامی " +"نداشته باشد. به عنوان مثال::" #: tutorial/controlflow.rst:262 -msgid ">>> while True:\n" +#, fuzzy +msgid "" +">>> while True:\n" "... pass # Busy-wait for keyboard interrupt (Ctrl+C)\n" "..." msgstr "" +">>> while True:\n" +"... pass # Busy-wait for keyboard interrupt (Ctrl+C)\n" +"..." #: tutorial/controlflow.rst:266 +#, fuzzy msgid "This is commonly used for creating minimal classes::" -msgstr "" +msgstr "این معمولا برای ایجاد کلاس های حداقل استفاده می شود:" #: tutorial/controlflow.rst:268 -msgid ">>> class MyEmptyClass:\n" +#, fuzzy +msgid "" +">>> class MyEmptyClass:\n" "... pass\n" "..." msgstr "" +">>> class MyEmptyClass:\n" +"... pass\n" +"..." #: tutorial/controlflow.rst:272 -msgid "Another place :keyword:`pass` can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The :keyword:`!pass` is silently ignored::" +#, fuzzy +msgid "" +"Another place :keyword:`pass` can be used is as a place-holder for a " +"function or conditional body when you are working on new code, allowing you " +"to keep thinking at a more abstract level. The :keyword:`!pass` is silently" +" ignored::" msgstr "" +"مکان دیگری که می‌توان از :keyword:`pass` استفاده کرد، به‌عنوان نگه‌دارنده " +"مکان برای یک تابع یا بدنه شرطی در هنگام کار بر روی کد جدید است که به شما " +"امکان می‌دهد در سطح انتزاعی‌تری فکر کنید. :keyword:`!pass` بی سر و صدا " +"نادیده گرفته می شود::" #: tutorial/controlflow.rst:276 -msgid ">>> def initlog(*args):\n" +#, fuzzy +msgid "" +">>> def initlog(*args):\n" "... pass # Remember to implement this!\n" "..." msgstr "" +">>> def initlog(*args):\n" +"... pass # Remember to implement this!\n" +"..." #: tutorial/controlflow.rst:284 +#, fuzzy msgid ":keyword:`!match` Statements" -msgstr "" +msgstr "بیانیه های :keyword:`!match`" #: tutorial/controlflow.rst:286 -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." -msgstr "" +#, fuzzy +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." +msgstr "" +"یک دستور :keyword:`match` یک عبارت را می گیرد و مقدار آن را با الگوهای " +"متوالی ارائه شده به عنوان یک یا چند بلوک case مقایسه می کند. این به طور " +"سطحی شبیه به دستور سوئیچ در C، جاوا یا جاوا اسکریپت (و بسیاری از زبان‌های " +"دیگر) است، اما بیشتر شبیه به تطبیق الگو در زبان‌هایی مانند Rust یا Haskell " +"است. فقط اولین الگوی منطبق اجرا می شود و همچنین می تواند مؤلفه ها (عناصر " +"دنباله یا ویژگی های شی) را از مقدار به متغیرها استخراج کند." #: tutorial/controlflow.rst:294 -msgid "The simplest form compares a subject value against one or more literals::" -msgstr "" +#, fuzzy +msgid "" +"The simplest form compares a subject value against one or more literals::" +msgstr "ساده ترین شکل یک مقدار موضوع را با یک یا چند کلمه مقایسه می کند:" #: tutorial/controlflow.rst:296 -msgid "def http_error(status):\n" +#, fuzzy +msgid "" +"def http_error(status):\n" " match status:\n" " case 400:\n" " return \"Bad request\"\n" @@ -331,26 +679,56 @@ msgid "def http_error(status):\n" " case _:\n" " return \"Something's wrong with the internet\"" msgstr "" +"def http_error(status):\n" +" match status:\n" +" case 400:\n" +" return \"Bad request\"\n" +" case 404:\n" +" return \"Not found\"\n" +" case 418:\n" +" return \"I'm a teapot\"\n" +" case _:\n" +" return \"Something's wrong with the internet\"" #: tutorial/controlflow.rst:307 -msgid "Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and never fails to match. If no case matches, none of the branches is executed." +#, fuzzy +msgid "" +"Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " +"never fails to match. If no case matches, none of the branches is executed." msgstr "" +"به آخرین بلوک توجه کنید: \"نام متغیر\" ``_`` به عنوان یک *wildcard* عمل می " +"کند و هرگز با هم مطابقت ندارد. اگر هیچ موردی مطابقت نداشته باشد، هیچ یک از " +"شاخه ها اجرا نمی شود." #: tutorial/controlflow.rst:310 -msgid "You can combine several literals in a single pattern using ``|`` (\"or\")::" +#, fuzzy +msgid "" +"You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "" +"با استفاده از ``|`` (\"یا\") می توانید چندین کلمه را در یک الگو ترکیب کنید:" #: tutorial/controlflow.rst:312 -msgid "case 401 | 403 | 404:\n" +#, fuzzy +msgid "" +"case 401 | 403 | 404:\n" " return \"Not allowed\"" msgstr "" +"مورد 401 | 403 | 404:\n" +" بازگشت \"مجاز نیست\"" #: tutorial/controlflow.rst:315 -msgid "Patterns can look like unpacking assignments, and can be used to bind variables::" +#, fuzzy +msgid "" +"Patterns can look like unpacking assignments, and can be used to bind " +"variables::" msgstr "" +"الگوها می توانند شبیه به بازکردن تکالیف باشند و می توانند برای اتصال متغیرها" +" استفاده شوند:" #: tutorial/controlflow.rst:318 -msgid "# point is an (x, y) tuple\n" +#, fuzzy +msgid "" +"# point is an (x, y) tuple\n" "match point:\n" " case (0, 0):\n" " print(\"Origin\")\n" @@ -363,17 +741,50 @@ msgid "# point is an (x, y) tuple\n" " case _:\n" " raise ValueError(\"Not a point\")" msgstr "" +"# point is an (x, y) tuple\n" +"match point:\n" +" case (0, 0):\n" +" print(\"Origin\")\n" +" case (0, y):\n" +" print(f\"Y={y}\")\n" +" case (x, 0):\n" +" print(f\"X={x}\")\n" +" case (x, y):\n" +" print(f\"X={x}, Y={y}\")\n" +" case _:\n" +" raise ValueError(\"Not a point\")" #: tutorial/controlflow.rst:331 -msgid "Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable *binds* a value from the subject (``point``). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment ``(x, y) = point``." -msgstr "" +#, fuzzy +msgid "" +"Study that one carefully! The first pattern has two literals, and can be " +"thought of as an extension of the literal pattern shown above. But the next" +" two patterns combine a literal and a variable, and the variable *binds* a " +"value from the subject (``point``). The fourth pattern captures two values," +" which makes it conceptually similar to the unpacking assignment ``(x, y) = " +"point``." +msgstr "" +"آن یکی را با دقت مطالعه کنید! الگوی اول دارای دو حرف است و می‌توان آن را " +"به‌عنوان بسط الگوی تحت اللفظی که در بالا نشان داده شده است در نظر گرفت. اما" +" دو الگوی بعدی یک کلمه و یک متغیر و متغیر *binds* یک مقدار از موضوع " +"(``point``) را ترکیب می‌کنند. الگوی چهارم دو مقدار را دریافت می کند، که آن " +"را از نظر مفهومی شبیه به تخصیص باز کردن بسته بندی ``(x, y) = point`` می کند." #: tutorial/controlflow.rst:338 -msgid "If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables::" +#, fuzzy +msgid "" +"If you are using classes to structure your data you can use the class name " +"followed by an argument list resembling a constructor, but with the ability " +"to capture attributes into variables::" msgstr "" +"اگر از کلاس‌ها برای ساختار دادن به داده‌های خود استفاده می‌کنید، می‌توانید " +"از نام کلاس و به دنبال آن یک لیست آرگومان شبیه سازنده، اما با قابلیت ثبت " +"ویژگی‌ها در متغیرها استفاده کنید:" #: tutorial/controlflow.rst:342 -msgid "class Point:\n" +#, fuzzy +msgid "" +"class Point:\n" " def __init__(self, x, y):\n" " self.x = x\n" " self.y = y\n" @@ -391,28 +802,87 @@ msgid "class Point:\n" " case _:\n" " print(\"Not a point\")" msgstr "" +"class Point:\n" +" def __init__(self, x, y):\n" +" self.x = x\n" +" self.y = y\n" +"\n" +"def where_is(point):\n" +" match point:\n" +" case Point(x=0, y=0):\n" +" print(\"Origin\")\n" +" case Point(x=0, y=y):\n" +" print(f\"Y={y}\")\n" +" case Point(x=x, y=0):\n" +" print(f\"X={x}\")\n" +" case Point():\n" +" print(\"Somewhere else\")\n" +" case _:\n" +" print(\"Not a point\")" #: tutorial/controlflow.rst:360 -msgid "You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the ``__match_args__`` special attribute in your classes. If it's set to (\"x\", \"y\"), the following patterns are all equivalent (and all bind the ``y`` attribute to the ``var`` variable)::" -msgstr "" +#, fuzzy +msgid "" +"You can use positional parameters with some builtin classes that provide an " +"ordering for their attributes (e.g. dataclasses). You can also define a " +"specific position for attributes in patterns by setting the " +"``__match_args__`` special attribute in your classes. If it's set to (\"x\"," +" \"y\"), the following patterns are all equivalent (and all bind the ``y`` " +"attribute to the ``var`` variable)::" +msgstr "" +"می‌توانید از پارامترهای موقعیتی با برخی کلاس‌های داخلی استفاده کنید که " +"ترتیبی برای ویژگی‌های آن‌ها ارائه می‌کنند (مانند کلاس‌های داده). همچنین می " +"توانید با تنظیم ویژگی خاص ``__match_args__`` در کلاس های خود، یک موقعیت خاص " +"برای ویژگی ها در الگوها تعریف کنید. اگر روی (\"x\", \"y\" تنظیم شده باشد), " +"الگوهای زیر همگی معادل هستند (و همه ویژگی ``y`` را به متغیر ``var`` متصل می " +"کنند):" #: tutorial/controlflow.rst:366 -msgid "Point(1, var)\n" +#, fuzzy +msgid "" +"Point(1, var)\n" "Point(1, y=var)\n" "Point(x=1, y=var)\n" "Point(y=var, x=1)" msgstr "" +"Point(1, var)\n" +"Point(1, y=var)\n" +"Point(x=1, y=var)\n" +"Point(y=var, x=1)" #: tutorial/controlflow.rst:371 -msgid "A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like ``var`` above) are assigned to by a match statement. Dotted names (like ``foo.bar``), attribute names (the ``x=`` and ``y=`` above) or class names (recognized by the \"(...)\" next to them like ``Point`` above) are never assigned to." -msgstr "" +#, fuzzy +msgid "" +"A recommended way to read patterns is to look at them as an extended form of" +" what you would put on the left of an assignment, to understand which " +"variables would be set to what. Only the standalone names (like ``var`` " +"above) are assigned to by a match statement. Dotted names (like " +"``foo.bar``), attribute names (the ``x=`` and ``y=`` above) or class names " +"(recognized by the \"(...)\" next to them like ``Point`` above) are never " +"assigned to." +msgstr "" +"یک روش توصیه شده برای خواندن الگوها این است که به آنها به عنوان شکلی بسط " +"یافته از آنچه در سمت چپ یک تکلیف قرار می دهید نگاه کنید تا بفهمید که کدام " +"متغیرها روی چه چیزی تنظیم می شوند. فقط نام‌های مستقل (مانند ``var`` در بالا)" +" توسط یک بیانیه مطابقت به آنها اختصاص داده می‌شود. نام‌های نقطه‌دار (مانند " +"``foo.bar``), نام‌های ویژگی (``x=`` و ``y=`` در بالا) یا نام‌های کلاس (که با" +" \"(...)\" در کنار آنها مانند ``Point`` در بالا شناسایی می‌شوند) هرگز به " +"آنها اختصاص داده نمی‌شوند." #: tutorial/controlflow.rst:378 -msgid "Patterns can be arbitrarily nested. For example, if we have a short list of Points, with ``__match_args__`` added, we could match it like this::" +#, fuzzy +msgid "" +"Patterns can be arbitrarily nested. For example, if we have a short list of" +" Points, with ``__match_args__`` added, we could match it like this::" msgstr "" +"الگوها را می توان خودسرانه تو در تو قرار داد. به عنوان مثال، اگر ما یک لیست" +" کوتاه از نقاط، با اضافه شدن ``__match_args__`` داشته باشیم، می توانیم آن را" +" به این صورت مطابقت دهیم:" #: tutorial/controlflow.rst:381 -msgid "class Point:\n" +#, fuzzy +msgid "" +"class Point:\n" " __match_args__ = ('x', 'y')\n" " def __init__(self, x, y):\n" " self.x = x\n" @@ -430,57 +900,134 @@ msgid "class Point:\n" " case _:\n" " print(\"Something else\")" msgstr "" +"class Point:\n" +" __match_args__ = ('x', 'y')\n" +" def __init__(self, x, y):\n" +" self.x = x\n" +" self.y = y\n" +"\n" +"match points:\n" +" case []:\n" +" print(\"No points\")\n" +" case [Point(0, 0)]:\n" +" print(\"The origin\")\n" +" case [Point(x, y)]:\n" +" print(f\"Single point {x}, {y}\")\n" +" case [Point(0, y1), Point(0, y2)]:\n" +" print(f\"Two on the Y axis at {y1}, {y2}\")\n" +" case _:\n" +" print(\"Something else\")" #: tutorial/controlflow.rst:399 -msgid "We can add an ``if`` clause to a pattern, known as a \"guard\". If the guard is false, ``match`` goes on to try the next case block. Note that value capture happens before the guard is evaluated::" +#, fuzzy +msgid "" +"We can add an ``if`` clause to a pattern, known as a \"guard\". If the " +"guard is false, ``match`` goes on to try the next case block. Note that " +"value capture happens before the guard is evaluated::" msgstr "" +"ما می توانیم یک بند ``if`` به یک الگو اضافه کنیم که به عنوان \"گارد\" شناخته" +" می شود. اگر گارد نادرست باشد، ``match`` بلاک کیس بعدی را امتحان می کند. " +"توجه داشته باشید که گرفتن ارزش قبل از ارزیابی گارد اتفاق می افتد:" #: tutorial/controlflow.rst:403 -msgid "match point:\n" +#, fuzzy +msgid "" +"match point:\n" " case Point(x, y) if x == y:\n" " print(f\"Y=X at {x}\")\n" " case Point(x, y):\n" " print(f\"Not on the diagonal\")" msgstr "" +"match point:\n" +" case Point(x, y) if x == y:\n" +" print(f\"Y=X at {x}\")\n" +" case Point(x, y):\n" +" print(f\"Not on the diagonal\")" #: tutorial/controlflow.rst:409 +#, fuzzy msgid "Several other key features of this statement:" -msgstr "" +msgstr "چند ویژگی کلیدی دیگر این بیانیه:" #: tutorial/controlflow.rst:411 -msgid "Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don't match iterators or strings." +#, fuzzy +msgid "" +"Like unpacking assignments, tuple and list patterns have exactly the same " +"meaning and actually match arbitrary sequences. An important exception is " +"that they don't match iterators or strings." msgstr "" +"مانند باز کردن تکالیف، الگوهای تاپل و فهرست دقیقاً معنای مشابهی دارند و در " +"واقع با دنباله‌های دلخواه مطابقت دارند. یک استثنای مهم این است که آنها با " +"تکرارگرها یا رشته ها مطابقت ندارند." #: tutorial/controlflow.rst:415 -msgid "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, *rest)`` work similar to unpacking assignments. The name after ``*`` may also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two items without binding the remaining items." +#, fuzzy +msgid "" +"Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y," +" *rest)`` work similar to unpacking assignments. The name after ``*`` may " +"also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two items " +"without binding the remaining items." msgstr "" +"الگوهای دنباله ای از باز کردن بسته بندی طولانی پشتیبانی می کنند: ``[x, y, " +"*rest]`` و ``(x, y, *rest)`` مشابه وظایف باز کردن بسته بندی کار می کنند. " +"نام پس از ``*`` نیز ممکن است ``_`` باشد، بنابراین ``(x, y, *_)`` با دنباله " +"ای از حداقل دو مورد مطابقت دارد بدون اینکه موارد باقیمانده را متصل کند." #: tutorial/controlflow.rst:420 -msgid "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the ``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is also supported. (But ``**_`` would be redundant, so it is not allowed.)" +#, fuzzy +msgid "" +"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " +"``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " +"sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is " +"also supported. (But ``**_`` would be redundant, so it is not allowed.)" msgstr "" +"الگوهای نگاشت: ``{\"bandwidth\": b, \"latency\": l}`` مقادیر " +"``\"bandwidth\"`` و ``\"latency\"`` را از فرهنگ لغت می گیرد. برخلاف الگوهای" +" توالی، کلیدهای اضافی نادیده گرفته می شوند. باز کردن بسته بندی مانند " +"``**rest`` نیز پشتیبانی می شود. (اما ``**_`` اضافی است, بنابراین مجاز " +"نیست.)" #: tutorial/controlflow.rst:425 +#, fuzzy msgid "Subpatterns may be captured using the ``as`` keyword::" -msgstr "" +msgstr "الگوهای فرعی ممکن است با استفاده از کلمه کلیدی ``as`` ثبت شوند:" #: tutorial/controlflow.rst:427 +#, fuzzy msgid "case (Point(x1, y1), Point(x2, y2) as p2): ..." -msgstr "" +msgstr "مورد (نقطه(x1, y1), نقطه (x2, y2) به عنوان p2): ..." #: tutorial/controlflow.rst:429 -msgid "will capture the second element of the input as ``p2`` (as long as the input is a sequence of two points)" +#, fuzzy +msgid "" +"will capture the second element of the input as ``p2`` (as long as the input" +" is a sequence of two points)" msgstr "" +"عنصر دوم ورودی را به عنوان ``p2`` می گیرد (تا زمانی که ورودی دنباله ای از دو" +" نقطه باشد)" #: tutorial/controlflow.rst:432 -msgid "Most literals are compared by equality, however the singletons ``True``, ``False`` and ``None`` are compared by identity." +#, fuzzy +msgid "" +"Most literals are compared by equality, however the singletons ``True``, " +"``False`` and ``None`` are compared by identity." msgstr "" +"بیشتر لفظ‌ها با برابری مقایسه می‌شوند، با این حال تک‌تن‌های ``True``، " +"``False`` و ``None`` با هویت مقایسه می‌شوند." #: tutorial/controlflow.rst:435 -msgid "Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable::" +#, fuzzy +msgid "" +"Patterns may use named constants. These must be dotted names to prevent " +"them from being interpreted as capture variable::" msgstr "" +"الگوها ممکن است از ثابت های نامگذاری شده استفاده کنند. این نام‌ها باید " +"نقطه‌دار باشند تا از تفسیر آنها به عنوان متغیر ضبط جلوگیری شود:" #: tutorial/controlflow.rst:438 -msgid "from enum import Enum\n" +#, fuzzy +msgid "" +"from enum import Enum\n" "class Color(Enum):\n" " RED = 'red'\n" " GREEN = 'green'\n" @@ -496,21 +1043,48 @@ msgid "from enum import Enum\n" " case Color.BLUE:\n" " print(\"I'm feeling the blues :(\")" msgstr "" +"from enum import Enum\n" +"class Color(Enum):\n" +" RED = 'red'\n" +" GREEN = 'green'\n" +" BLUE = 'blue'\n" +"\n" +"color = Color(input(\"Enter your choice of 'red', 'blue' or 'green': \"))\n" +"\n" +"match color:\n" +" case Color.RED:\n" +" print(\"I see red!\")\n" +" case Color.GREEN:\n" +" print(\"Grass is green\")\n" +" case Color.BLUE:\n" +" print(\"I'm feeling the blues :(\")" #: tutorial/controlflow.rst:454 -msgid "For a more detailed explanation and additional examples, you can look into :pep:`636` which is written in a tutorial format." +#, fuzzy +msgid "" +"For a more detailed explanation and additional examples, you can look into " +":pep:`636` which is written in a tutorial format." msgstr "" +"برای توضیح دقیق تر و مثال های اضافی، می توانید به :pep:`636` که در قالب " +"آموزشی نوشته شده است نگاه کنید." #: tutorial/controlflow.rst:460 +#, fuzzy msgid "Defining Functions" -msgstr "" +msgstr "تعریف توابع" #: tutorial/controlflow.rst:462 -msgid "We can create a function that writes the Fibonacci series to an arbitrary boundary::" +#, fuzzy +msgid "" +"We can create a function that writes the Fibonacci series to an arbitrary " +"boundary::" msgstr "" +"ما می توانیم تابعی ایجاد کنیم که سری فیبوناچی را روی یک مرز دلخواه بنویسد:" #: tutorial/controlflow.rst:465 -msgid ">>> def fib(n): # write Fibonacci series less than n\n" +#, fuzzy +msgid "" +">>> def fib(n): # write Fibonacci series less than n\n" "... \"\"\"Print a Fibonacci series less than n.\"\"\"\n" "... a, b = 0, 1\n" "... while a < n:\n" @@ -522,51 +1096,161 @@ msgid ">>> def fib(n): # write Fibonacci series less than n\n" ">>> fib(2000)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597" msgstr "" +">>> def fib(n): # سری فیبوناچی را کمتر از n بنویسید\n" +"... \"\"\"چاپ یک سری فیبوناچی کمتر از n.\"\"\"\n" +"... a, b = 0, 1\n" +"... در حالی که a < n:\n" +"... print(a, end=' ')\n" +"... a, b = b, a+b\n" +"... چاپ ()\n" +"...\n" +">>> # حالا تابعی را که تعریف کردیم فراخوانی کنید:\n" +">>> fib (2000)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597" #: tutorial/controlflow.rst:482 -msgid "The keyword :keyword:`def` introduces a function *definition*. It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented." +#, fuzzy +msgid "" +"The keyword :keyword:`def` introduces a function *definition*. It must be " +"followed by the function name and the parenthesized list of formal " +"parameters. The statements that form the body of the function start at the " +"next line, and must be indented." msgstr "" +"کلمه کلیدی :keyword:`def` یک تابع *definition* را معرفی می کند. پس از آن " +"باید نام تابع و لیست پارامترهای رسمی پرانتز شده باشد. عباراتی که بدنه تابع " +"را تشکیل می دهند از خط بعدی شروع می شوند و باید تورفتگی داشته باشند." #: tutorial/controlflow.rst:487 -msgid "The first statement of the function body can optionally be a string literal; this string literal is the function's documentation string, or :dfn:`docstring`. (More about docstrings can be found in the section :ref:`tut-docstrings`.) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it's good practice to include docstrings in code that you write, so make a habit of it." -msgstr "" +#, fuzzy +msgid "" +"The first statement of the function body can optionally be a string literal;" +" this string literal is the function's documentation string, or " +":dfn:`docstring`. (More about docstrings can be found in the section " +":ref:`tut-docstrings`.) There are tools which use docstrings to " +"automatically produce online or printed documentation, or to let the user " +"interactively browse through code; it's good practice to include docstrings " +"in code that you write, so make a habit of it." +msgstr "" +"اولین دستور بدن تابع به صورت اختیاری می تواند یک رشته واقعی باشد. این رشته " +"تحت اللفظی رشته مستندات تابع یا :dfn:`docstring` است. (اطلاعات بیشتر در مورد" +" رشته‌های اسناد را می‌توانید در بخش :ref:`tut-docstrings` بیابید.) ابزارهایی" +" وجود دارند که از رشته‌های اسنادی برای تولید خودکار اسناد آنلاین یا چاپی " +"استفاده می‌کنند، یا به کاربر اجازه می‌دهند به صورت تعاملی کد را مرور کنند. " +"این تمرین خوبی است که رشته‌های docstrings را در کدهایی که می‌نویسید قرار " +"دهید، بنابراین عادت کنید." #: tutorial/controlflow.rst:494 -msgid "The *execution* of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a :keyword:`global` statement, or, for variables of enclosing functions, named in a :keyword:`nonlocal` statement), although they may be referenced." -msgstr "" +#, fuzzy +msgid "" +"The *execution* of a function introduces a new symbol table used for the " +"local variables of the function. More precisely, all variable assignments " +"in a function store the value in the local symbol table; whereas variable " +"references first look in the local symbol table, then in the local symbol " +"tables of enclosing functions, then in the global symbol table, and finally " +"in the table of built-in names. Thus, global variables and variables of " +"enclosing functions cannot be directly assigned a value within a function " +"(unless, for global variables, named in a :keyword:`global` statement, or, " +"for variables of enclosing functions, named in a :keyword:`nonlocal` " +"statement), although they may be referenced." +msgstr "" +"*execution* یک تابع یک جدول نماد جدید را معرفی می کند که برای متغیرهای محلی " +"تابع استفاده می شود. به‌طور دقیق‌تر، همه تخصیص‌های متغیر در یک تابع، مقدار " +"را در جدول نمادهای محلی ذخیره می‌کنند. در حالی که مراجع متغیر ابتدا در جدول " +"نمادهای محلی، سپس در جداول نمادهای محلی توابع محصور، سپس در جدول نمادهای " +"سراسری، و در نهایت در جدول نام‌های داخلی نگاه می‌کنند. بنابراین، متغیرهای " +"سراسری و متغیرهای توابع محصور را نمی‌توان مستقیماً یک مقدار در یک تابع " +"اختصاص داد (مگر اینکه برای متغیرهای سراسری, نام‌گذاری شده در یک دستور " +":keyword:`global`, یا برای متغیرهای توابع محصور, در یک عبارت " +":keyword:`nonlocal` نامگذاری شده باشد), اگرچه ممکن است به آنها ارجاع داده " +"شود." #: tutorial/controlflow.rst:505 -msgid "The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using *call by value* (where the *value* is always an object *reference*, not the value of the object). [#]_ When a function calls another function, or calls itself recursively, a new local symbol table is created for that call." -msgstr "" +#, fuzzy +msgid "" +"The actual parameters (arguments) to a function call are introduced in the " +"local symbol table of the called function when it is called; thus, arguments" +" are passed using *call by value* (where the *value* is always an object " +"*reference*, not the value of the object). [#]_ When a function calls " +"another function, or calls itself recursively, a new local symbol table is " +"created for that call." +msgstr "" +"هنگام فراخوانی تابع فراخوانی، پارامترهای واقعی (آگومان ها) در جدول نمادهای " +"محلی تابع فراخوانی شده معرفی می شوند. بنابراین، آرگومان ها با استفاده از " +"*call by value* ارسال می شوند (که در آن *value* همیشه یک شی *reference* است," +" نه مقدار شی). [#]_ وقتی یک تابع تابع دیگری را فراخوانی می کند، یا خود را به" +" صورت بازگشتی فرا می خواند، یک جدول نماد محلی جدید برای آن فراخوانی ایجاد می" +" شود." #: tutorial/controlflow.rst:512 -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::" +#, fuzzy +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 "" +"یک تعریف تابع نام تابع را با شی تابع در جدول نماد فعلی مرتبط می کند. مفسر " +"شی مورد اشاره با آن نام را به عنوان یک تابع تعریف شده توسط کاربر تشخیص می " +"دهد. نام های دیگر نیز می توانند به همان شی تابع اشاره کنند و همچنین می " +"توانند برای دسترسی به تابع استفاده شوند:" #: tutorial/controlflow.rst:517 -msgid ">>> fib\n" +#, fuzzy +msgid "" +">>> fib\n" "\n" ">>> f = fib\n" ">>> f(100)\n" "0 1 1 2 3 5 8 13 21 34 55 89" msgstr "" +">>> فیب\n" +"\n" +">>> f = فیب\n" +">>> f(100)\n" +"0 1 1 2 3 5 8 13 21 34 55 89" #: tutorial/controlflow.rst:523 -msgid "Coming from other languages, you might object that ``fib`` is not a function but a procedure since it doesn't return a value. In fact, even functions without a :keyword:`return` statement do return a value, albeit a rather boring one. This value is called ``None`` (it's a built-in name). Writing the value ``None`` is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using :func:`print`::" -msgstr "" +#, fuzzy +msgid "" +"Coming from other languages, you might object that ``fib`` is not a function" +" but a procedure since it doesn't return a value. In fact, even functions " +"without a :keyword:`return` statement do return a value, albeit a rather " +"boring one. This value is called ``None`` (it's a built-in name). Writing " +"the value ``None`` is normally suppressed by the interpreter if it would be " +"the only value written. You can see it if you really want to using " +":func:`print`::" +msgstr "" +"از زبان های دیگر، ممکن است اعتراض کنید که ``fib`` یک تابع نیست بلکه یک رویه " +"است زیرا مقداری را بر نمی گرداند. در واقع، حتی توابع بدون دستور " +":keyword:`return`، مقداری را برمی‌گردانند، البته نسبتاً خسته کننده. این " +"مقدار ``None`` نامیده می شود (این یک نام داخلی است). نوشتن مقدار ``None`` " +"معمولاً توسط مفسر سرکوب می شود اگر تنها مقدار نوشته شده باشد. اگر واقعاً می " +"خواهید از :func:`print` استفاده کنید، می توانید آن را ببینید::" #: tutorial/controlflow.rst:530 -msgid ">>> fib(0)\n" +#, fuzzy +msgid "" +">>> fib(0)\n" ">>> print(fib(0))\n" "None" msgstr "" +">>> fib(0)\n" +">>> print(fib(0))\n" +"None" #: tutorial/controlflow.rst:534 -msgid "It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it::" +#, fuzzy +msgid "" +"It is simple to write a function that returns a list of the numbers of the " +"Fibonacci series, instead of printing it::" msgstr "" +"نوشتن تابعی که لیستی از اعداد سری فیبوناچی را برمی گرداند، به جای چاپ کردن، " +"ساده است:" #: tutorial/controlflow.rst:537 -msgid ">>> def fib2(n): # return Fibonacci series up to n\n" +#, fuzzy +msgid "" +">>> def fib2(n): # return Fibonacci series up to n\n" "... \"\"\"Return a list containing the Fibonacci series up to n.\"\"\"\n" "... result = []\n" "... a, b = 0, 1\n" @@ -579,37 +1263,95 @@ msgid ">>> def fib2(n): # return Fibonacci series up to n\n" ">>> f100 # write the result\n" "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]" msgstr "" +">>> def fib2(n): # return Fibonacci series up to n\n" +"... \"\"\"Return a list containing the Fibonacci series up to n.\"\"\"\n" +"... result = []\n" +"... a, b = 0, 1\n" +"... while a < n:\n" +"... result.append(a) # see below\n" +"... a, b = b, a+b\n" +"... return result\n" +"...\n" +">>> f100 = fib2(100) # call it\n" +">>> f100 # write the result\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]" #: tutorial/controlflow.rst:550 +#, fuzzy msgid "This example, as usual, demonstrates some new Python features:" -msgstr "" +msgstr "این مثال، طبق معمول، برخی از ویژگی های جدید پایتون را نشان می دهد:" #: tutorial/controlflow.rst:552 -msgid "The :keyword:`return` statement returns with a value from a function. :keyword:`!return` without an expression argument returns ``None``. Falling off the end of a function also returns ``None``." +#, fuzzy +msgid "" +"The :keyword:`return` statement returns with a value from a function. " +":keyword:`!return` without an expression argument returns ``None``. Falling " +"off the end of a function also returns ``None``." msgstr "" +"دستور :keyword:`return` با مقداری از یک تابع برمی گردد. :keyword:`!return` " +"بدون آرگومان عبارت ``None`` را برمی گرداند. افتادن انتهای یک تابع نیز " +"``None`` را برمی گرداند." #: tutorial/controlflow.rst:556 -msgid "The statement ``result.append(a)`` calls a *method* of the list object ``result``. A method is a function that 'belongs' to an object and is named ``obj.methodname``, where ``obj`` is some object (this may be an expression), and ``methodname`` is the name of a method that is defined by the object's type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using *classes*, see :ref:`tut-classes`) The method :meth:`!append` shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to ``result = result + [a]``, but more efficient." -msgstr "" +#, fuzzy +msgid "" +"The statement ``result.append(a)`` calls a *method* of the list object " +"``result``. A method is a function that 'belongs' to an object and is named" +" ``obj.methodname``, where ``obj`` is some object (this may be an " +"expression), and ``methodname`` is the name of a method that is defined by " +"the object's type. Different types define different methods. Methods of " +"different types may have the same name without causing ambiguity. (It is " +"possible to define your own object types and methods, using *classes*, see " +":ref:`tut-classes`) The method :meth:`!append` shown in the example is " +"defined for list objects; it adds a new element at the end of the list. In " +"this example it is equivalent to ``result = result + [a]``, but more " +"efficient." +msgstr "" +"عبارت ``result.append(a)`` یک *method* از شیء لیست را ``result`` فراخوانی می" +" کند. متد تابعی است که به یک شی تعلق دارد و نام آن ``obj.methodname`` است، " +"که در آن ``obj`` یک شی است (این ممکن است یک عبارت باشد), و ``methodname`` " +"نام روشی است که با نوع شی تعریف می شود. انواع مختلف روش های مختلفی را تعریف " +"می کنند. روش های انواع مختلف ممکن است بدون ایجاد ابهام، نام یکسانی داشته " +"باشند. (این امکان وجود دارد که انواع شی و روش های خود را با استفاده از " +"*classes* تعریف کنید, به :ref:`tut-classes` مراجعه کنید) روش :meth:`!append`" +" نشان داده شده در مثال برای اشیاء لیست تعریف شده است. یک عنصر جدید در انتهای" +" لیست اضافه می کند. در این مثال معادل ``result = result + [a]`` است، اما " +"کارآمدتر است." #: tutorial/controlflow.rst:571 +#, fuzzy msgid "More on Defining Functions" -msgstr "" +msgstr "بیشتر در مورد تعریف توابع" #: tutorial/controlflow.rst:573 -msgid "It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined." +#, fuzzy +msgid "" +"It is also possible to define functions with a variable number of arguments." +" There are three forms, which can be combined." msgstr "" +"همچنین امکان تعریف توابع با تعداد متغیر آرگومان وجود دارد. سه شکل وجود دارد " +"که می توان آنها را با هم ترکیب کرد." #: tutorial/controlflow.rst:580 +#, fuzzy msgid "Default Argument Values" -msgstr "" +msgstr "مقادیر آرگومان پیش فرض" #: tutorial/controlflow.rst:582 -msgid "The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example::" +#, fuzzy +msgid "" +"The most useful form is to specify a default value for one or more " +"arguments. This creates a function that can be called with fewer arguments " +"than it is defined to allow. For example::" msgstr "" +"مفیدترین شکل، تعیین یک مقدار پیش فرض برای یک یا چند آرگومان است. این تابعی " +"را ایجاد می‌کند که می‌توان آن را با آرگومان‌های کمتری فراخوانی کرد. به " +"عنوان مثال::" #: tutorial/controlflow.rst:586 -msgid "def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" +#, fuzzy +msgid "" +"def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" " while True:\n" " reply = input(prompt)\n" " if reply in {'y', 'ye', 'yes'}:\n" @@ -621,33 +1363,71 @@ msgid "def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" " raise ValueError('invalid user response')\n" " print(reminder)" msgstr "" +"def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" +" while True:\n" +" reply = input(prompt)\n" +" if reply in {'y', 'ye', 'yes'}:\n" +" return True\n" +" if reply in {'n', 'no', 'nop', 'nope'}:\n" +" return False\n" +" retries = retries - 1\n" +" if retries < 0:\n" +" raise ValueError('invalid user response')\n" +" print(reminder)" #: tutorial/controlflow.rst:598 +#, fuzzy msgid "This function can be called in several ways:" -msgstr "" +msgstr "این تابع را می توان به چند روش فراخوانی کرد:" #: tutorial/controlflow.rst:600 -msgid "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" +#, fuzzy +msgid "" +"giving only the mandatory argument: ``ask_ok('Do you really want to " +"quit?')``" msgstr "" +"فقط آرگومان اجباری را ارائه می دهد: ``ask_ok('Do you really want to " +"quit?')``" #: tutorial/controlflow.rst:602 -msgid "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', 2)``" +#, fuzzy +msgid "" +"giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " +"2)``" msgstr "" +"ارائه یکی از آرگومان های اختیاری: ``ask_ok('OK to overwrite the file?', 2)``" #: tutorial/controlflow.rst:604 -msgid "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!')``" +#, fuzzy +msgid "" +"or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come" +" on, only yes or no!')``" msgstr "" +"یا حتی ارائه تمام آرگومان ها: ``ask_ok('OK to overwrite the file?', 2, 'Come" +" on, only yes or no!')``" #: tutorial/controlflow.rst:607 -msgid "This example also introduces the :keyword:`in` keyword. This tests whether or not a sequence contains a certain value." +#, fuzzy +msgid "" +"This example also introduces the :keyword:`in` keyword. This tests whether " +"or not a sequence contains a certain value." msgstr "" +"این مثال همچنین کلمه کلیدی :keyword:`in` را معرفی می کند. این آزمایش می کند " +"که آیا یک دنباله دارای مقدار خاصی است یا خیر." #: tutorial/controlflow.rst:610 -msgid "The default values are evaluated at the point of function definition in the *defining* scope, so that ::" +#, fuzzy +msgid "" +"The default values are evaluated at the point of function definition in the " +"*defining* scope, so that ::" msgstr "" +"مقادیر پیش فرض در نقطه تعریف تابع در محدوده *defining* ارزیابی می شوند، به " +"طوری که::" #: tutorial/controlflow.rst:613 -msgid "i = 5\n" +#, fuzzy +msgid "" +"i = 5\n" "\n" "def f(arg=i):\n" " print(arg)\n" @@ -655,17 +1435,36 @@ msgid "i = 5\n" "i = 6\n" "f()" msgstr "" +"i = 5\n" +"\n" +"def f(arg=i):\n" +" print(arg)\n" +"\n" +"i = 6\n" +"f()" #: tutorial/controlflow.rst:621 +#, fuzzy msgid "will print ``5``." -msgstr "" +msgstr "``5`` را چاپ خواهد کرد." #: tutorial/controlflow.rst:623 -msgid "**Important warning:** The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls::" +#, fuzzy +msgid "" +"**Important warning:** The default value is evaluated only once. This makes" +" a difference when the default is a mutable object such as a list, " +"dictionary, or instances of most classes. For example, the following " +"function accumulates the arguments passed to it on subsequent calls::" msgstr "" +"**Important warning:** مقدار پیش فرض فقط یک بار ارزیابی می شود. زمانی که " +"پیش‌فرض یک شیء قابل تغییر مانند فهرست، فرهنگ لغت یا نمونه‌های بیشتر کلاس‌ها " +"باشد، این تفاوت ایجاد می‌کند. به عنوان مثال، تابع زیر آرگومان های ارسال شده" +" به آن را در فراخوانی های بعدی جمع می کند:" #: tutorial/controlflow.rst:628 -msgid "def f(a, L=[]):\n" +#, fuzzy +msgid "" +"def f(a, L=[]):\n" " L.append(a)\n" " return L\n" "\n" @@ -673,75 +1472,153 @@ msgid "def f(a, L=[]):\n" "print(f(2))\n" "print(f(3))" msgstr "" +"def f(a, L=[]):\n" +" L.append(a)\n" +" return L\n" +"\n" +"print(f(1))\n" +"print(f(2))\n" +"print(f(3))" #: tutorial/controlflow.rst:636 +#, fuzzy msgid "This will print ::" -msgstr "" +msgstr "این چاپ خواهد شد::" #: tutorial/controlflow.rst:638 -msgid "[1]\n" +#, fuzzy +msgid "" +"[1]\n" "[1, 2]\n" "[1, 2, 3]" msgstr "" +"[1]\n" +"[1, 2]\n" +"[1, 2, 3]" #: tutorial/controlflow.rst:642 -msgid "If you don't want the default to be shared between subsequent calls, you can write the function like this instead::" +#, fuzzy +msgid "" +"If you don't want the default to be shared between subsequent calls, you can" +" write the function like this instead::" msgstr "" +"اگر نمی‌خواهید پیش‌فرض بین تماس‌های بعدی به اشتراک گذاشته شود، می‌توانید " +"تابع را به این صورت بنویسید:" #: tutorial/controlflow.rst:645 -msgid "def f(a, L=None):\n" +#, fuzzy +msgid "" +"def f(a, L=None):\n" " if L is None:\n" " L = []\n" " L.append(a)\n" " return L" msgstr "" +"def f(a, L=None):\n" +" if L is None:\n" +" L = []\n" +" L.append(a)\n" +" return L" #: tutorial/controlflow.rst:655 +#, fuzzy msgid "Keyword Arguments" -msgstr "" +msgstr "آرگومان های کلیدواژه" #: tutorial/controlflow.rst:657 -msgid "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following function::" +#, fuzzy +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`` فراخوانی کرد. به عنوان مثال، تابع زیر:" #: tutorial/controlflow.rst:660 -msgid "def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" +#, fuzzy +msgid "" +"def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" " print(\"-- This parrot wouldn't\", action, end=' ')\n" " print(\"if you put\", voltage, \"volts through it.\")\n" " print(\"-- Lovely plumage, the\", type)\n" " print(\"-- It's\", state, \"!\")" msgstr "" +"def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" +" print(\"-- This parrot wouldn't\", action, end=' ')\n" +" print(\"if you put\", voltage, \"volts through it.\")\n" +" print(\"-- Lovely plumage, the\", type)\n" +" print(\"-- It's\", state, \"!\")" #: tutorial/controlflow.rst:666 -msgid "accepts one required argument (``voltage``) and three optional arguments (``state``, ``action``, and ``type``). This function can be called in any of the following ways::" +#, fuzzy +msgid "" +"accepts one required argument (``voltage``) and three optional arguments " +"(``state``, ``action``, and ``type``). This function can be called in any " +"of the following ways::" msgstr "" +"یک آرگومان مورد نیاز (``voltage``) و سه آرگومان اختیاری (``state``, " +"``action`` و ``type``) را می پذیرد. این تابع را می توان به یکی از روش های " +"زیر فراخوانی کرد:" #: tutorial/controlflow.rst:670 -msgid "parrot(1000) # 1 positional argument\n" +#, fuzzy +msgid "" +"parrot(1000) # 1 positional argument\n" "parrot(voltage=1000) # 1 keyword argument\n" "parrot(voltage=1000000, action='VOOOOOM') # 2 keyword arguments\n" "parrot(action='VOOOOOM', voltage=1000000) # 2 keyword arguments\n" "parrot('a million', 'bereft of life', 'jump') # 3 positional arguments\n" "parrot('a thousand', state='pushing up the daisies') # 1 positional, 1 keyword" msgstr "" +"parrot(1000) # 1 positional argument\n" +"parrot(voltage=1000) # 1 keyword argument\n" +"parrot(voltage=1000000, action='VOOOOOM') # 2 keyword arguments\n" +"parrot(action='VOOOOOM', voltage=1000000) # 2 keyword arguments\n" +"parrot('a million', 'bereft of life', 'jump') # 3 positional arguments\n" +"parrot('a thousand', state='pushing up the daisies') # 1 positional, 1 keyword" #: tutorial/controlflow.rst:677 +#, fuzzy msgid "but all the following calls would be invalid::" -msgstr "" +msgstr "اما همه تماس های زیر نامعتبر خواهد بود:" #: tutorial/controlflow.rst:679 -msgid "parrot() # required argument missing\n" +#, fuzzy +msgid "" +"parrot() # required argument missing\n" "parrot(voltage=5.0, 'dead') # non-keyword argument after a keyword argument\n" "parrot(110, voltage=220) # duplicate value for the same argument\n" "parrot(actor='John Cleese') # unknown keyword argument" msgstr "" +"parrot() # آرگومان مورد نیاز گم شده است\n" +"parrot(ولتاژ=5.0, 'مرده') # آرگومان غیرکلیدی بعد از آرگومان کلمه کلیدی\n" +"parrot(110, ولتاژ=220) # مقدار تکراری برای همان آرگومان\n" +"parrot(actor='John Cleese') # آرگومان کلیدواژه ناشناخته" #: tutorial/controlflow.rst:684 -msgid "In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. ``actor`` is not a valid argument for the ``parrot`` function), and their order is not important. This also includes non-optional arguments (e.g. ``parrot(voltage=1000)`` is valid too). No argument may receive a value more than once. Here's an example that fails due to this restriction::" -msgstr "" +#, fuzzy +msgid "" +"In a function call, keyword arguments must follow positional arguments. All " +"the keyword arguments passed must match one of the arguments accepted by the" +" function (e.g. ``actor`` is not a valid argument for the ``parrot`` " +"function), and their order is not important. This also includes non-" +"optional arguments (e.g. ``parrot(voltage=1000)`` is valid too). No argument" +" may receive a value more than once. Here's an example that fails due to " +"this restriction::" +msgstr "" +"در فراخوانی تابع، آرگومان های کلیدواژه باید از آرگومان های موقعیتی پیروی " +"کنند. همه آرگومان های کلمه کلیدی ارسال شده باید با یکی از آرگومان های " +"پذیرفته شده توسط تابع مطابقت داشته باشند (مثلاً ``actor`` یک آرگومان معتبر " +"برای تابع ``parrot`` نیست) و ترتیب آنها مهم نیست. این شامل آرگومان های غیر " +"اختیاری نیز می شود (مثلاً ``parrot(voltage=1000)`` نیز معتبر است). هیچ " +"آرگومانی ممکن است بیش از یک بار مقدار دریافت کند. در اینجا یک مثال وجود دارد" +" که به دلیل این محدودیت ناموفق است:" #: tutorial/controlflow.rst:692 -msgid ">>> def function(a):\n" +#, fuzzy +msgid "" +">>> def function(a):\n" "... pass\n" "...\n" ">>> function(0, a=0)\n" @@ -749,13 +1626,37 @@ msgid ">>> def function(a):\n" " File \"\", line 1, in \n" "TypeError: function() got multiple values for argument 'a'" msgstr "" +">>> تابع def(a):\n" +"... بگذرد\n" +"...\n" +">>> تابع (0, a=0)\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: function() چندین مقدار برای آرگومان 'a' دریافت کرد" #: tutorial/controlflow.rst:700 -msgid "When a final formal parameter of the form ``**name`` is present, it receives a dictionary (see :ref:`typesmapping`) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form ``*name`` (described in the next subsection) which receives a :ref:`tuple ` containing the positional arguments beyond the formal parameter list. (``*name`` must occur before ``**name``.) For example, if we define a function like this::" -msgstr "" +#, fuzzy +msgid "" +"When a final formal parameter of the form ``**name`` is present, it receives" +" a dictionary (see :ref:`typesmapping`) containing all keyword arguments " +"except for those corresponding to a formal parameter. This may be combined " +"with a formal parameter of the form ``*name`` (described in the next " +"subsection) which receives a :ref:`tuple ` containing the " +"positional arguments beyond the formal parameter list. (``*name`` must " +"occur before ``**name``.) For example, if we define a function like this::" +msgstr "" +"هنگامی که یک پارامتر رسمی نهایی از فرم ``**name`` وجود دارد، یک فرهنگ لغت " +"دریافت می کند (به :ref:`typesmapping` مراجعه کنید) که شامل همه آرگومان های " +"کلیدواژه به جز آنهایی است که با یک پارامتر رسمی مطابقت دارند. این ممکن است " +"با یک پارامتر رسمی از فرم ``*name`` (شرح شده در زیربخش بعدی) ترکیب شود که یک" +" :ref:`tuple ` حاوی آرگومان های موقعیتی فراتر از لیست پارامترهای" +" رسمی را دریافت می کند. (``*name`` باید قبل از ``**name`` رخ دهد.) برای " +"مثال، اگر تابعی را به این صورت تعریف کنیم:" #: tutorial/controlflow.rst:708 -msgid "def cheeseshop(kind, *arguments, **keywords):\n" +#, fuzzy +msgid "" +"def cheeseshop(kind, *arguments, **keywords):\n" " print(\"-- Do you have any\", kind, \"?\")\n" " print(\"-- I'm sorry, we're all out of\", kind)\n" " for arg in arguments:\n" @@ -764,25 +1665,44 @@ msgid "def cheeseshop(kind, *arguments, **keywords):\n" " for kw in keywords:\n" " print(kw, \":\", keywords[kw])" msgstr "" +"def cheeseshop(kind, *arguments, **keywords):\n" +" print(\"-- Do you have any\", kind, \"?\")\n" +" print(\"-- I'm sorry, we're all out of\", kind)\n" +" for arg in arguments:\n" +" print(arg)\n" +" print(\"-\" * 40)\n" +" for kw in keywords:\n" +" print(kw, \":\", keywords[kw])" #: tutorial/controlflow.rst:717 +#, fuzzy msgid "It could be called like this::" -msgstr "" +msgstr "می توان آن را اینگونه نامید:" #: tutorial/controlflow.rst:719 -msgid "cheeseshop(\"Limburger\", \"It's very runny, sir.\",\n" +#, fuzzy +msgid "" +"cheeseshop(\"Limburger\", \"It's very runny, sir.\",\n" " \"It's really very, VERY runny, sir.\",\n" " shopkeeper=\"Michael Palin\",\n" " client=\"John Cleese\",\n" " sketch=\"Cheese Shop Sketch\")" msgstr "" +"cheeseshop(\"Limburger\", \"It's very runny, sir.\",\n" +" \"It's really very, VERY runny, sir.\",\n" +" shopkeeper=\"Michael Palin\",\n" +" client=\"John Cleese\",\n" +" sketch=\"Cheese Shop Sketch\")" #: tutorial/controlflow.rst:725 +#, fuzzy msgid "and of course it would print:" -msgstr "" +msgstr "و البته چاپ می کرد:" #: tutorial/controlflow.rst:727 -msgid "-- Do you have any Limburger ?\n" +#, fuzzy +msgid "" +"-- Do you have any Limburger ?\n" "-- I'm sorry, we're all out of Limburger\n" "It's very runny, sir.\n" "It's really very, VERY runny, sir.\n" @@ -791,74 +1711,159 @@ msgid "-- Do you have any Limburger ?\n" "client : John Cleese\n" "sketch : Cheese Shop Sketch" msgstr "" +"- آیا لیمبرگر دارید؟\n" +"- متاسفم، ما همه از لیمبرگر خارج شدیم\n" +"خیلی آبریزش داره قربان\n" +"واقعا خیلی خیلی آبریزش داره قربان.\n" +"---------------------------------------\n" +"مغازه دار: مایکل پیلین\n" +"مشتری: جان کلیس\n" +"طرح : طرح فروشگاه پنیر" #: tutorial/controlflow.rst:738 -msgid "Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call." +#, fuzzy +msgid "" +"Note that the order in which the keyword arguments are printed is guaranteed" +" to match the order in which they were provided in the function call." msgstr "" +"توجه داشته باشید که ترتیب چاپ آرگومان‌های کلیدواژه با ترتیبی که در فراخوانی " +"تابع ارائه شده‌اند مطابقت دارد." #: tutorial/controlflow.rst:742 +#, fuzzy msgid "Special parameters" -msgstr "" +msgstr "پارامترهای خاص" #: tutorial/controlflow.rst:744 -msgid "By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword." -msgstr "" +#, fuzzy +msgid "" +"By default, arguments may be passed to a Python function either by position " +"or explicitly by keyword. For readability and performance, it makes sense to" +" restrict the way arguments can be passed so that a developer need only look" +" at the function definition to determine if items are passed by position, by" +" position or keyword, or by keyword." +msgstr "" +"به‌طور پیش‌فرض، آرگومان‌ها ممکن است به یک تابع پایتون بر اساس موقعیت یا " +"صریحاً با کلمه کلیدی ارسال شوند. برای خوانایی و عملکرد، منطقی است که روش " +"ارسال آرگومان‌ها را محدود کنیم، به طوری که یک توسعه‌دهنده فقط باید به تعریف " +"تابع نگاه کند تا تعیین کند آیا موارد بر اساس موقعیت، موقعیت یا کلمه کلیدی یا" +" کلیدواژه ارسال می‌شوند." #: tutorial/controlflow.rst:750 +#, fuzzy msgid "A function definition may look like:" -msgstr "" +msgstr "یک تعریف تابع ممکن است به صورت زیر باشد:" #: tutorial/controlflow.rst:752 -msgid "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):\n" +#, fuzzy +msgid "" +"def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):\n" " ----------- ---------- ----------\n" " | | |\n" " | Positional or keyword |\n" " | - Keyword only\n" " -- Positional only" msgstr "" +"def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):\n" +" ----------- --------- ----------\n" +" | | |\n" +" | موقعیت یا کلمه کلیدی |\n" +" | - فقط کلمه کلیدی\n" +" -- فقط موقعیت" #: tutorial/controlflow.rst:761 -msgid "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters." +#, fuzzy +msgid "" +"where ``/`` and ``*`` are optional. If used, these symbols indicate the kind" +" of parameter by how the arguments may be passed to the function: " +"positional-only, positional-or-keyword, and keyword-only. Keyword parameters" +" are also referred to as named parameters." msgstr "" +"که در آن ``/`` و ``*`` اختیاری هستند. در صورت استفاده، این نمادها نوع " +"پارامتر را با نحوه ارسال آرگومان ها به تابع نشان می دهند: فقط موقعیتی، کلمه " +"کلیدی موقعیتی و فقط کلمه کلیدی. به پارامترهای کلیدواژه به عنوان پارامترهای " +"نامگذاری شده نیز گفته می شود." #: tutorial/controlflow.rst:768 +#, fuzzy msgid "Positional-or-Keyword Arguments" -msgstr "" +msgstr "آرگومان های موقعیت یا کلیدواژه" #: tutorial/controlflow.rst:770 -msgid "If ``/`` and ``*`` are not present in the function definition, arguments may be passed to a function by position or by keyword." +#, fuzzy +msgid "" +"If ``/`` and ``*`` are not present in the function definition, arguments may" +" be passed to a function by position or by keyword." msgstr "" +"اگر ``/`` و ``*`` در تعریف تابع وجود نداشته باشند، ممکن است آرگومان ها بر " +"اساس موقعیت یا کلیدواژه به یک تابع ارسال شوند." #: tutorial/controlflow.rst:775 +#, fuzzy msgid "Positional-Only Parameters" -msgstr "" +msgstr "پارامترهای فقط موقعیت" #: tutorial/controlflow.rst:777 -msgid "Looking at this in a bit more detail, it is possible to mark certain parameters as *positional-only*. If *positional-only*, the parameters' order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a ``/`` (forward-slash). The ``/`` is used to logically separate the positional-only parameters from the rest of the parameters. If there is no ``/`` in the function definition, there are no positional-only parameters." -msgstr "" +#, fuzzy +msgid "" +"Looking at this in a bit more detail, it is possible to mark certain " +"parameters as *positional-only*. If *positional-only*, the parameters' order" +" matters, and the parameters cannot be passed by keyword. Positional-only " +"parameters are placed before a ``/`` (forward-slash). The ``/`` is used to " +"logically separate the positional-only parameters from the rest of the " +"parameters. If there is no ``/`` in the function definition, there are no " +"positional-only parameters." +msgstr "" +"با نگاهی جزئی تر به این موضوع، می توان پارامترهای خاصی را به عنوان " +"*positional-only* علامت گذاری کرد. اگر *positional-only*، ترتیب پارامترها " +"مهم است و پارامترها نمی توانند با کلمه کلیدی منتقل شوند. پارامترهای فقط " +"موقعیتی قبل از یک ``/`` قرار می‌گیرند (میز به جلو). ``/`` برای جداسازی منطقی" +" پارامترهای فقط موقعیتی از بقیه پارامترها استفاده می شود. اگر ``/`` در تعریف" +" تابع وجود نداشته باشد، هیچ پارامتر فقط موقعیتی وجود ندارد." #: tutorial/controlflow.rst:785 -msgid "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-only*." +#, fuzzy +msgid "" +"Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" +"only*." msgstr "" +"پارامترهای پس از ``/`` ممکن است *positional-or-keyword* یا *keyword-only* " +"باشند." #: tutorial/controlflow.rst:789 +#, fuzzy msgid "Keyword-Only Arguments" -msgstr "" +msgstr "آرگومان های فقط کلمه کلیدی" #: tutorial/controlflow.rst:791 -msgid "To mark parameters as *keyword-only*, indicating the parameters must be passed by keyword argument, place an ``*`` in the arguments list just before the first *keyword-only* parameter." +#, fuzzy +msgid "" +"To mark parameters as *keyword-only*, indicating the parameters must be " +"passed by keyword argument, place an ``*`` in the arguments list just before" +" the first *keyword-only* parameter." msgstr "" +"برای علامت گذاری پارامترها به عنوان *keyword-only*، که نشان می دهد پارامترها" +" باید توسط آرگومان کلمه کلیدی ارسال شوند، یک ``*`` را در لیست آرگومان ها " +"درست قبل از اولین پارامتر *keyword-only* قرار دهید." #: tutorial/controlflow.rst:797 +#, fuzzy msgid "Function Examples" -msgstr "" +msgstr "نمونه های تابع" #: tutorial/controlflow.rst:799 -msgid "Consider the following example function definitions paying close attention to the markers ``/`` and ``*``::" +#, fuzzy +msgid "" +"Consider the following example function definitions paying close attention " +"to the markers ``/`` and ``*``::" msgstr "" +"تعاریف تابع مثال زیر را با توجه دقیق به نشانگرهای ``/`` و ``*`` در نظر " +"بگیرید:" #: tutorial/controlflow.rst:802 -msgid ">>> def standard_arg(arg):\n" +#, fuzzy +msgid "" +">>> def standard_arg(arg):\n" "... print(arg)\n" "...\n" ">>> def pos_only_arg(arg, /):\n" @@ -870,25 +1875,56 @@ msgid ">>> def standard_arg(arg):\n" ">>> def combined_example(pos_only, /, standard, *, kwd_only):\n" "... print(pos_only, standard, kwd_only)" msgstr "" +">>> def standard_arg(arg):\n" +"... print(arg)\n" +"...\n" +">>> def pos_only_arg(arg, /):\n" +"... print(arg)\n" +"...\n" +">>> def kwd_only_arg(*, arg):\n" +"... print(arg)\n" +"...\n" +">>> def combined_example(pos_only, /, standard, *, kwd_only):\n" +"... print(pos_only, standard, kwd_only)" #: tutorial/controlflow.rst:815 -msgid "The first function definition, ``standard_arg``, the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword::" +#, fuzzy +msgid "" +"The first function definition, ``standard_arg``, the most familiar form, " +"places no restrictions on the calling convention and arguments may be passed" +" by position or keyword::" msgstr "" +"اولین تعریف تابع، ``standard_arg``، آشناترین شکل، هیچ محدودیتی برای قرارداد " +"فراخوانی قائل نیست و آرگومان ها ممکن است با موقعیت یا کلیدواژه منتقل شوند:" #: tutorial/controlflow.rst:819 -msgid ">>> standard_arg(2)\n" +#, fuzzy +msgid "" +">>> standard_arg(2)\n" "2\n" "\n" ">>> standard_arg(arg=2)\n" "2" msgstr "" +">>> standard_arg(2)\n" +"2\n" +"\n" +">>> standard_arg(arg=2)\n" +"2" #: tutorial/controlflow.rst:825 -msgid "The second function ``pos_only_arg`` is restricted to only use positional parameters as there is a ``/`` in the function definition::" +#, fuzzy +msgid "" +"The second function ``pos_only_arg`` is restricted to only use positional " +"parameters as there is a ``/`` in the function definition::" msgstr "" +"تابع دوم ``pos_only_arg`` فقط به استفاده از پارامترهای موقعیتی محدود شده است" +" زیرا یک ``/`` در تعریف تابع وجود دارد::" #: tutorial/controlflow.rst:828 -msgid ">>> pos_only_arg(1)\n" +#, fuzzy +msgid "" +">>> pos_only_arg(1)\n" "1\n" "\n" ">>> pos_only_arg(arg=1)\n" @@ -896,13 +1932,27 @@ msgid ">>> pos_only_arg(1)\n" " File \"\", line 1, in \n" "TypeError: pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg'" msgstr "" +">>> pos_only_arg (1)\n" +"1\n" +"\n" +">>> pos_only_arg(arg=1)\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: pos_only_arg() برخی از آرگومان های فقط موقعیتی را به عنوان آرگومان های کلمه کلیدی ارسال کرد: 'arg'" #: tutorial/controlflow.rst:836 -msgid "The third function ``kwd_only_arg`` only allows keyword arguments as indicated by a ``*`` in the function definition::" +#, fuzzy +msgid "" +"The third function ``kwd_only_arg`` only allows keyword arguments as " +"indicated by a ``*`` in the function definition::" msgstr "" +"تابع سوم ``kwd_only_arg`` فقط به آرگومان های کلمه کلیدی اجازه می دهد که توسط" +" یک ``*`` در تعریف تابع نشان داده شده است::" #: tutorial/controlflow.rst:839 -msgid ">>> kwd_only_arg(3)\n" +#, fuzzy +msgid "" +">>> kwd_only_arg(3)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: kwd_only_arg() takes 0 positional arguments but 1 was given\n" @@ -910,13 +1960,25 @@ msgid ">>> kwd_only_arg(3)\n" ">>> kwd_only_arg(arg=3)\n" "3" msgstr "" +">>> kwd_only_arg (3)\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: kwd_only_arg() 0 آرگومان موقعیتی می گیرد اما 1 داده شده است\n" +"\n" +">>> kwd_only_arg(arg=3)\n" +"3" #: tutorial/controlflow.rst:847 -msgid "And the last uses all three calling conventions in the same function definition::" -msgstr "" +#, fuzzy +msgid "" +"And the last uses all three calling conventions in the same function " +"definition::" +msgstr "و آخرین از هر سه قرارداد فراخوانی در یک تعریف تابع استفاده می کند:" #: tutorial/controlflow.rst:850 -msgid ">>> combined_example(1, 2, 3)\n" +#, fuzzy +msgid "" +">>> combined_example(1, 2, 3)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: combined_example() takes 2 positional arguments but 3 were given\n" @@ -932,91 +1994,203 @@ msgid ">>> combined_example(1, 2, 3)\n" " File \"\", line 1, in \n" "TypeError: combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only'" msgstr "" +">>> ترکیبی_نمونه(1, 2, 3)\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: Combined_example() 2 آرگومان موقعیتی می گیرد اما 3 آرگومان داده شده است\n" +"\n" +">>> ترکیبی_نمونه(1, 2, kwd_only=3)\n" +"1 2 3\n" +"\n" +">>> ترکیبی_مثال (1, استاندارد=2, kwd_only=3)\n" +"1 2 3\n" +"\n" +">>> ترکیبی_نمونه(pos_only=1, استاندارد=2, kwd_only=3)\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: Combined_example () چند آرگومان فقط موقعیتی به عنوان آرگومان های کلمه کلیدی ارسال کرد: 'pos_only'" #: tutorial/controlflow.rst:867 -msgid "Finally, consider this function definition which has a potential collision between the positional argument ``name`` and ``**kwds`` which has ``name`` as a key::" +#, fuzzy +msgid "" +"Finally, consider this function definition which has a potential collision " +"between the positional argument ``name`` and ``**kwds`` which has ``name`` " +"as a key::" msgstr "" +"در نهایت، این تعریف تابع را در نظر بگیرید که دارای برخورد بالقوه بین آرگومان" +" موقعیتی ``name`` و ``**kwds`` است که دارای ``name`` به عنوان یک کلید است:" #: tutorial/controlflow.rst:869 -msgid "def foo(name, **kwds):\n" +#, fuzzy +msgid "" +"def foo(name, **kwds):\n" " return 'name' in kwds" msgstr "" +"def foo(name, **kwds):\n" +" return 'name' in kwds" #: tutorial/controlflow.rst:872 -msgid "There is no possible call that will make it return ``True`` as the keyword ``'name'`` will always bind to the first parameter. For example::" +#, fuzzy +msgid "" +"There is no possible call that will make it return ``True`` as the keyword " +"``'name'`` will always bind to the first parameter. For example::" msgstr "" +"هیچ فراخوانی ممکنی وجود ندارد که باعث شود ``True`` برگردد زیرا کلمه کلیدی " +"``'name'`` همیشه به پارامتر اول متصل می شود. به عنوان مثال::" #: tutorial/controlflow.rst:875 -msgid ">>> foo(1, **{'name': 2})\n" +#, fuzzy +msgid "" +">>> foo(1, **{'name': 2})\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: foo() got multiple values for argument 'name'\n" ">>>" msgstr "" +">>> foo(1, **{'name': 2})\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: foo() چندین مقدار برای آرگومان 'name' دریافت کرد\n" +">>>" #: tutorial/controlflow.rst:881 -msgid "But using ``/`` (positional only arguments), it is possible since it allows ``name`` as a positional argument and ``'name'`` as a key in the keyword arguments::" +#, fuzzy +msgid "" +"But using ``/`` (positional only arguments), it is possible since it allows " +"``name`` as a positional argument and ``'name'`` as a key in the keyword " +"arguments::" msgstr "" +"اما با استفاده از ``/`` (فقط آرگومان های موقعیتی), این امکان وجود دارد زیرا " +"به ``name`` به عنوان آرگومان موقعیتی و ``'name'`` به عنوان یک کلید در " +"آرگومان های کلیدواژه اجازه می دهد:" #: tutorial/controlflow.rst:883 -msgid ">>> def foo(name, /, **kwds):\n" +#, fuzzy +msgid "" +">>> def foo(name, /, **kwds):\n" "... return 'name' in kwds\n" "...\n" ">>> foo(1, **{'name': 2})\n" "True" msgstr "" +">>> def foo(name, /, **kwds):\n" +"... return 'name' in kwds\n" +"...\n" +">>> foo(1, **{'name': 2})\n" +"True" #: tutorial/controlflow.rst:889 -msgid "In other words, the names of positional-only parameters can be used in ``**kwds`` without ambiguity." +#, fuzzy +msgid "" +"In other words, the names of positional-only parameters can be used in " +"``**kwds`` without ambiguity." msgstr "" +"به عبارت دیگر، نام پارامترهای فقط موقعیتی را می توان در ``**kwds`` بدون " +"ابهام استفاده کرد." #: tutorial/controlflow.rst:894 +#, fuzzy msgid "Recap" -msgstr "" +msgstr "خلاصه" #: tutorial/controlflow.rst:896 -msgid "The use case will determine which parameters to use in the function definition::" +#, fuzzy +msgid "" +"The use case will determine which parameters to use in the function " +"definition::" msgstr "" +"مورد استفاده تعیین می کند که از کدام پارامترها در تعریف تابع استفاده شود:" #: tutorial/controlflow.rst:898 +#, fuzzy msgid "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" -msgstr "" +msgstr "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" #: tutorial/controlflow.rst:900 +#, fuzzy msgid "As guidance:" -msgstr "" +msgstr "به عنوان راهنمایی:" #: tutorial/controlflow.rst:902 -msgid "Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords." +#, fuzzy +msgid "" +"Use positional-only if you want the name of the parameters to not be " +"available to the user. This is useful when parameter names have no real " +"meaning, if you want to enforce the order of the arguments when the function" +" is called or if you need to take some positional parameters and arbitrary " +"keywords." msgstr "" +"اگر می‌خواهید نام پارامترها در دسترس کاربر نباشد، فقط از موقعیتی استفاده " +"کنید. این زمانی مفید است که نام پارامترها معنای واقعی نداشته باشند، اگر " +"می‌خواهید ترتیب آرگومان‌ها را هنگام فراخوانی تابع اعمال کنید یا اگر نیاز به " +"گرفتن برخی از پارامترهای موقعیتی و کلمات کلیدی دلخواه دارید." #: tutorial/controlflow.rst:907 -msgid "Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed." +#, fuzzy +msgid "" +"Use keyword-only when names have meaning and the function definition is more" +" understandable by being explicit with names or you want to prevent users " +"relying on the position of the argument being passed." msgstr "" +"زمانی از کلمه کلیدی استفاده کنید که نام‌ها معنی داشته باشند و تعریف تابع با " +"صریح بودن نام‌ها قابل درک‌تر باشد یا بخواهید از تکیه کاربران به موقعیت " +"آرگومان ارسالی جلوگیری کنید." #: tutorial/controlflow.rst:910 -msgid "For an API, use positional-only to prevent breaking API changes if the parameter's name is modified in the future." +#, fuzzy +msgid "" +"For an API, use positional-only to prevent breaking API changes if the " +"parameter's name is modified in the future." msgstr "" +"برای یک API، از فقط موقعیتی استفاده کنید تا در صورت تغییر نام پارامتر در " +"آینده، از شکستن تغییرات API جلوگیری کنید." #: tutorial/controlflow.rst:916 +#, fuzzy msgid "Arbitrary Argument Lists" -msgstr "" +msgstr "فهرست های استدلال دلخواه" #: tutorial/controlflow.rst:921 -msgid "Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see :ref:`tut-tuples`). Before the variable number of arguments, zero or more normal arguments may occur. ::" +#, fuzzy +msgid "" +"Finally, the least frequently used option is to specify that a function can " +"be called with an arbitrary number of arguments. These arguments will be " +"wrapped up in a tuple (see :ref:`tut-tuples`). Before the variable number " +"of arguments, zero or more normal arguments may occur. ::" msgstr "" +"در نهایت، گزینه ای که کمتر مورد استفاده قرار می گیرد، تعیین این است که یک " +"تابع را می توان با تعداد دلخواه آرگومان فراخوانی کرد. این آرگومان ها در یک " +"تاپل جمع می شوند (به :ref:`tut-tuples` مراجعه کنید). قبل از تعداد متغیر " +"آرگومان ها، ممکن است آرگومان های عادی صفر یا بیشتر رخ دهند. ::" #: tutorial/controlflow.rst:926 -msgid "def write_multiple_items(file, separator, *args):\n" +#, fuzzy +msgid "" +"def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" msgstr "" +"def write_multiple_items(file, separator, *args):\n" +" file.write(separator.join(args))" #: tutorial/controlflow.rst:930 -msgid "Normally, these *variadic* arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the ``*args`` parameter are 'keyword-only' arguments, meaning that they can only be used as keywords rather than positional arguments. ::" -msgstr "" +#, fuzzy +msgid "" +"Normally, these *variadic* arguments will be last in the list of formal " +"parameters, because they scoop up all remaining input arguments that are " +"passed to the function. Any formal parameters which occur after the " +"``*args`` parameter are 'keyword-only' arguments, meaning that they can only" +" be used as keywords rather than positional arguments. ::" +msgstr "" +"به طور معمول، این آرگومان‌های *variadic* آخرین آرگومان‌های فهرست پارامترهای " +"رسمی خواهند بود، زیرا همه آرگومان‌های ورودی باقی‌مانده را که به تابع ارسال " +"می‌شوند، جمع‌آوری می‌کنند. هر پارامتر رسمی که بعد از پارامتر ``*args`` رخ می" +" دهد، آرگومان های \"فقط کلمه کلیدی\" هستند، به این معنی که آنها فقط می " +"توانند به عنوان کلمات کلیدی به جای آرگومان های موقعیتی استفاده شوند. ::" #: tutorial/controlflow.rst:936 -msgid ">>> def concat(*args, sep=\"/\"):\n" +#, fuzzy +msgid "" +">>> def concat(*args, sep=\"/\"):\n" "... return sep.join(args)\n" "...\n" ">>> concat(\"earth\", \"mars\", \"venus\")\n" @@ -1024,29 +2198,64 @@ msgid ">>> def concat(*args, sep=\"/\"):\n" ">>> concat(\"earth\", \"mars\", \"venus\", sep=\".\")\n" "'earth.mars.venus'" msgstr "" +">>> def concat(*args, sep=\"/\"):\n" +"... return sep.join(args)\n" +"...\n" +">>> concat(\"earth\", \"mars\", \"venus\")\n" +"'earth/mars/venus'\n" +">>> concat(\"earth\", \"mars\", \"venus\", sep=\".\")\n" +"'earth.mars.venus'" #: tutorial/controlflow.rst:947 +#, fuzzy msgid "Unpacking Argument Lists" -msgstr "" +msgstr "باز کردن لیست های استدلال" #: tutorial/controlflow.rst:949 -msgid "The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in :func:`range` function expects separate *start* and *stop* arguments. If they are not available separately, write the function call with the ``*``\\ -operator to unpack the arguments out of a list or tuple::" -msgstr "" +#, fuzzy +msgid "" +"The reverse situation occurs when the arguments are already in a list or " +"tuple but need to be unpacked for a function call requiring separate " +"positional arguments. For instance, the built-in :func:`range` function " +"expects separate *start* and *stop* arguments. If they are not available " +"separately, write the function call with the ``*``\\ -operator to unpack " +"the arguments out of a list or tuple::" +msgstr "" +"وضعیت معکوس زمانی اتفاق می‌افتد که آرگومان‌ها از قبل در یک لیست یا چند تایی " +"هستند، اما برای فراخوانی تابعی که نیاز به آرگومان‌های موقعیتی جداگانه دارد، " +"باید بسته‌بندی شوند. به عنوان مثال، تابع داخلی :func:`range` آرگومان های " +"جداگانه *start* و *stop* را انتظار دارد. اگر آنها به طور جداگانه در دسترس " +"نیستند، فراخوانی تابع را با عملگر ``*``\\ - بنویسید تا آرگومان ها از یک لیست" +" یا تاپل باز شوند::" #: tutorial/controlflow.rst:956 -msgid ">>> list(range(3, 6)) # normal call with separate arguments\n" +#, fuzzy +msgid "" +">>> list(range(3, 6)) # normal call with separate arguments\n" "[3, 4, 5]\n" ">>> args = [3, 6]\n" ">>> list(range(*args)) # call with arguments unpacked from a list\n" "[3, 4, 5]" msgstr "" +">>> list(range(3, 6)) # normal call with separate arguments\n" +"[3, 4, 5]\n" +">>> args = [3, 6]\n" +">>> list(range(*args)) # call with arguments unpacked from a list\n" +"[3, 4, 5]" #: tutorial/controlflow.rst:965 -msgid "In the same fashion, dictionaries can deliver keyword arguments with the ``**``\\ -operator::" +#, fuzzy +msgid "" +"In the same fashion, dictionaries can deliver keyword arguments with the " +"``**``\\ -operator::" msgstr "" +"به همین ترتیب، دیکشنری ها می توانند آرگومان های کلمه کلیدی را با ``**``\\ " +"-operator::" #: tutorial/controlflow.rst:968 -msgid ">>> def parrot(voltage, state='a stiff', action='voom'):\n" +#, fuzzy +msgid "" +">>> def parrot(voltage, state='a stiff', action='voom'):\n" "... print(\"-- This parrot wouldn't\", action, end=' ')\n" "... print(\"if you put\", voltage, \"volts through it.\", end=' ')\n" "... print(\"E's\", state, \"!\")\n" @@ -1055,17 +2264,42 @@ msgid ">>> def parrot(voltage, state='a stiff', action='voom'):\n" ">>> parrot(**d)\n" "-- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised !" msgstr "" +">>> def parrot (ولتاژ, حالت='a stiff', action='voom'):\n" +"... print(\"-- این طوطی نمی خواست\", اقدام, پایان=' ')\n" +"... print(\"اگر قرار دهید\", ولتاژ, \"ولت از طریق آن.\", پایان=' ')\n" +"... چاپ (\"E's\", State, \"!\")\n" +"...\n" +">>> d = {\"ولتاژ\": \"چهار میلیون\", \"وضعیت\": \"بدون خونریزی\", \"عمل\": \"VOOM\"}\n" +">>> طوطی (**d)\n" +"- این طوطی اگر چهار میلیون ولت در آن قرار دهید صدای بلند نمی کند. E در حال خونریزی است!" #: tutorial/controlflow.rst:981 +#, fuzzy msgid "Lambda Expressions" -msgstr "" +msgstr "عبارات لامبدا" #: tutorial/controlflow.rst:983 -msgid "Small anonymous functions can be created with the :keyword:`lambda` keyword. This function returns the sum of its two arguments: ``lambda a, b: a+b``. Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope::" -msgstr "" +#, fuzzy +msgid "" +"Small anonymous functions can be created with the :keyword:`lambda` keyword." +" This function returns the sum of its two arguments: ``lambda a, b: a+b``. " +"Lambda functions can be used wherever function objects are required. They " +"are syntactically restricted to a single expression. Semantically, they are" +" just syntactic sugar for a normal function definition. Like nested " +"function definitions, lambda functions can reference variables from the " +"containing scope::" +msgstr "" +"توابع ناشناس کوچک را می توان با کلمه کلیدی :keyword:`lambda` ایجاد کرد. این " +"تابع مجموع دو آرگومان خود را برمی گرداند: ``lambda a, b: a+b``. توابع لامبدا" +" را می توان در هر جایی که به اشیاء تابع مورد نیاز است استفاده کرد. آنها از " +"نظر نحوی به یک عبارت محدود می شوند. از نظر معنایی، آنها فقط قند نحوی برای " +"تعریف عملکرد عادی هستند. مانند تعاریف توابع تو در تو، توابع لامبدا می " +"توانند به متغیرها از محدوده حاوی::" #: tutorial/controlflow.rst:991 -msgid ">>> def make_incrementor(n):\n" +#, fuzzy +msgid "" +">>> def make_incrementor(n):\n" "... return lambda x: x + n\n" "...\n" ">>> f = make_incrementor(42)\n" @@ -1074,44 +2308,111 @@ msgid ">>> def make_incrementor(n):\n" ">>> f(1)\n" "43" msgstr "" +">>> def make_incrementor(n):\n" +"... return lambda x: x + n\n" +"...\n" +">>> f = make_incrementor(42)\n" +">>> f(0)\n" +"42\n" +">>> f(1)\n" +"43" #: tutorial/controlflow.rst:1000 -msgid "The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument::" +#, fuzzy +msgid "" +"The above example uses a lambda expression to return a function. Another " +"use is to pass a small function as an argument::" msgstr "" +"مثال بالا از عبارت lambda برای برگرداندن یک تابع استفاده می کند. استفاده " +"دیگر ارسال یک تابع کوچک به عنوان آرگومان است:" #: tutorial/controlflow.rst:1003 -msgid ">>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]\n" +#, fuzzy +msgid "" +">>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]\n" ">>> pairs.sort(key=lambda pair: pair[1])\n" ">>> pairs\n" "[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]" msgstr "" +">>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]\n" +">>> pairs.sort(key=lambda pair: pair[1])\n" +">>> pairs\n" +"[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]" #: tutorial/controlflow.rst:1012 +#, fuzzy msgid "Documentation Strings" -msgstr "" +msgstr "رشته های مستندات" #: tutorial/controlflow.rst:1019 -msgid "Here are some conventions about the content and formatting of documentation strings." +#, fuzzy +msgid "" +"Here are some conventions about the content and formatting of documentation " +"strings." msgstr "" +"در اینجا چند قرارداد در مورد محتوا و قالب بندی رشته های مستندات وجود دارد." #: tutorial/controlflow.rst:1022 -msgid "The first line should always be a short, concise summary of the object's purpose. For brevity, it should not explicitly state the object's name or type, since these are available by other means (except if the name happens to be a verb describing a function's operation). This line should begin with a capital letter and end with a period." +#, fuzzy +msgid "" +"The first line should always be a short, concise summary of the object's " +"purpose. For brevity, it should not explicitly state the object's name or " +"type, since these are available by other means (except if the name happens " +"to be a verb describing a function's operation). This line should begin " +"with a capital letter and end with a period." msgstr "" +"خط اول همیشه باید خلاصه ای کوتاه و مختصر از هدف شی باشد. برای اختصار، نباید" +" به صراحت نام یا نوع شیء را بیان کند، زیرا این موارد با ابزارهای دیگری در " +"دسترس هستند (به جز اگر نام فعل توصیف کننده عملکرد یک تابع باشد). این خط " +"باید با حرف بزرگ شروع شود و با نقطه پایان یابد." #: tutorial/controlflow.rst:1028 -msgid "If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object's calling conventions, its side effects, etc." +#, fuzzy +msgid "" +"If there are more lines in the documentation string, the second line should " +"be blank, visually separating the summary from the rest of the description." +" The following lines should be one or more paragraphs describing the " +"object's calling conventions, its side effects, etc." msgstr "" +"اگر خطوط بیشتری در رشته مستندات وجود دارد، خط دوم باید خالی باشد و خلاصه را " +"از بقیه توضیحات جدا کند. خطوط زیر باید یک یا چند پاراگراف باشد که " +"قراردادهای فراخوانی شیء، عوارض جانبی آن و غیره را توضیح دهد." #: tutorial/controlflow.rst:1033 -msgid "The Python parser does not strip indentation from multi-line string literals in Python, so tools that process documentation have to strip indentation if desired. This is done using the following convention. The first non-blank line *after* the first line of the string determines the amount of indentation for the entire documentation string. (We can't use the first line since it is generally adjacent to the string's opening quotes so its indentation is not apparent in the string literal.) Whitespace \"equivalent\" to this indentation is then stripped from the start of all lines of the string. Lines that are indented less should not occur, but if they occur all their leading whitespace should be stripped. Equivalence of whitespace should be tested after expansion of tabs (to 8 spaces, normally)." -msgstr "" +#, fuzzy +msgid "" +"The Python parser does not strip indentation from multi-line string literals" +" in Python, so tools that process documentation have to strip indentation if" +" desired. This is done using the following convention. The first non-blank " +"line *after* the first line of the string determines the amount of " +"indentation for the entire documentation string. (We can't use the first " +"line since it is generally adjacent to the string's opening quotes so its " +"indentation is not apparent in the string literal.) Whitespace " +"\"equivalent\" to this indentation is then stripped from the start of all " +"lines of the string. Lines that are indented less should not occur, but if " +"they occur all their leading whitespace should be stripped. Equivalence of " +"whitespace should be tested after expansion of tabs (to 8 spaces, normally)." +msgstr "" +"تجزیه‌کننده پایتون تورفتگی را از رشته‌های چند خطی در پایتون حذف نمی‌کند، " +"بنابراین ابزارهایی که مستندات را پردازش می‌کنند در صورت تمایل باید تورفتگی " +"را حذف کنند. این کار با استفاده از قرارداد زیر انجام می شود. اولین خط غیر " +"خالی *after* اولین خط رشته مقدار تورفتگی را برای کل رشته مستندات تعیین می " +"کند. (ما نمی‌توانیم از خط اول استفاده کنیم, زیرا معمولاً در مجاورت نقل " +"قول‌های ابتدایی رشته است, بنابراین تورفتگی آن در کلمه‌ی رشته مشخص نیست.) " +"فضای سفید «معادل» این تورفتگی از ابتدای تمام خطوط رشته حذف می‌شود. خطوطی که" +" تورفتگی کمتری دارند، نباید رخ دهند، اما اگر رخ دهند، تمام فضای سفید اصلی " +"آنها باید حذف شود. معادل سازی فضای خالی باید پس از گسترش زبانه ها (به طور " +"معمول به 8 فاصله) آزمایش شود." #: tutorial/controlflow.rst:1045 +#, fuzzy msgid "Here is an example of a multi-line docstring::" -msgstr "" +msgstr "در اینجا یک نمونه از یک رشته مستند چند خطی آورده شده است:" #: tutorial/controlflow.rst:1047 -msgid ">>> def my_function():\n" +#, fuzzy +msgid "" +">>> def my_function():\n" "... \"\"\"Do nothing, but document it.\n" "...\n" "... No, really, it doesn't do anything.\n" @@ -1123,21 +2424,60 @@ msgid ">>> def my_function():\n" "\n" " No, really, it doesn't do anything." msgstr "" +">>> def my_function():\n" +"... \"\"\" هیچ کاری انجام ندهید، اما آن را مستند کنید.\n" +"...\n" +"... نه واقعا هیچ کاری نمی کند.\n" +"...\"\"\"\n" +"... بگذرد\n" +"...\n" +">>> print(my_function.__doc__)\n" +"هیچ کاری نکنید، اما آن را مستند کنید.\n" +"\n" +" نه واقعا هیچ کاری نمیکنه" #: tutorial/controlflow.rst:1063 +#, fuzzy msgid "Function Annotations" -msgstr "" +msgstr "حاشیه نویسی تابع" #: tutorial/controlflow.rst:1071 -msgid ":ref:`Function annotations ` are completely optional metadata information about the types used by user-defined functions (see :pep:`3107` and :pep:`484` for more information)." +#, fuzzy +msgid "" +":ref:`Function annotations ` are completely optional metadata " +"information about the types used by user-defined functions (see :pep:`3107` " +"and :pep:`484` for more information)." msgstr "" +":ref:`Function annotations ` اطلاعات فراداده کاملاً اختیاری در " +"مورد انواع استفاده شده توسط توابع تعریف شده توسط کاربر است (برای اطلاعات " +"بیشتر به :pep:`3107` و :pep:`484` مراجعه کنید)." #: tutorial/controlflow.rst:1075 -msgid ":term:`Annotations ` are stored in the :attr:`!__annotations__` attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal ``->``, followed by an expression, between the parameter list and the colon denoting the end of the :keyword:`def` statement. The following example has a required argument, an optional argument, and the return value annotated::" -msgstr "" +#, fuzzy +msgid "" +":term:`Annotations ` are stored in the " +":attr:`!__annotations__` attribute of the function as a dictionary and have " +"no effect on any other part of the function. Parameter annotations are " +"defined by a colon after the parameter name, followed by an expression " +"evaluating to the value of the annotation. Return annotations are defined " +"by a literal ``->``, followed by an expression, between the parameter list " +"and the colon denoting the end of the :keyword:`def` statement. The " +"following example has a required argument, an optional argument, and the " +"return value annotated::" +msgstr "" +":term:`Annotations ` در ویژگی :attr:`!__annotations__` " +"تابع به عنوان یک فرهنگ لغت ذخیره می شود و هیچ تأثیری بر هیچ بخش دیگری از " +"تابع ندارد. حاشیه نویسی پارامترها با یک دونقطه بعد از نام پارامتر و به " +"دنبال آن عبارتی که ارزش حاشیه نویسی را ارزیابی می کند، تعریف می شود. حاشیه " +"نویسی های بازگشتی با یک ``->`` تحت اللفظی تعریف می شوند و به دنبال آن عبارتی" +" بین لیست پارامترها و دو نقطه که پایان عبارت :keyword:`def` را نشان می دهد." +" مثال زیر دارای یک آرگومان الزامی، یک آرگومان اختیاری و مقدار بازگشتی مشروح" +" شده است:" #: tutorial/controlflow.rst:1084 -msgid ">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" +#, fuzzy +msgid "" +">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" "... print(\"Annotations:\", f.__annotations__)\n" "... print(\"Arguments:\", ham, eggs)\n" "... return ham + ' and ' + eggs\n" @@ -1147,131 +2487,230 @@ msgid ">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" "Arguments: spam eggs\n" "'spam and eggs'" msgstr "" +">>> def f(ham: str, eggs: str = 'تخم مرغ') -> str:\n" +"... print(\"Anotations:\", f.__annotations__)\n" +"... چاپ (\"مدلال:\", ژامبون, تخم مرغ)\n" +"... ژامبون + 'و' + تخم مرغ را برگردانید\n" +"...\n" +">>> f ('spam')\n" +"حاشیه نویسی: {'ham': , 'return': , 'eggs': }\n" +"استدلال ها: تخم مرغ های اسپم\n" +"\"هرزنامه و تخم مرغ\"" #: tutorial/controlflow.rst:1097 +#, fuzzy msgid "Intermezzo: Coding Style" -msgstr "" +msgstr "Intermezzo: سبک کدنویسی" #: tutorial/controlflow.rst:1102 -msgid "Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about *coding style*. Most languages can be written (or more concise, *formatted*) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that." -msgstr "" +#, fuzzy +msgid "" +"Now that you are about to write longer, more complex pieces of Python, it is" +" a good time to talk about *coding style*. Most languages can be written " +"(or more concise, *formatted*) in different styles; some are more readable " +"than others. Making it easy for others to read your code is always a good " +"idea, and adopting a nice coding style helps tremendously for that." +msgstr "" +"اکنون که می خواهید قطعات طولانی تر و پیچیده تری از پایتون بنویسید، زمان خوبی" +" است که در مورد *coding style* صحبت کنید. اکثر زبان ها را می توان (یا " +"مختصرتر, *formatted*) به سبک های مختلف نوشت. برخی از آنها خواناتر از دیگران " +"هستند. آسان کردن خواندن کد شما برای دیگران همیشه یک ایده خوب است و اتخاذ یک " +"سبک کدنویسی خوب کمک بزرگی به آن می کند." #: tutorial/controlflow.rst:1108 -msgid "For Python, :pep:`8` has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you:" +#, fuzzy +msgid "" +"For Python, :pep:`8` has emerged as the style guide that most projects " +"adhere to; it promotes a very readable and eye-pleasing coding style. Every" +" Python developer should read it at some point; here are the most important " +"points extracted for you:" msgstr "" +"برای پایتون، :pep:`8` به عنوان راهنمای سبکی ظاهر شده است که اکثر پروژه ها به" +" آن پایبند هستند. این یک سبک کدنویسی بسیار خوانا و چشم نواز را ترویج می کند." +" هر توسعه دهنده پایتون باید آن را در نقطه ای بخواند. در اینجا مهمترین نکات " +"استخراج شده برای شما آورده شده است:" #: tutorial/controlflow.rst:1113 +#, fuzzy msgid "Use 4-space indentation, and no tabs." -msgstr "" +msgstr "از تورفتگی 4 فاصله و بدون زبانه استفاده کنید." #: tutorial/controlflow.rst:1115 -msgid "4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out." +#, fuzzy +msgid "" +"4 spaces are a good compromise between small indentation (allows greater " +"nesting depth) and large indentation (easier to read). Tabs introduce " +"confusion, and are best left out." msgstr "" +"4 فاصله بین تورفتگی کوچک (به عمق بیشتر لانه سازی اجازه می دهد) و فرورفتگی " +"بزرگ (خواندن آسان تر) خوب است. برگه‌ها باعث سردرگمی می‌شوند و بهتر است کنار" +" گذاشته شوند." #: tutorial/controlflow.rst:1119 +#, fuzzy msgid "Wrap lines so that they don't exceed 79 characters." -msgstr "" +msgstr "خطوط را طوری بپیچید که از 79 کاراکتر تجاوز نکنند." #: tutorial/controlflow.rst:1121 -msgid "This helps users with small displays and makes it possible to have several code files side-by-side on larger displays." +#, fuzzy +msgid "" +"This helps users with small displays and makes it possible to have several " +"code files side-by-side on larger displays." msgstr "" +"این به کاربران با نمایشگرهای کوچک کمک می کند و امکان داشتن چندین فایل کد را " +"در کنار هم در نمایشگرهای بزرگتر فراهم می کند." #: tutorial/controlflow.rst:1124 -msgid "Use blank lines to separate functions and classes, and larger blocks of code inside functions." +#, fuzzy +msgid "" +"Use blank lines to separate functions and classes, and larger blocks of code" +" inside functions." msgstr "" +"از خطوط خالی برای جدا کردن توابع و کلاس ها و بلوک های بزرگتر کد در داخل " +"توابع استفاده کنید." #: tutorial/controlflow.rst:1127 +#, fuzzy msgid "When possible, put comments on a line of their own." -msgstr "" +msgstr "در صورت امکان، نظرات خود را در یک خط قرار دهید." #: tutorial/controlflow.rst:1129 +#, fuzzy msgid "Use docstrings." -msgstr "" +msgstr "از Docstrings استفاده کنید." #: tutorial/controlflow.rst:1131 -msgid "Use spaces around operators and after commas, but not directly inside bracketing constructs: ``a = f(1, 2) + g(3, 4)``." +#, fuzzy +msgid "" +"Use spaces around operators and after commas, but not directly inside " +"bracketing constructs: ``a = f(1, 2) + g(3, 4)``." msgstr "" +"از فضاهای اطراف عملگرها و بعد از کاما استفاده کنید، اما نه مستقیماً در " +"ساختارهای براکت: ``a = f(1, 2) + g(3, 4)``." #: tutorial/controlflow.rst:1134 -msgid "Name your classes and functions consistently; the convention is to use ``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for functions and methods. Always use ``self`` as the name for the first method argument (see :ref:`tut-firstclasses` for more on classes and methods)." +#, fuzzy +msgid "" +"Name your classes and functions consistently; the convention is to use " +"``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " +"functions and methods. Always use ``self`` as the name for the first method" +" argument (see :ref:`tut-firstclasses` for more on classes and methods)." msgstr "" +"کلاس ها و توابع خود را به طور مداوم نام ببرید. قرارداد استفاده از " +"``UpperCamelCase`` برای کلاس ها و ``lowercase_with_underscores`` برای توابع " +"و متدها است. همیشه از ``self`` به عنوان نام آرگومان متد اول استفاده کنید " +"(برای اطلاعات بیشتر در مورد کلاس ها و متدها به :ref:`tut-firstclasses` " +"مراجعه کنید)." #: tutorial/controlflow.rst:1139 -msgid "Don't use fancy encodings if your code is meant to be used in international environments. Python's default, UTF-8, or even plain ASCII work best in any case." +#, fuzzy +msgid "" +"Don't use fancy encodings if your code is meant to be used in international " +"environments. Python's default, UTF-8, or even plain ASCII work best in any" +" case." msgstr "" +"اگر قرار است کد شما در محیط های بین المللی استفاده شود، از رمزگذاری های " +"فانتزی استفاده نکنید. پیش‌فرض پایتون، UTF-8 یا حتی ASCII ساده در هر صورت " +"بهترین عملکرد را دارد." #: tutorial/controlflow.rst:1143 -msgid "Likewise, don't use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code." +#, fuzzy +msgid "" +"Likewise, don't use non-ASCII characters in identifiers if there is only the" +" slightest chance people speaking a different language will read or maintain" +" the code." msgstr "" +"به همین ترتیب، اگر فقط کوچکترین احتمالی وجود دارد که افرادی که به زبان دیگری" +" صحبت می کنند، کد را بخوانند یا حفظ کنند، از کاراکترهای غیر ASCII در شناسه " +"ها استفاده نکنید." #: tutorial/controlflow.rst:1149 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/controlflow.rst:1150 -msgid "Actually, *call by object reference* would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list)." +#, fuzzy +msgid "" +"Actually, *call by object reference* would be a better description, since if" +" a mutable object is passed, the caller will see any changes the callee " +"makes to it (items inserted into a list)." msgstr "" +"در واقع، *call by object reference* توصیف بهتری خواهد بود، زیرا اگر یک شیء " +"قابل تغییر ارسال شود، تماس گیرنده هر تغییری را که تماس گیرنده در آن ایجاد می" +" کند (موارد درج شده در یک لیست) مشاهده خواهد کرد." #: tutorial/controlflow.rst:48 +#, fuzzy msgid "statement" -msgstr "" +msgstr "بیانیه" #: tutorial/controlflow.rst:48 +#, fuzzy msgid "for" -msgstr "" +msgstr "برای" -#: tutorial/controlflow.rst:477 -#: tutorial/controlflow.rst:1014 +#: tutorial/controlflow.rst:477 tutorial/controlflow.rst:1014 +#, fuzzy msgid "documentation strings" -msgstr "" +msgstr "رشته های مستندسازی" -#: tutorial/controlflow.rst:477 -#: tutorial/controlflow.rst:1014 +#: tutorial/controlflow.rst:477 tutorial/controlflow.rst:1014 +#, fuzzy msgid "docstrings" -msgstr "" +msgstr "رشته های مستند" -#: tutorial/controlflow.rst:477 -#: tutorial/controlflow.rst:1014 +#: tutorial/controlflow.rst:477 tutorial/controlflow.rst:1014 +#, fuzzy msgid "strings, documentation" -msgstr "" +msgstr "strings, documentation" #: tutorial/controlflow.rst:918 +#, fuzzy msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" -#: tutorial/controlflow.rst:918 -#: tutorial/controlflow.rst:962 +#: tutorial/controlflow.rst:918 tutorial/controlflow.rst:962 +#, fuzzy msgid "in function calls" -msgstr "" +msgstr "در فراخوانی تابع" #: tutorial/controlflow.rst:962 +#, fuzzy msgid "**" -msgstr "" +msgstr "**" #: tutorial/controlflow.rst:1066 +#, fuzzy msgid "function" -msgstr "" +msgstr "تابع" #: tutorial/controlflow.rst:1066 +#, fuzzy msgid "annotations" -msgstr "" +msgstr "حاشیه نویسی" #: tutorial/controlflow.rst:1066 +#, fuzzy msgid "->" -msgstr "" +msgstr "->" #: tutorial/controlflow.rst:1066 +#, fuzzy msgid "function annotations" -msgstr "" +msgstr "حاشیه نویسی عملکرد" #: tutorial/controlflow.rst:1066 +#, fuzzy msgid ": (colon)" -msgstr "" +msgstr ": (دونقطه)" #: tutorial/controlflow.rst:1100 +#, fuzzy msgid "coding" -msgstr "" +msgstr "کد نویسی" #: tutorial/controlflow.rst:1100 +#, fuzzy msgid "style" -msgstr "" +msgstr "سبک" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 92e3e670..24e250a2 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -17,75 +17,140 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/datastructures.rst:5 +#, fuzzy msgid "Data Structures" -msgstr "" +msgstr "ساختارهای داده" #: tutorial/datastructures.rst:7 -msgid "This chapter describes some things you've learned about already in more detail, and adds some new things as well." +#, fuzzy +msgid "" +"This chapter describes some things you've learned about already in more " +"detail, and adds some new things as well." msgstr "" +"این فصل برخی از چیزهایی را که قبلاً در مورد آنها آموخته اید را با جزئیات " +"بیشتر توضیح می دهد و همچنین موارد جدیدی را اضافه می کند." #: tutorial/datastructures.rst:13 +#, fuzzy msgid "More on Lists" -msgstr "" +msgstr "اطلاعات بیشتر در مورد لیست ها" #: tutorial/datastructures.rst:15 -msgid "The list data type has some more methods. Here are all of the methods of list objects:" +#, fuzzy +msgid "" +"The list data type has some more methods. Here are all of the methods of " +"list objects:" msgstr "" +"نوع داده لیست روش های بیشتری دارد. در اینجا همه روش های لیست اشیاء آمده " +"است:" #: tutorial/datastructures.rst:22 +#, fuzzy msgid "Add an item to the end of the list. Similar to ``a[len(a):] = [x]``." -msgstr "" +msgstr "یک مورد را به انتهای لیست اضافه کنید. مشابه ``a[len(a):] = [x]``." #: tutorial/datastructures.rst:28 -msgid "Extend the list by appending all the items from the iterable. Similar to ``a[len(a):] = iterable``." +#, fuzzy +msgid "" +"Extend the list by appending all the items from the iterable. Similar to " +"``a[len(a):] = iterable``." msgstr "" +"لیست را با اضافه کردن همه موارد از تکرار شونده گسترش دهید. مشابه " +"``a[len(a):] = iterable``." #: tutorial/datastructures.rst:35 -msgid "Insert an item at a given position. The first argument is the index of the element before which to insert, so ``a.insert(0, x)`` inserts at the front of the list, and ``a.insert(len(a), x)`` is equivalent to ``a.append(x)``." +#, fuzzy +msgid "" +"Insert an item at a given position. The first argument is the index of the " +"element before which to insert, so ``a.insert(0, x)`` inserts at the front " +"of the list, and ``a.insert(len(a), x)`` is equivalent to ``a.append(x)``." msgstr "" +"یک مورد را در یک موقعیت مشخص درج کنید. اولین آرگومان شاخص عنصری است که قبل " +"از آن درج می شود، بنابراین ``a.insert(0, x)`` در جلوی لیست قرار می گیرد و " +"``a.insert(len(a), x)`` معادل ``a.append(x)`` است." #: tutorial/datastructures.rst:43 -msgid "Remove the first item from the list whose value is equal to *x*. It raises a :exc:`ValueError` if there is no such item." +#, fuzzy +msgid "" +"Remove the first item from the list whose value is equal to *x*. It raises " +"a :exc:`ValueError` if there is no such item." msgstr "" +"اولین مورد را که مقدار آن برابر با *x* است را از لیست حذف کنید. اگر چنین " +"موردی وجود نداشته باشد، یک :exc:`ValueError` را افزایش می دهد." #: tutorial/datastructures.rst:50 -msgid "Remove the item at the given position in the list, and return it. If no index is specified, ``a.pop()`` removes and returns the last item in the list. It raises an :exc:`IndexError` if the list is empty or the index is outside the list range." +#, fuzzy +msgid "" +"Remove the item at the given position in the list, and return it. If no " +"index is specified, ``a.pop()`` removes and returns the last item in the " +"list. It raises an :exc:`IndexError` if the list is empty or the index is " +"outside the list range." msgstr "" +"مورد را در موقعیت داده شده در لیست بردارید و آن را برگردانید. اگر هیچ شاخصی" +" مشخص نشده باشد، ``a.pop()`` آخرین مورد از لیست را حذف کرده و برمی گرداند. " +"اگر لیست خالی باشد یا ایندکس خارج از محدوده لیست باشد، یک :exc:`IndexError` " +"را افزایش می دهد." #: tutorial/datastructures.rst:59 +#, fuzzy msgid "Remove all items from the list. Similar to ``del a[:]``." -msgstr "" +msgstr "تمام موارد را از لیست حذف کنید. مشابه ``del a[:]``." #: tutorial/datastructures.rst:65 -msgid "Return zero-based index in the list of the first item whose value is equal to *x*. Raises a :exc:`ValueError` if there is no such item." +#, fuzzy +msgid "" +"Return zero-based index in the list of the first item whose value is equal " +"to *x*. Raises a :exc:`ValueError` if there is no such item." msgstr "" +"شاخص مبتنی بر صفر را در لیست اولین موردی که مقدار آن برابر با *x* است، " +"برگردانید. اگر چنین موردی وجود نداشته باشد، یک :exc:`ValueError` را افزایش " +"می دهد." #: tutorial/datastructures.rst:68 -msgid "The optional arguments *start* and *end* are interpreted as in the slice notation and are used to limit the search to a particular subsequence of the list. The returned index is computed relative to the beginning of the full sequence rather than the *start* argument." +#, fuzzy +msgid "" +"The optional arguments *start* and *end* are interpreted as in the slice " +"notation and are used to limit the search to a particular subsequence of the" +" list. The returned index is computed relative to the beginning of the full" +" sequence rather than the *start* argument." msgstr "" +"آرگومان های اختیاری *start* و *end* به صورت نماد برش تفسیر می شوند و برای " +"محدود کردن جستجو به دنباله خاصی از لیست استفاده می شوند. شاخص برگشتی به جای" +" آرگومان *start* نسبت به ابتدای دنباله کامل محاسبه می شود." #: tutorial/datastructures.rst:77 +#, fuzzy msgid "Return the number of times *x* appears in the list." -msgstr "" +msgstr "تعداد دفعاتی که *x* در لیست ظاهر می شود را برگردانید." #: tutorial/datastructures.rst:83 -msgid "Sort the items of the list in place (the arguments can be used for sort customization, see :func:`sorted` for their explanation)." +#, fuzzy +msgid "" +"Sort the items of the list in place (the arguments can be used for sort " +"customization, see :func:`sorted` for their explanation)." msgstr "" +"موارد لیست را در جای خود مرتب کنید (از آرگومان ها می توان برای سفارشی سازی " +"مرتب سازی استفاده کرد, برای توضیح آنها به :func:`sorted` مراجعه کنید)." #: tutorial/datastructures.rst:90 +#, fuzzy msgid "Reverse the elements of the list in place." -msgstr "" +msgstr "عناصر لیست را در جای خود معکوس کنید." #: tutorial/datastructures.rst:96 +#, fuzzy msgid "Return a shallow copy of the list. Similar to ``a[:]``." -msgstr "" +msgstr "یک کپی کم عمق از لیست را برگردانید. مشابه ``a[:]``." #: tutorial/datastructures.rst:99 +#, fuzzy msgid "An example that uses most of the list methods::" -msgstr "" +msgstr "مثالی که از اکثر متدهای لیست استفاده می کند:" #: tutorial/datastructures.rst:101 -msgid ">>> fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']\n" +#, fuzzy +msgid "" +">>> fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']\n" ">>> fruits.count('apple')\n" "2\n" ">>> fruits.count('tangerine')\n" @@ -106,25 +171,79 @@ msgid ">>> fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'bana ">>> fruits.pop()\n" "'pear'" msgstr "" +">>> fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']\n" +">>> fruits.count('apple')\n" +"2\n" +">>> fruits.count('tangerine')\n" +"0\n" +">>> fruits.index('banana')\n" +"3\n" +">>> fruits.index('banana', 4) # Find next banana starting at position 4\n" +"6\n" +">>> fruits.reverse()\n" +">>> fruits\n" +"['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']\n" +">>> fruits.append('grape')\n" +">>> fruits\n" +"['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']\n" +">>> fruits.sort()\n" +">>> fruits\n" +"['apple', 'apple', 'banana', 'banana', 'grape', 'kiwi', 'orange', 'pear']\n" +">>> fruits.pop()\n" +"'pear'" #: tutorial/datastructures.rst:122 -msgid "You might have noticed that methods like ``insert``, ``remove`` or ``sort`` that only modify the list have no return value printed -- they return the default ``None``. [#]_ This is a design principle for all mutable data structures in Python." +#, fuzzy +msgid "" +"You might have noticed that methods like ``insert``, ``remove`` or ``sort`` " +"that only modify the list have no return value printed -- they return the " +"default ``None``. [#]_ This is a design principle for all mutable data " +"structures in Python." msgstr "" +"شاید متوجه شده باشید که روش‌هایی مانند ``insert``، ``remove`` یا ``sort`` که" +" فقط فهرست را اصلاح می‌کنند، هیچ مقدار بازگشتی چاپ نشده‌اند -- آنها ``None``" +" پیش‌فرض را برمی‌گردانند. [#]_ این یک اصل طراحی برای تمام ساختارهای داده " +"قابل تغییر در پایتون است." #: tutorial/datastructures.rst:127 -msgid "Another thing you might notice is that not all data can be sorted or compared. For instance, ``[None, 'hello', 10]`` doesn't sort because integers can't be compared to strings and ``None`` can't be compared to other types. Also, there are some types that don't have a defined ordering relation. For example, ``3+4j < 5+7j`` isn't a valid comparison." -msgstr "" +#, fuzzy +msgid "" +"Another thing you might notice is that not all data can be sorted or " +"compared. For instance, ``[None, 'hello', 10]`` doesn't sort because " +"integers can't be compared to strings and ``None`` can't be compared to " +"other types. Also, there are some types that don't have a defined ordering " +"relation. For example, ``3+4j < 5+7j`` isn't a valid comparison." +msgstr "" +"نکته دیگری که ممکن است متوجه شوید این است که همه داده ها را نمی توان مرتب " +"کرد یا مقایسه کرد. به عنوان مثال، ``[None, 'hello', 10]`` مرتب سازی نمی کند" +" زیرا اعداد صحیح را نمی توان با رشته ها مقایسه کرد و ``None`` را نمی توان با" +" انواع دیگر مقایسه کرد. همچنین، برخی از انواع وجود دارند که رابطه سفارشی " +"مشخصی ندارند. برای مثال، ``3+4j < 5+7j`` مقایسه معتبری نیست." #: tutorial/datastructures.rst:138 +#, fuzzy msgid "Using Lists as Stacks" -msgstr "" +msgstr "استفاده از لیست ها به عنوان پشته" #: tutorial/datastructures.rst:143 -msgid "The list methods make it very easy to use a list as a stack, where the last element added is the first element retrieved (\"last-in, first-out\"). To add an item to the top of the stack, use :meth:`!append`. To retrieve an item from the top of the stack, use :meth:`!pop` without an explicit index. For example::" -msgstr "" +#, fuzzy +msgid "" +"The list methods make it very easy to use a list as a stack, where the last " +"element added is the first element retrieved (\"last-in, first-out\"). To " +"add an item to the top of the stack, use :meth:`!append`. To retrieve an " +"item from the top of the stack, use :meth:`!pop` without an explicit index." +" For example::" +msgstr "" +"روش های لیست استفاده از یک لیست را به عنوان پشته بسیار آسان می کند، جایی که " +"آخرین عنصر اضافه شده، اولین عنصر بازیابی شده است (\"آخرین ورود, اولین " +"خروج\"). برای افزودن یک آیتم به بالای پشته، از :meth:`!append` استفاده " +"کنید. برای بازیابی یک آیتم از بالای پشته، از :meth:`!pop` بدون ایندکس صریح " +"استفاده کنید. به عنوان مثال::" #: tutorial/datastructures.rst:148 -msgid ">>> stack = [3, 4, 5]\n" +#, fuzzy +msgid "" +">>> stack = [3, 4, 5]\n" ">>> stack.append(6)\n" ">>> stack.append(7)\n" ">>> stack\n" @@ -140,21 +259,56 @@ msgid ">>> stack = [3, 4, 5]\n" ">>> stack\n" "[3, 4]" msgstr "" +">>> stack = [3, 4, 5]\n" +">>> stack.append(6)\n" +">>> stack.append(7)\n" +">>> stack\n" +"[3, 4, 5, 6, 7]\n" +">>> stack.pop()\n" +"7\n" +">>> stack\n" +"[3, 4, 5, 6]\n" +">>> stack.pop()\n" +"6\n" +">>> stack.pop()\n" +"5\n" +">>> stack\n" +"[3, 4]" #: tutorial/datastructures.rst:168 +#, fuzzy msgid "Using Lists as Queues" -msgstr "" +msgstr "استفاده از لیست ها به عنوان صف" #: tutorial/datastructures.rst:172 -msgid "It is also possible to use a list as a queue, where the first element added is the first element retrieved (\"first-in, first-out\"); however, lists are not efficient for this purpose. While appends and pops from the end of list are fast, doing inserts or pops from the beginning of a list is slow (because all of the other elements have to be shifted by one)." -msgstr "" +#, fuzzy +msgid "" +"It is also possible to use a list as a queue, where the first element added " +"is the first element retrieved (\"first-in, first-out\"); however, lists are" +" not efficient for this purpose. While appends and pops from the end of " +"list are fast, doing inserts or pops from the beginning of a list is slow " +"(because all of the other elements have to be shifted by one)." +msgstr "" +"همچنین می توان از یک لیست به عنوان صف استفاده کرد، که در آن اولین عنصر اضافه" +" شده، اولین عنصر بازیابی شده است (\"first-in, first-out\"). با این حال، لیست" +" ها برای این منظور کارآمد نیستند. در حالی که ضمیمه‌ها و پاپ‌ها از انتهای " +"فهرست سریع هستند، انجام درج‌ها یا پاپ‌ها از ابتدای فهرست به کندی انجام " +"می‌شود (زیرا همه عناصر دیگر باید با یک جابجا شوند)." #: tutorial/datastructures.rst:178 -msgid "To implement a queue, use :class:`collections.deque` which was designed to have fast appends and pops from both ends. For example::" +#, fuzzy +msgid "" +"To implement a queue, use :class:`collections.deque` which was designed to " +"have fast appends and pops from both ends. For example::" msgstr "" +"برای پیاده سازی یک صف، از :class:`collections.deque` استفاده کنید که به گونه" +" ای طراحی شده است که دارای ضمائم سریع و پاپ از هر دو طرف باشد. به عنوان " +"مثال::" #: tutorial/datastructures.rst:181 -msgid ">>> from collections import deque\n" +#, fuzzy +msgid "" +">>> from collections import deque\n" ">>> queue = deque([\"Eric\", \"John\", \"Michael\"])\n" ">>> queue.append(\"Terry\") # Terry arrives\n" ">>> queue.append(\"Graham\") # Graham arrives\n" @@ -165,63 +319,122 @@ msgid ">>> from collections import deque\n" ">>> queue # Remaining queue in order of arrival\n" "deque(['Michael', 'Terry', 'Graham'])" msgstr "" +">>> from collections import deque\n" +">>> queue = deque([\"Eric\", \"John\", \"Michael\"])\n" +">>> queue.append(\"Terry\") # Terry arrives\n" +">>> queue.append(\"Graham\") # Graham arrives\n" +">>> queue.popleft() # The first to arrive now leaves\n" +"'Eric'\n" +">>> queue.popleft() # The second to arrive now leaves\n" +"'John'\n" +">>> queue # Remaining queue in order of arrival\n" +"deque(['Michael', 'Terry', 'Graham'])" #: tutorial/datastructures.rst:196 +#, fuzzy msgid "List Comprehensions" -msgstr "" +msgstr "فهرست درک" #: tutorial/datastructures.rst:198 -msgid "List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition." +#, fuzzy +msgid "" +"List comprehensions provide a concise way to create lists. Common " +"applications are to make new lists where each element is the result of some " +"operations applied to each member of another sequence or iterable, or to " +"create a subsequence of those elements that satisfy a certain condition." msgstr "" +"درک فهرست ها راهی مختصر برای ایجاد لیست ها فراهم می کند. برنامه های رایج " +"عبارتند از ایجاد لیست های جدید که در آن هر عنصر نتیجه برخی از عملیات اعمال " +"شده بر روی هر یک از اعضای یک دنباله دیگر یا قابل تکرار است، یا ایجاد دنباله " +"ای از آن عناصر که شرایط خاصی را برآورده می کند." #: tutorial/datastructures.rst:203 +#, fuzzy msgid "For example, assume we want to create a list of squares, like::" -msgstr "" +msgstr "به عنوان مثال، فرض کنید می خواهیم لیستی از مربع ها ایجاد کنیم، مانند:" #: tutorial/datastructures.rst:205 -msgid ">>> squares = []\n" +#, fuzzy +msgid "" +">>> squares = []\n" ">>> for x in range(10):\n" "... squares.append(x**2)\n" "...\n" ">>> squares\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" msgstr "" +">>> squares = []\n" +">>> for x in range(10):\n" +"... squares.append(x**2)\n" +"...\n" +">>> squares\n" +"[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" #: tutorial/datastructures.rst:212 -msgid "Note that this creates (or overwrites) a variable named ``x`` that still exists after the loop completes. We can calculate the list of squares without any side effects using::" +#, fuzzy +msgid "" +"Note that this creates (or overwrites) a variable named ``x`` that still " +"exists after the loop completes. We can calculate the list of squares " +"without any side effects using::" msgstr "" +"توجه داشته باشید که با این کار متغیری به نام ``x`` ایجاد می شود (یا بازنویسی" +" می شود) که پس از اتمام حلقه همچنان وجود دارد. ما می توانیم لیست مربع ها را" +" بدون هیچ گونه عوارض جانبی با استفاده از:" #: tutorial/datastructures.rst:216 +#, fuzzy msgid "squares = list(map(lambda x: x**2, range(10)))" -msgstr "" +msgstr "squares = list(map(lambda x: x**2, range(10)))" #: tutorial/datastructures.rst:218 +#, fuzzy msgid "or, equivalently::" -msgstr "" +msgstr "یا به طور معادل::" #: tutorial/datastructures.rst:220 +#, fuzzy msgid "squares = [x**2 for x in range(10)]" -msgstr "" +msgstr "squares = [x**2 for x in range(10)]" #: tutorial/datastructures.rst:222 +#, fuzzy msgid "which is more concise and readable." -msgstr "" +msgstr "که مختصرتر و خواندنی تر است." #: tutorial/datastructures.rst:224 -msgid "A list comprehension consists of brackets containing an expression followed by a :keyword:`!for` clause, then zero or more :keyword:`!for` or :keyword:`!if` clauses. The result will be a new list resulting from evaluating the expression in the context of the :keyword:`!for` and :keyword:`!if` clauses which follow it. For example, this listcomp combines the elements of two lists if they are not equal::" -msgstr "" +#, fuzzy +msgid "" +"A list comprehension consists of brackets containing an expression followed " +"by a :keyword:`!for` clause, then zero or more :keyword:`!for` or " +":keyword:`!if` clauses. The result will be a new list resulting from " +"evaluating the expression in the context of the :keyword:`!for` and " +":keyword:`!if` clauses which follow it. For example, this listcomp combines " +"the elements of two lists if they are not equal::" +msgstr "" +"درک لیست شامل براکت هایی است که شامل عبارتی به دنبال آن یک بند " +":keyword:`!for` و سپس صفر یا بیشتر عبارت :keyword:`!for` یا :keyword:`!if` " +"است. نتیجه یک لیست جدید خواهد بود که از ارزیابی عبارت در متن بندهای " +":keyword:`!for` و :keyword:`!if` حاصل می شود. به عنوان مثال، این listcomp " +"عناصر دو لیست را در صورتی که برابر نباشند ترکیب می کند:" #: tutorial/datastructures.rst:231 -msgid ">>> [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y]\n" +#, fuzzy +msgid "" +">>> [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y]\n" "[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]" msgstr "" +">>> [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y]\n" +"[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]" #: tutorial/datastructures.rst:234 +#, fuzzy msgid "and it's equivalent to::" -msgstr "" +msgstr "و معادل است با::" #: tutorial/datastructures.rst:236 -msgid ">>> combs = []\n" +#, fuzzy +msgid "" +">>> combs = []\n" ">>> for x in [1,2,3]:\n" "... for y in [3,1,4]:\n" "... if x != y:\n" @@ -230,17 +443,36 @@ msgid ">>> combs = []\n" ">>> combs\n" "[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]" msgstr "" +">>> combs = []\n" +">>> for x in [1,2,3]:\n" +"... for y in [3,1,4]:\n" +"... if x != y:\n" +"... combs.append((x, y))\n" +"...\n" +">>> combs\n" +"[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]" #: tutorial/datastructures.rst:245 -msgid "Note how the order of the :keyword:`for` and :keyword:`if` statements is the same in both these snippets." +#, fuzzy +msgid "" +"Note how the order of the :keyword:`for` and :keyword:`if` statements is the" +" same in both these snippets." msgstr "" +"توجه داشته باشید که چگونه ترتیب دستورات :keyword:`for` و :keyword:`if` در هر" +" دو قطعه یکسان است." #: tutorial/datastructures.rst:248 -msgid "If the expression is a tuple (e.g. the ``(x, y)`` in the previous example), it must be parenthesized. ::" +#, fuzzy +msgid "" +"If the expression is a tuple (e.g. the ``(x, y)`` in the previous example), " +"it must be parenthesized. ::" msgstr "" +"اگر عبارت یک تاپلی باشد (مثلاً ``(x, y)`` در مثال قبلی), باید پرانتز شود. ::" #: tutorial/datastructures.rst:251 -msgid ">>> vec = [-4, -2, 0, 2, 4]\n" +#, fuzzy +msgid "" +">>> vec = [-4, -2, 0, 2, 4]\n" ">>> # create a new list with the values doubled\n" ">>> [x*2 for x in vec]\n" "[-8, -4, 0, 4, 8]\n" @@ -268,65 +500,139 @@ msgid ">>> vec = [-4, -2, 0, 2, 4]\n" ">>> [num for elem in vec for num in elem]\n" "[1, 2, 3, 4, 5, 6, 7, 8, 9]" msgstr "" +">>> vec = [-4, -2, 0, 2, 4]\n" +">>> # یک لیست جدید با مقادیر دو برابر شده ایجاد کنید\n" +">>> [x*2 for x in vec]\n" +"[-8, -4, 0, 4, 8]\n" +">>> # filter the list to exclude negative numbers\n" +">>> [x for x in vec if x >= 0]\n" +"[0, 2, 4]\n" +">>> # apply a function to all the elements\n" +">>> [abs(x) for x in vec]\n" +"[4, 2, 0, 2, 4]\n" +">>> # call a method on each element\n" +">>> freshfruit = [' banana', ' loganberry ', 'passion fruit ']\n" +">>> [weapon.strip() for weapon in freshfruit]\n" +"['banana', 'loganberry', 'passion fruit']\n" +">>> # create a list of 2-tuples like (number, square)\n" +">>> [(x, x**2) for x in range(6)]\n" +"[(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)]\n" +">>> # the tuple must be parenthesized, otherwise an error is raised\n" +">>> [x, x**2 for x in range(6)]\n" +" File \"\", line 1\n" +" [x, x**2 برای x در محدوده (6)]\n" +" ^^^^^^^\n" +"SyntaxError: آیا پرانتزهای اطراف هدف درک مطلب را فراموش کرده اید؟\n" +">>> # یک لیست را با استفاده از یک listcomp با دو \"برای\" مسطح کنید\n" +">>> vec = [[1,2,3], [4,5,6], [7,8,9]]\n" +">>> [num برای elem در vec برای num in elem]\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9]" #: tutorial/datastructures.rst:279 -msgid "List comprehensions can contain complex expressions and nested functions::" -msgstr "" +#, fuzzy +msgid "" +"List comprehensions can contain complex expressions and nested functions::" +msgstr "درک لیست می تواند شامل عبارات پیچیده و توابع تو در تو باشد:" #: tutorial/datastructures.rst:281 -msgid ">>> from math import pi\n" +#, fuzzy +msgid "" +">>> from math import pi\n" ">>> [str(round(pi, i)) for i in range(1, 6)]\n" "['3.1', '3.14', '3.142', '3.1416', '3.14159']" msgstr "" +">>> from math import pi\n" +">>> [str(round(pi, i)) for i in range(1, 6)]\n" +"['3.1', '3.14', '3.142', '3.1416', '3.14159']" #: tutorial/datastructures.rst:286 +#, fuzzy msgid "Nested List Comprehensions" -msgstr "" +msgstr "درک لیست تودرتو" #: tutorial/datastructures.rst:288 -msgid "The initial expression in a list comprehension can be any arbitrary expression, including another list comprehension." +#, fuzzy +msgid "" +"The initial expression in a list comprehension can be any arbitrary " +"expression, including another list comprehension." msgstr "" +"عبارت اولیه در درک لیست می تواند هر عبارت دلخواه، از جمله درک لیست دیگری " +"باشد." #: tutorial/datastructures.rst:291 -msgid "Consider the following example of a 3x4 matrix implemented as a list of 3 lists of length 4::" +#, fuzzy +msgid "" +"Consider the following example of a 3x4 matrix implemented as a list of 3 " +"lists of length 4::" msgstr "" +"مثال زیر را از یک ماتریس 3x4 در نظر بگیرید که به صورت لیستی از 3 لیست با طول" +" 4 پیاده سازی شده است:" #: tutorial/datastructures.rst:294 -msgid ">>> matrix = [\n" +#, fuzzy +msgid "" +">>> matrix = [\n" "... [1, 2, 3, 4],\n" "... [5, 6, 7, 8],\n" "... [9, 10, 11, 12],\n" "... ]" msgstr "" +">>> matrix = [\n" +"... [1, 2, 3, 4],\n" +"... [5, 6, 7, 8],\n" +"... [9, 10, 11, 12],\n" +"... ]" #: tutorial/datastructures.rst:300 +#, fuzzy msgid "The following list comprehension will transpose rows and columns::" -msgstr "" +msgstr "درک لیست زیر سطرها و ستون ها را جابجا می کند:" #: tutorial/datastructures.rst:302 -msgid ">>> [[row[i] for row in matrix] for i in range(4)]\n" +#, fuzzy +msgid "" +">>> [[row[i] for row in matrix] for i in range(4)]\n" "[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" msgstr "" +">>> [[row[i] for row in matrix] for i in range(4)]\n" +"[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" #: tutorial/datastructures.rst:305 -msgid "As we saw in the previous section, the inner list comprehension is evaluated in the context of the :keyword:`for` that follows it, so this example is equivalent to::" +#, fuzzy +msgid "" +"As we saw in the previous section, the inner list comprehension is evaluated" +" in the context of the :keyword:`for` that follows it, so this example is " +"equivalent to::" msgstr "" +"همانطور که در بخش قبل دیدیم، درک فهرست داخلی در زمینه :keyword:`for` که به " +"دنبال آن است، ارزیابی می شود، بنابراین این مثال معادل:" #: tutorial/datastructures.rst:309 -msgid ">>> transposed = []\n" +#, fuzzy +msgid "" +">>> transposed = []\n" ">>> for i in range(4):\n" "... transposed.append([row[i] for row in matrix])\n" "...\n" ">>> transposed\n" "[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" msgstr "" +">>> transposed = []\n" +">>> for i in range(4):\n" +"... transposed.append([row[i] for row in matrix])\n" +"...\n" +">>> transposed\n" +"[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" #: tutorial/datastructures.rst:316 +#, fuzzy msgid "which, in turn, is the same as::" -msgstr "" +msgstr "که به نوبه خود همان است که:" #: tutorial/datastructures.rst:318 -msgid ">>> transposed = []\n" +#, fuzzy +msgid "" +">>> transposed = []\n" ">>> for i in range(4):\n" "... # the following 3 lines implement the nested listcomp\n" "... transposed_row = []\n" @@ -337,30 +643,68 @@ msgid ">>> transposed = []\n" ">>> transposed\n" "[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" msgstr "" +">>> transposed = []\n" +">>> for i in range(4):\n" +"... # the following 3 lines implement the nested listcomp\n" +"... transposed_row = []\n" +"... for row in matrix:\n" +"... transposed_row.append(row[i])\n" +"... transposed.append(transposed_row)\n" +"...\n" +">>> transposed\n" +"[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" #: tutorial/datastructures.rst:329 -msgid "In the real world, you should prefer built-in functions to complex flow statements. The :func:`zip` function would do a great job for this use case::" +#, fuzzy +msgid "" +"In the real world, you should prefer built-in functions to complex flow " +"statements. The :func:`zip` function would do a great job for this use " +"case::" msgstr "" +"در دنیای واقعی، شما باید توابع داخلی را به دستورات جریان پیچیده ترجیح دهید. " +"تابع :func:`zip` کار بسیار خوبی برای این مورد استفاده می کند:" #: tutorial/datastructures.rst:332 -msgid ">>> list(zip(*matrix))\n" +#, fuzzy +msgid "" +">>> list(zip(*matrix))\n" "[(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]" msgstr "" +">>> list(zip(*matrix))\n" +"[(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]" #: tutorial/datastructures.rst:335 -msgid "See :ref:`tut-unpacking-arguments` for details on the asterisk in this line." +#, fuzzy +msgid "" +"See :ref:`tut-unpacking-arguments` for details on the asterisk in this line." msgstr "" +"برای جزئیات بیشتر در مورد ستاره در این خط به :ref:`tut-unpacking-arguments` " +"مراجعه کنید." #: tutorial/datastructures.rst:340 +#, fuzzy msgid "The :keyword:`!del` statement" -msgstr "" +msgstr "بیانیه :keyword:`!del`" #: tutorial/datastructures.rst:342 -msgid "There is a way to remove an item from a list given its index instead of its value: the :keyword:`del` statement. This differs from the :meth:`!pop` method which returns a value. The :keyword:`!del` statement can also be used to remove slices from a list or clear the entire list (which we did earlier by assignment of an empty list to the slice). For example::" -msgstr "" +#, fuzzy +msgid "" +"There is a way to remove an item from a list given its index instead of its " +"value: the :keyword:`del` statement. This differs from the :meth:`!pop` " +"method which returns a value. The :keyword:`!del` statement can also be " +"used to remove slices from a list or clear the entire list (which we did " +"earlier by assignment of an empty list to the slice). For example::" +msgstr "" +"راهی برای حذف یک آیتم از فهرست با توجه به شاخص آن به جای مقدار آن وجود دارد:" +" عبارت :keyword:`del`. این با روش :meth:`!pop` که مقداری را برمی گرداند " +"متفاوت است. دستور :keyword:`!del` همچنین می تواند برای حذف برش ها از یک " +"لیست یا پاک کردن کل لیست استفاده شود (که قبلاً با اختصاص یک لیست خالی به برش" +" انجام دادیم). به عنوان مثال::" #: tutorial/datastructures.rst:348 -msgid ">>> a = [-1, 1, 66.25, 333, 333, 1234.5]\n" +#, fuzzy +msgid "" +">>> a = [-1, 1, 66.25, 333, 333, 1234.5]\n" ">>> del a[0]\n" ">>> a\n" "[1, 66.25, 333, 333, 1234.5]\n" @@ -371,33 +715,69 @@ msgid ">>> a = [-1, 1, 66.25, 333, 333, 1234.5]\n" ">>> a\n" "[]" msgstr "" +">>> a = [-1, 1, 66.25, 333, 333, 1234.5]\n" +">>> del a[0]\n" +">>> a\n" +"[1, 66.25, 333, 333, 1234.5]\n" +">>> del a[2:4]\n" +">>> a\n" +"[1, 66.25, 1234.5]\n" +">>> del a[:]\n" +">>> a\n" +"[]" #: tutorial/datastructures.rst:359 +#, fuzzy msgid ":keyword:`del` can also be used to delete entire variables::" -msgstr "" +msgstr ":keyword:`del` همچنین می تواند برای حذف کل متغیرها استفاده شود:" #: tutorial/datastructures.rst:361 +#, fuzzy msgid ">>> del a" -msgstr "" +msgstr ">>> del a" #: tutorial/datastructures.rst:363 -msgid "Referencing the name ``a`` hereafter is an error (at least until another value is assigned to it). We'll find other uses for :keyword:`del` later." +#, fuzzy +msgid "" +"Referencing the name ``a`` hereafter is an error (at least until another " +"value is assigned to it). We'll find other uses for :keyword:`del` later." msgstr "" +"ارجاع به نام ``a`` از این پس یک خطا است (حداقل تا زمانی که مقدار دیگری به آن" +" اختصاص داده شود). ما بعداً کاربردهای دیگری برای :keyword:`del` پیدا خواهیم" +" کرد." #: tutorial/datastructures.rst:370 +#, fuzzy msgid "Tuples and Sequences" -msgstr "" +msgstr "Tuples and Sequences" #: tutorial/datastructures.rst:372 -msgid "We saw that lists and strings have many common properties, such as indexing and slicing operations. They are two examples of *sequence* data types (see :ref:`typesseq`). Since Python is an evolving language, other sequence data types may be added. There is also another standard sequence data type: the *tuple*." -msgstr "" +#, fuzzy +msgid "" +"We saw that lists and strings have many common properties, such as indexing " +"and slicing operations. They are two examples of *sequence* data types (see" +" :ref:`typesseq`). Since Python is an evolving language, other sequence " +"data types may be added. There is also another standard sequence data type:" +" the *tuple*." +msgstr "" +"دیدیم که لیست‌ها و رشته‌ها ویژگی‌های مشترک زیادی دارند، مانند عملیات " +"فهرست‌سازی و برش. آنها دو نمونه از انواع داده *sequence* هستند (به " +":ref:`typesseq` مراجعه کنید). از آنجایی که پایتون یک زبان در حال تکامل است،" +" ممکن است انواع داده های توالی دیگری اضافه شود. نوع داده توالی استاندارد " +"دیگری نیز وجود دارد: *tuple*." #: tutorial/datastructures.rst:378 -msgid "A tuple consists of a number of values separated by commas, for instance::" +#, fuzzy +msgid "" +"A tuple consists of a number of values separated by commas, for instance::" msgstr "" +"یک تاپل از تعدادی مقدار تشکیل شده است که با کاما از هم جدا شده اند، به عنوان" +" مثال:" #: tutorial/datastructures.rst:380 -msgid ">>> t = 12345, 54321, 'hello!'\n" +#, fuzzy +msgid "" +">>> t = 12345, 54321, 'hello!'\n" ">>> t[0]\n" "12345\n" ">>> t\n" @@ -416,21 +796,80 @@ msgid ">>> t = 12345, 54321, 'hello!'\n" ">>> v\n" "([1, 2, 3], [3, 2, 1])" msgstr "" +">>> t = 12345, 54321, 'سلام!'\n" +">>> t[0]\n" +"12345\n" +">>> ت\n" +"(12345, 54321, 'سلام!')\n" +">>> # تاپل ممکن است تو در تو باشد:\n" +">>> u = t, (1, 2, 3, 4, 5)\n" +">>> تو\n" +"((12345, 54321, 'سلام!')، (1, 2, 3, 4, 5))\n" +">>> # تاپل تغییرناپذیر است:\n" +">>> t[0] = 88888\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: شیء 'tuple' از انتساب آیتم پشتیبانی نمی کند\n" +">>> # اما می توانند شامل اشیاء قابل تغییر باشند:\n" +">>> v = ([1, 2, 3], [3, 2, 1])\n" +">>> v\n" +"([1, 2, 3], [3, 2, 1])" #: tutorial/datastructures.rst:400 -msgid "As you see, on output tuples are always enclosed in parentheses, so that nested tuples are interpreted correctly; they may be input with or without surrounding parentheses, although often parentheses are necessary anyway (if the tuple is part of a larger expression). It is not possible to assign to the individual items of a tuple, however it is possible to create tuples which contain mutable objects, such as lists." -msgstr "" +#, fuzzy +msgid "" +"As you see, on output tuples are always enclosed in parentheses, so that " +"nested tuples are interpreted correctly; they may be input with or without " +"surrounding parentheses, although often parentheses are necessary anyway (if" +" the tuple is part of a larger expression). It is not possible to assign to" +" the individual items of a tuple, however it is possible to create tuples " +"which contain mutable objects, such as lists." +msgstr "" +"همانطور که می بینید، تاپل های خروجی همیشه در داخل پرانتز قرار می گیرند، به " +"طوری که تاپل های تو در تو به درستی تفسیر می شوند. آنها ممکن است با یا بدون " +"پرانتزهای اطراف وارد شوند، اگرچه اغلب پرانتزها به هر حال ضروری هستند (اگر " +"تاپل بخشی از یک عبارت بزرگتر باشد). نمی‌توان به تک تک آیتم‌های یک تاپل " +"اختصاص داد، با این حال می‌توان تاپل‌هایی ایجاد کرد که حاوی اشیاء قابل تغییر،" +" مانند لیست‌ها هستند." #: tutorial/datastructures.rst:407 -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 "" +#, fuzzy +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` هستند و عناصر آنها معمولاً همگن هستند و با تکرار در لیست " +"قابل دسترسی هستند." #: tutorial/datastructures.rst:415 -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 "" +#, fuzzy +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 آیتم هستند: نحو دارای برخی " +"ویژگی های عجیب و غریب برای جا دادن این موارد است. تاپل های خالی با یک جفت " +"پرانتز خالی ساخته می شوند. یک تاپل با یک آیتم با دنبال کردن یک مقدار با کاما" +" ساخته می‌شود (اینکه یک مقدار را در پرانتز قرار دهید کافی نیست). زشت، اما " +"موثر. به عنوان مثال::" #: tutorial/datastructures.rst:421 -msgid ">>> empty = ()\n" +#, fuzzy +msgid "" +">>> empty = ()\n" ">>> singleton = 'hello', # <-- note trailing comma\n" ">>> len(empty)\n" "0\n" @@ -439,37 +878,86 @@ msgid ">>> empty = ()\n" ">>> singleton\n" "('hello',)" msgstr "" +">>> empty = ()\n" +">>> singleton = 'hello', # <-- note trailing comma\n" +">>> len(empty)\n" +"0\n" +">>> len(singleton)\n" +"1\n" +">>> singleton\n" +"('hello',)" #: tutorial/datastructures.rst:430 -msgid "The statement ``t = 12345, 54321, 'hello!'`` is an example of *tuple packing*: the values ``12345``, ``54321`` and ``'hello!'`` are packed together in a tuple. The reverse operation is also possible::" +#, fuzzy +msgid "" +"The statement ``t = 12345, 54321, 'hello!'`` is an example of *tuple " +"packing*: the values ``12345``, ``54321`` and ``'hello!'`` are packed " +"together in a tuple. The reverse operation is also possible::" msgstr "" +"عبارت ``t = 12345, 54321, 'hello!'`` نمونه ای از *tuple packing* است: مقادیر" +" ``12345``، ``54321`` و ``'hello!'`` در یک تاپیک با هم بسته بندی شده اند. " +"عملیات معکوس نیز امکان پذیر است:" #: tutorial/datastructures.rst:434 +#, fuzzy msgid ">>> x, y, z = t" -msgstr "" +msgstr ">>> x, y, z = t" #: tutorial/datastructures.rst:436 -msgid "This is called, appropriately enough, *sequence unpacking* and works for any sequence on the right-hand side. Sequence unpacking requires that there are as many variables on the left side of the equals sign as there are elements in the sequence. Note that multiple assignment is really just a combination of tuple packing and sequence unpacking." +#, fuzzy +msgid "" +"This is called, appropriately enough, *sequence unpacking* and works for any" +" sequence on the right-hand side. Sequence unpacking requires that there " +"are as many variables on the left side of the equals sign as there are " +"elements in the sequence. Note that multiple assignment is really just a " +"combination of tuple packing and sequence unpacking." msgstr "" +"این به اندازه کافی *sequence unpacking* نامیده می شود و برای هر دنباله ای در" +" سمت راست کار می کند. باز کردن توالی مستلزم آن است که به تعداد عناصر موجود " +"در دنباله، در سمت چپ علامت تساوی متغیر وجود داشته باشد. توجه داشته باشید که" +" تخصیص چندگانه در واقع فقط ترکیبی از بسته بندی چندگانه و باز کردن توالی است." #: tutorial/datastructures.rst:446 +#, fuzzy msgid "Sets" -msgstr "" +msgstr "مجموعه ها" #: tutorial/datastructures.rst:448 -msgid "Python also includes a data type for *sets*. A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also support mathematical operations like union, intersection, difference, and symmetric difference." +#, fuzzy +msgid "" +"Python also includes a data type for *sets*. A set is an unordered " +"collection with no duplicate elements. Basic uses include membership " +"testing and eliminating duplicate entries. Set objects also support " +"mathematical operations like union, intersection, difference, and symmetric " +"difference." msgstr "" +"پایتون همچنین شامل یک نوع داده برای *sets* است. مجموعه یک مجموعه نامرتب و " +"بدون عناصر تکراری است. کاربردهای اصلی شامل تست عضویت و حذف ورودی های تکراری" +" است. اشیاء مجموعه همچنین از عملیات ریاضی مانند اتحاد، تقاطع، تفاوت و تفاوت" +" متقارن پشتیبانی می کنند." #: tutorial/datastructures.rst:453 -msgid "Curly braces or the :func:`set` function can be used to create sets. Note: to create an empty set you have to use ``set()``, not ``{}``; the latter creates an empty dictionary, a data structure that we discuss in the next section." +#, fuzzy +msgid "" +"Curly braces or the :func:`set` function can be used to create sets. Note: " +"to create an empty set you have to use ``set()``, not ``{}``; the latter " +"creates an empty dictionary, a data structure that we discuss in the next " +"section." msgstr "" +"برای ایجاد مجموعه می توان از بریس های فرفری یا تابع :func:`set` استفاده کرد." +" توجه: برای ایجاد یک مجموعه خالی باید از ``set()`` استفاده کنید نه ``{}``. " +"دومی یک فرهنگ لغت خالی ایجاد می کند، یک ساختار داده که در بخش بعدی به آن می " +"پردازیم." #: tutorial/datastructures.rst:457 +#, fuzzy msgid "Here is a brief demonstration::" -msgstr "" +msgstr "در اینجا یک نمایش کوتاه وجود دارد:" #: tutorial/datastructures.rst:459 -msgid ">>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}\n" +#, fuzzy +msgid "" +">>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}\n" ">>> print(basket) # show that duplicates have been removed\n" "{'orange', 'banana', 'pear', 'apple'}\n" ">>> 'orange' in basket # fast membership testing\n" @@ -492,43 +980,132 @@ msgid ">>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}\n" ">>> a ^ b # letters in a or b but not both\n" "{'r', 'd', 'b', 'm', 'z', 'l'}" msgstr "" +">>> سبد = {'سیب', 'پرتقال', 'سیب', 'گلابی', 'پرتقال', 'موز'}\n" +">>> print(basket) # نشان می دهد که موارد تکراری حذف شده اند\n" +"{'پرتقال', 'موز', 'گلابی', 'سیب'}\n" +">>> 'نارنجی' در سبد # تست عضویت سریع\n" +"درست است\n" +">>> 'خرچنگ' در سبد\n" +"نادرست\n" +"\n" +">>> # عملیات مجموعه را روی حروف منحصر به فرد از دو کلمه نشان دهید\n" +">>>\n" +">>> a = مجموعه ('abracadabra')\n" +">>> b = مجموعه ('alacazam')\n" +">>> یک # حرف منحصر به فرد در a\n" +"{'a', 'r', 'b', 'c', 'd'}\n" +">>> a - b # حرف در a اما نه در b\n" +"{'r', 'd', 'b'}\n" +">>> یک | b # حروف در a یا b یا هر دو\n" +"{'a', 'c', 'r', 'd', 'b', 'm', 'z', 'l'}\n" +">>> a & b # حروف در هر دو a و b\n" +"{'a', 'c'}\n" +">>> a ^ b # حروف a یا b اما نه هر دو\n" +"{'r', 'd', 'b', 'm', 'z', 'l'}" #: tutorial/datastructures.rst:482 -msgid "Similarly to :ref:`list comprehensions `, set comprehensions are also supported::" +#, fuzzy +msgid "" +"Similarly to :ref:`list comprehensions `, set comprehensions " +"are also supported::" msgstr "" +"مانند :ref:`list comprehensions `، درک مجموعه نیز پشتیبانی می" +" شود:" #: tutorial/datastructures.rst:485 -msgid ">>> a = {x for x in 'abracadabra' if x not in 'abc'}\n" +#, fuzzy +msgid "" +">>> a = {x for x in 'abracadabra' if x not in 'abc'}\n" ">>> a\n" "{'r', 'd'}" msgstr "" +">>> a = {x for x in 'abracadabra' if x not in 'abc'}\n" +">>> a\n" +"{'r', 'd'}" #: tutorial/datastructures.rst:493 +#, fuzzy msgid "Dictionaries" -msgstr "" +msgstr "لغت نامه ها" #: tutorial/datastructures.rst:495 -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:`!append` and :meth:`!extend`." -msgstr "" +#, fuzzy +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:`!append` and :meth:`!extend`." +msgstr "" +"نوع داده مفید دیگری که در پایتون تعبیه شده است، *dictionary* است (به " +":ref:`typesmapping` مراجعه کنید). واژه‌نامه‌ها گاهی در زبان‌های دیگر " +"به‌عنوان «خاطرات انجمنی» یا «آرایه‌های انجمنی» یافت می‌شوند. بر خلاف " +"دنباله‌ها که با طیفی از اعداد نمایه می‌شوند، لغتنامه‌ها با *keys* نمایه " +"می‌شوند که می‌تواند هر نوع تغییرناپذیری باشد. رشته ها و اعداد همیشه می " +"توانند کلید باشند. اگر تاپل ها فقط شامل رشته ها، اعداد یا تاپل ها باشند، می" +" توانند به عنوان کلید استفاده شوند. اگر یک تاپل حاوی هر شیء قابل تغییر به " +"طور مستقیم یا غیر مستقیم باشد، نمی توان از آن به عنوان کلید استفاده کرد. " +"نمی‌توانید از فهرست‌ها به عنوان کلید استفاده کنید، زیرا فهرست‌ها را می‌توان " +"با استفاده از تخصیص فهرست، تخصیص برش یا روش‌هایی مانند :meth:`!append` و " +":meth:`!extend` تغییر داد." #: tutorial/datastructures.rst:506 -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 "" +#, fuzzy +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 "" +"بهتر است دیکشنری را مجموعه‌ای از جفت‌های *key: value* در نظر بگیرید، با این " +"شرط که کلیدها منحصر به فرد باشند (در یک فرهنگ لغت). یک جفت بریس یک فرهنگ لغت" +" خالی ایجاد می کند: ``{}``. قرار دادن یک لیست جدا شده با کاما از جفت های " +"کلید:مقدار در داخل پرانتز، جفت های کلید:مقدار اولیه را به فرهنگ لغت اضافه می" +" کند. این روشی است که دیکشنری ها روی خروجی نوشته می شوند." #: tutorial/datastructures.rst:512 -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. It is an error to extract a value using a non-existent key." -msgstr "" +#, fuzzy +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. It is an error to" +" extract a value using a non-existent key." +msgstr "" +"عملیات اصلی در یک فرهنگ لغت، ذخیره یک مقدار با مقداری کلید و استخراج مقدار " +"داده شده کلید است. همچنین امکان حذف یک جفت کلید: ارزش با ``del`` وجود دارد." +" اگر با استفاده از کلیدی که قبلاً در حال استفاده است ذخیره کنید، مقدار قدیمی" +" مرتبط با آن کلید فراموش می شود. استخراج یک مقدار با استفاده از کلیدی که " +"وجود ندارد یک خطا است." #: tutorial/datastructures.rst:518 -msgid "Performing ``list(d)`` on a dictionary returns a list of all the keys used in the dictionary, in insertion order (if you want it sorted, just use ``sorted(d)`` instead). To check whether a single key is in the dictionary, use the :keyword:`in` keyword." +#, fuzzy +msgid "" +"Performing ``list(d)`` on a dictionary returns a list of all the keys used " +"in the dictionary, in insertion order (if you want it sorted, just use " +"``sorted(d)`` instead). To check whether a single key is in the dictionary, " +"use the :keyword:`in` keyword." msgstr "" +"اجرای ``list(d)`` در دیکشنری فهرستی از تمام کلیدهای استفاده شده در فرهنگ لغت" +" را به ترتیب درج برمی گرداند (اگر می خواهید مرتب شود, فقط از ``sorted(d)`` " +"استفاده کنید). برای بررسی اینکه آیا یک کلید در فرهنگ لغت وجود دارد یا خیر، " +"از کلمه کلیدی :keyword:`in` استفاده کنید." #: tutorial/datastructures.rst:523 +#, fuzzy msgid "Here is a small example using a dictionary::" -msgstr "" +msgstr "در اینجا یک مثال کوچک با استفاده از فرهنگ لغت آورده شده است:" #: tutorial/datastructures.rst:525 -msgid ">>> tel = {'jack': 4098, 'sape': 4139}\n" +#, fuzzy +msgid "" +">>> tel = {'jack': 4098, 'sape': 4139}\n" ">>> tel['guido'] = 4127\n" ">>> tel\n" "{'jack': 4098, 'sape': 4139, 'guido': 4127}\n" @@ -547,70 +1124,149 @@ msgid ">>> tel = {'jack': 4098, 'sape': 4139}\n" ">>> 'jack' not in tel\n" "False" msgstr "" +">>> tel = {'jack': 4098, 'sape': 4139}\n" +">>> tel['guido'] = 4127\n" +">>> tel\n" +"{'jack': 4098, 'sape': 4139, 'guido': 4127}\n" +">>> tel['jack']\n" +"4098\n" +">>> del tel['sape']\n" +">>> tel['irv'] = 4127\n" +">>> tel\n" +"{'jack': 4098, 'guido': 4127, 'irv': 4127}\n" +">>> list(tel)\n" +"['jack', 'guido', 'irv']\n" +">>> sorted(tel)\n" +"['guido', 'irv', 'jack']\n" +">>> 'guido' in tel\n" +"True\n" +">>> 'jack' not in tel\n" +"False" #: tutorial/datastructures.rst:544 -msgid "The :func:`dict` constructor builds dictionaries directly from sequences of key-value pairs::" +#, fuzzy +msgid "" +"The :func:`dict` constructor builds dictionaries directly from sequences of " +"key-value pairs::" msgstr "" +"سازنده :func:`dict` دیکشنری ها را مستقیماً از دنباله های جفت کلید-مقدار می " +"سازد:" #: tutorial/datastructures.rst:547 -msgid ">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" +#, fuzzy +msgid "" +">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" msgstr "" +">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" +"{'sape': 4139, 'guido': 4127, 'jack': 4098}" #: tutorial/datastructures.rst:550 -msgid "In addition, dict comprehensions can be used to create dictionaries from arbitrary key and value expressions::" +#, fuzzy +msgid "" +"In addition, dict comprehensions can be used to create dictionaries from " +"arbitrary key and value expressions::" msgstr "" +"علاوه بر این، درک دیکت می تواند برای ایجاد فرهنگ لغت از عبارات کلیدی و " +"مقادیر دلخواه استفاده شود:" #: tutorial/datastructures.rst:553 -msgid ">>> {x: x**2 for x in (2, 4, 6)}\n" +#, fuzzy +msgid "" +">>> {x: x**2 for x in (2, 4, 6)}\n" "{2: 4, 4: 16, 6: 36}" msgstr "" +">>> {x: x**2 for x in (2, 4, 6)}\n" +"{2: 4, 4: 16, 6: 36}" #: tutorial/datastructures.rst:556 -msgid "When the keys are simple strings, it is sometimes easier to specify pairs using keyword arguments::" +#, fuzzy +msgid "" +"When the keys are simple strings, it is sometimes easier to specify pairs " +"using keyword arguments::" msgstr "" +"وقتی کلیدها رشته های ساده ای هستند، گاهی اوقات تعیین جفت ها با استفاده از " +"آرگومان های کلیدواژه آسان تر است:" #: tutorial/datastructures.rst:559 -msgid ">>> dict(sape=4139, guido=4127, jack=4098)\n" +#, fuzzy +msgid "" +">>> dict(sape=4139, guido=4127, jack=4098)\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" msgstr "" +">>> dict(sape=4139, guido=4127, jack=4098)\n" +"{'sape': 4139, 'guido': 4127, 'jack': 4098}" #: tutorial/datastructures.rst:566 +#, fuzzy msgid "Looping Techniques" -msgstr "" +msgstr "تکنیک های حلقه زدن" #: tutorial/datastructures.rst:568 -msgid "When looping through dictionaries, the key and corresponding value can be retrieved at the same time using the :meth:`~dict.items` method. ::" +#, fuzzy +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` بازیابی کرد. ::" #: tutorial/datastructures.rst:571 -msgid ">>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}\n" +#, fuzzy +msgid "" +">>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}\n" ">>> for k, v in knights.items():\n" "... print(k, v)\n" "...\n" "gallahad the pure\n" "robin the brave" msgstr "" +">>> شوالیه ها = {'gallahad': 'پاک', 'robin': 'شجاع'}\n" +">>> برای k, v در knights.items():\n" +"... چاپ (k, v)\n" +"...\n" +"گالاهاد ناب\n" +"رابین شجاع" #: tutorial/datastructures.rst:578 -msgid "When looping through a sequence, the position index and corresponding value can be retrieved at the same time using the :func:`enumerate` function. ::" +#, fuzzy +msgid "" +"When looping through a sequence, the position index and corresponding value " +"can be retrieved at the same time using the :func:`enumerate` function. ::" msgstr "" +"هنگام حلقه زدن از طریق یک دنباله، شاخص موقعیت و مقدار مربوطه را می توان " +"همزمان با استفاده از تابع :func:`enumerate` بازیابی کرد. ::" #: tutorial/datastructures.rst:581 -msgid ">>> for i, v in enumerate(['tic', 'tac', 'toe']):\n" +#, fuzzy +msgid "" +">>> for i, v in enumerate(['tic', 'tac', 'toe']):\n" "... print(i, v)\n" "...\n" "0 tic\n" "1 tac\n" "2 toe" msgstr "" +">>> برای i, v در enumerate(['tic', 'tac', 'toe']):\n" +"... چاپ (i, v)\n" +"...\n" +"0 تیک\n" +"1 تاک\n" +"2 انگشت پا" #: tutorial/datastructures.rst:588 -msgid "To loop over two or more sequences at the same time, the entries can be paired with the :func:`zip` function. ::" +#, fuzzy +msgid "" +"To loop over two or more sequences at the same time, the entries can be " +"paired with the :func:`zip` function. ::" msgstr "" +"برای حلقه روی دو یا چند دنباله به طور همزمان، ورودی ها را می توان با تابع " +":func:`zip` جفت کرد. ::" #: tutorial/datastructures.rst:591 -msgid ">>> questions = ['name', 'quest', 'favorite color']\n" +#, fuzzy +msgid "" +">>> questions = ['name', 'quest', 'favorite color']\n" ">>> answers = ['lancelot', 'the holy grail', 'blue']\n" ">>> for q, a in zip(questions, answers):\n" "... print('What is your {0}? It is {1}.'.format(q, a))\n" @@ -619,13 +1275,28 @@ msgid ">>> questions = ['name', 'quest', 'favorite color']\n" "What is your quest? It is the holy grail.\n" "What is your favorite color? It is blue." msgstr "" +">>> سوالات = ['نام', 'پرسش', 'رنگ مورد علاقه']\n" +">>> پاسخ ها = ['Lancelot', 'Grail مقدس', 'Blue']\n" +">>> برای q, a در zip (سوالات, پاسخ):\n" +"... print('{0} شما چیست؟ {1} است.'.format(q, a))\n" +"...\n" +"نام شما چیست؟ لانسلوت است.\n" +"جستجوی شما چیست؟ جام مقدس است.\n" +"رنگ مورد علاقه شما چیست؟ آبی است." #: tutorial/datastructures.rst:600 -msgid "To loop over a sequence in reverse, first specify the sequence in a forward direction and then call the :func:`reversed` function. ::" +#, fuzzy +msgid "" +"To loop over a sequence in reverse, first specify the sequence in a forward " +"direction and then call the :func:`reversed` function. ::" msgstr "" +"برای چرخش بر روی یک دنباله به صورت معکوس، ابتدا دنباله را در جهت جلو مشخص " +"کنید و سپس تابع :func:`reversed` را فراخوانی کنید. ::" #: tutorial/datastructures.rst:603 -msgid ">>> for i in reversed(range(1, 10, 2)):\n" +#, fuzzy +msgid "" +">>> for i in reversed(range(1, 10, 2)):\n" "... print(i)\n" "...\n" "9\n" @@ -634,13 +1305,29 @@ msgid ">>> for i in reversed(range(1, 10, 2)):\n" "3\n" "1" msgstr "" +">>> for i in reversed(range(1, 10, 2)):\n" +"... print(i)\n" +"...\n" +"9\n" +"7\n" +"5\n" +"3\n" +"1" #: tutorial/datastructures.rst:612 -msgid "To loop over a sequence in sorted order, use the :func:`sorted` function which returns a new sorted list while leaving the source unaltered. ::" +#, fuzzy +msgid "" +"To loop over a sequence in sorted order, use the :func:`sorted` function " +"which returns a new sorted list while leaving the source unaltered. ::" msgstr "" +"برای حلقه زدن روی یک دنباله به ترتیب مرتب شده، از تابع :func:`sorted` " +"استفاده کنید که یک لیست مرتب شده جدید را برمی گرداند در حالی که منبع را بدون" +" تغییر باقی می گذارد. ::" #: tutorial/datastructures.rst:615 -msgid ">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" +#, fuzzy +msgid "" +">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" ">>> for i in sorted(basket):\n" "... print(i)\n" "...\n" @@ -651,13 +1338,33 @@ msgid ">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" "orange\n" "pear" msgstr "" +">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" +">>> for i in sorted(basket):\n" +"... print(i)\n" +"...\n" +"apple\n" +"apple\n" +"banana\n" +"orange\n" +"orange\n" +"pear" #: tutorial/datastructures.rst:626 -msgid "Using :func:`set` on a sequence eliminates duplicate elements. The use of :func:`sorted` in combination with :func:`set` over a sequence is an idiomatic way to loop over unique elements of the sequence in sorted order. ::" +#, fuzzy +msgid "" +"Using :func:`set` on a sequence eliminates duplicate elements. The use of " +":func:`sorted` in combination with :func:`set` over a sequence is an " +"idiomatic way to loop over unique elements of the sequence in sorted order. " +"::" msgstr "" +"استفاده از :func:`set` روی یک دنباله، عناصر تکراری را حذف می کند. استفاده از" +" :func:`sorted` در ترکیب با :func:`set` روی یک دنباله، روشی اصطلاحی برای " +"حلقه زدن عناصر منحصر به فرد دنباله به ترتیب مرتب شده است. ::" #: tutorial/datastructures.rst:630 -msgid ">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" +#, fuzzy +msgid "" +">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" ">>> for f in sorted(set(basket)):\n" "... print(f)\n" "...\n" @@ -666,13 +1373,28 @@ msgid ">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" "orange\n" "pear" msgstr "" +">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" +">>> for f in sorted(set(basket)):\n" +"... print(f)\n" +"...\n" +"apple\n" +"banana\n" +"orange\n" +"pear" #: tutorial/datastructures.rst:639 -msgid "It is sometimes tempting to change a list while you are looping over it; however, it is often simpler and safer to create a new list instead. ::" +#, fuzzy +msgid "" +"It is sometimes tempting to change a list while you are looping over it; " +"however, it is often simpler and safer to create a new list instead. ::" msgstr "" +"گاهی اوقات وسوسه انگیز است که یک لیست را در حالی که در حال بررسی آن هستید " +"تغییر دهید. با این حال، ایجاد یک لیست جدید اغلب ساده تر و ایمن تر است. ::" #: tutorial/datastructures.rst:642 -msgid ">>> import math\n" +#, fuzzy +msgid "" +">>> import math\n" ">>> raw_data = [56.2, float('NaN'), 51.7, 55.3, 52.5, float('NaN'), 47.8]\n" ">>> filtered_data = []\n" ">>> for value in raw_data:\n" @@ -682,56 +1404,159 @@ msgid ">>> import math\n" ">>> filtered_data\n" "[56.2, 51.7, 55.3, 52.5, 47.8]" msgstr "" +">>> import math\n" +">>> raw_data = [56.2, float('NaN'), 51.7, 55.3, 52.5, float('NaN'), 47.8]\n" +">>> filtered_data = []\n" +">>> for value in raw_data:\n" +"... if not math.isnan(value):\n" +"... filtered_data.append(value)\n" +"...\n" +">>> filtered_data\n" +"[56.2, 51.7, 55.3, 52.5, 47.8]" #: tutorial/datastructures.rst:656 +#, fuzzy msgid "More on Conditions" -msgstr "" +msgstr "بیشتر در مورد شرایط" #: tutorial/datastructures.rst:658 -msgid "The conditions used in ``while`` and ``if`` statements can contain any operators, not just comparisons." +#, fuzzy +msgid "" +"The conditions used in ``while`` and ``if`` statements can contain any " +"operators, not just comparisons." msgstr "" +"شرایط استفاده شده در دستورات ``while`` و ``if`` می تواند شامل هر عملگر باشد،" +" نه فقط مقایسه." #: tutorial/datastructures.rst:662 -msgid "The comparison operators ``in`` and ``not in`` are membership tests that determine whether a value is in (or not in) a container. The operators ``is`` and ``is not`` compare whether two objects are really the same object. All comparison operators have the same priority, which is lower than that of all numerical operators." +#, fuzzy +msgid "" +"The comparison operators ``in`` and ``not in`` are membership tests that " +"determine whether a value is in (or not in) a container. The operators " +"``is`` and ``is not`` compare whether two objects are really the same " +"object. All comparison operators have the same priority, which is lower " +"than that of all numerical operators." msgstr "" +"عملگرهای مقایسه ``in`` و ``not in`` تست های عضویت هستند که تعیین می کنند آیا" +" یک مقدار در (یا نه) یک ظرف است. عملگرهای ``is`` و ``is not`` مقایسه می " +"کنند که آیا دو شی واقعاً یک شی هستند یا خیر. همه عملگرهای مقایسه دارای " +"اولویت یکسانی هستند که از همه عملگرهای عددی کمتر است." #: tutorial/datastructures.rst:668 -msgid "Comparisons can be chained. For example, ``a < b == c`` tests whether ``a`` is less than ``b`` and moreover ``b`` equals ``c``." +#, fuzzy +msgid "" +"Comparisons can be chained. For example, ``a < b == c`` tests whether ``a``" +" is less than ``b`` and moreover ``b`` equals ``c``." msgstr "" +"مقایسه ها را می توان زنجیره ای کرد. به عنوان مثال، ``a < b == c`` تست می " +"کند که آیا ``a`` کمتر از ``b`` است و علاوه بر این، ``b`` برابر با ``c`` است." #: tutorial/datastructures.rst:671 -msgid "Comparisons may be combined using the Boolean operators ``and`` and ``or``, and the outcome of a comparison (or of any other Boolean expression) may be negated with ``not``. These have lower priorities than comparison operators; between them, ``not`` has the highest priority and ``or`` the lowest, so that ``A and not B or C`` is equivalent to ``(A and (not B)) or C``. As always, parentheses can be used to express the desired composition." -msgstr "" +#, fuzzy +msgid "" +"Comparisons may be combined using the Boolean operators ``and`` and ``or``, " +"and the outcome of a comparison (or of any other Boolean expression) may be " +"negated with ``not``. These have lower priorities than comparison " +"operators; between them, ``not`` has the highest priority and ``or`` the " +"lowest, so that ``A and not B or C`` is equivalent to ``(A and (not B)) or " +"C``. As always, parentheses can be used to express the desired composition." +msgstr "" +"مقایسه ها ممکن است با استفاده از عملگرهای بولی ``and`` و ``or`` ترکیب شوند و" +" نتیجه مقایسه (یا هر عبارت بولی دیگر) با ``not`` نفی شود. اینها نسبت به " +"اپراتورهای مقایسه اولویت کمتری دارند. در بین آنها ``not`` بیشترین اولویت و " +"``or`` کمترین اولویت را دارد به طوری که ``A and not B or C`` معادل ``(A and " +"(not B)) or C`` است. مثل همیشه می توان از پرانتز برای بیان ترکیب مورد نظر " +"استفاده کرد." #: tutorial/datastructures.rst:678 -msgid "The Boolean operators ``and`` and ``or`` are so-called *short-circuit* operators: their arguments are evaluated from left to right, and evaluation stops as soon as the outcome is determined. For example, if ``A`` and ``C`` are true but ``B`` is false, ``A and B and C`` does not evaluate the expression ``C``. When used as a general value and not as a Boolean, the return value of a short-circuit operator is the last evaluated argument." -msgstr "" +#, fuzzy +msgid "" +"The Boolean operators ``and`` and ``or`` are so-called *short-circuit* " +"operators: their arguments are evaluated from left to right, and evaluation " +"stops as soon as the outcome is determined. For example, if ``A`` and ``C``" +" are true but ``B`` is false, ``A and B and C`` does not evaluate the " +"expression ``C``. When used as a general value and not as a Boolean, the " +"return value of a short-circuit operator is the last evaluated argument." +msgstr "" +"عملگرهای Boolean ``and`` و ``or`` اصطلاحاً عملگرهای *short-circuit* هستند: " +"آرگومان های آنها از چپ به راست ارزیابی می شوند و به محض تعیین نتیجه ارزیابی " +"متوقف می شود. به عنوان مثال، اگر ``A`` و ``C`` درست باشند اما ``B`` نادرست " +"باشد، ``A and B and C`` عبارت ``C`` را ارزیابی نمی کند. هنگامی که به عنوان " +"یک مقدار کلی و نه به عنوان یک بولی استفاده می شود، مقدار بازگشتی یک اپراتور " +"اتصال کوتاه آخرین آرگومان ارزیابی شده است." #: tutorial/datastructures.rst:685 -msgid "It is possible to assign the result of a comparison or other Boolean expression to a variable. For example, ::" +#, fuzzy +msgid "" +"It is possible to assign the result of a comparison or other Boolean " +"expression to a variable. For example, ::" msgstr "" +"می توان نتیجه یک مقایسه یا عبارت بولی دیگر را به یک متغیر اختصاص داد. به " +"عنوان مثال، ::" #: tutorial/datastructures.rst:688 -msgid ">>> string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'\n" +#, fuzzy +msgid "" +">>> string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'\n" ">>> non_null = string1 or string2 or string3\n" ">>> non_null\n" "'Trondheim'" msgstr "" +">>> string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'\n" +">>> non_null = string1 or string2 or string3\n" +">>> non_null\n" +"'Trondheim'" #: tutorial/datastructures.rst:693 -msgid "Note that in Python, unlike C, assignment inside expressions must be done explicitly with the :ref:`walrus operator ` ``:=``. This avoids a common class of problems encountered in C programs: typing ``=`` in an expression when ``==`` was intended." +#, fuzzy +msgid "" +"Note that in Python, unlike C, assignment inside expressions must be done " +"explicitly with the :ref:`walrus operator ` ``:=``. This avoids a common class of problems encountered " +"in C programs: typing ``=`` in an expression when ``==`` was intended." msgstr "" +"توجه داشته باشید که در پایتون، برخلاف C، تخصیص درون عبارات باید به طور صریح " +"با :ref:`walrus operator ` " +"``:=`` انجام شود. با این کار از یک کلاس رایج از مشکلاتی که در برنامه‌های C " +"با آن مواجه می‌شوید جلوگیری می‌شود: تایپ ``=`` در یک عبارت زمانی که ``==`` " +"در نظر گرفته شده بود." #: tutorial/datastructures.rst:703 +#, fuzzy msgid "Comparing Sequences and Other Types" -msgstr "" +msgstr "مقایسه توالی ها و انواع دیگر" #: tutorial/datastructures.rst:704 -msgid "Sequence objects typically may be compared to other objects with the same sequence type. The comparison uses *lexicographical* ordering: first the first two items are compared, and if they differ this determines the outcome of the comparison; if they are equal, the next two items are compared, and so on, until either sequence is exhausted. If two items to be compared are themselves sequences of the same type, the lexicographical comparison is carried out recursively. If all items of two sequences compare equal, the sequences are considered equal. If one sequence is an initial sub-sequence of the other, the shorter sequence is the smaller (lesser) one. Lexicographical ordering for strings uses the Unicode code point number to order individual characters. Some examples of comparisons between sequences of the same type::" -msgstr "" +#, fuzzy +msgid "" +"Sequence objects typically may be compared to other objects with the same " +"sequence type. The comparison uses *lexicographical* ordering: first the " +"first two items are compared, and if they differ this determines the outcome" +" of the comparison; if they are equal, the next two items are compared, and " +"so on, until either sequence is exhausted. If two items to be compared are " +"themselves sequences of the same type, the lexicographical comparison is " +"carried out recursively. If all items of two sequences compare equal, the " +"sequences are considered equal. If one sequence is an initial sub-sequence " +"of the other, the shorter sequence is the smaller (lesser) one. " +"Lexicographical ordering for strings uses the Unicode code point number to " +"order individual characters. Some examples of comparisons between sequences " +"of the same type::" +msgstr "" +"اشیاء دنباله معمولاً ممکن است با اشیاء دیگر با همان نوع توالی مقایسه شوند. " +"مقایسه از ترتیب *lexicographical* استفاده می کند: ابتدا دو مورد اول با هم " +"مقایسه می شوند و اگر متفاوت باشند، نتیجه مقایسه را مشخص می کند. اگر مساوی " +"باشند، دو مورد بعدی با هم مقایسه می شوند، و به همین ترتیب، تا زمانی که هر یک" +" از دنباله ها تمام شود. اگر دو مورد برای مقایسه، خود توالی هایی از یک نوع " +"باشند، مقایسه واژگانی به صورت بازگشتی انجام می شود. اگر همه آیتم های دو " +"دنباله با هم برابر باشند، دنباله ها برابر در نظر گرفته می شوند. اگر یک " +"دنباله زیر دنباله ابتدایی دیگری باشد، دنباله کوتاهتر کوچکتر (کوچکتر) است. " +"ترتیب واژگانی رشته‌ها از شماره نقطه کد یونیکد برای مرتب کردن کاراکترها " +"استفاده می‌کند. چند نمونه از مقایسه بین دنباله هایی از یک نوع::" #: tutorial/datastructures.rst:716 -msgid "(1, 2, 3) < (1, 2, 4)\n" +#, fuzzy +msgid "" +"(1, 2, 3) < (1, 2, 4)\n" "[1, 2, 3] < [1, 2, 4]\n" "'ABC' < 'C' < 'Pascal' < 'Python'\n" "(1, 2, 3, 4) < (1, 2, 4)\n" @@ -739,15 +1564,39 @@ msgid "(1, 2, 3) < (1, 2, 4)\n" "(1, 2, 3) == (1.0, 2.0, 3.0)\n" "(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)" msgstr "" +"(1, 2, 3) < (1, 2, 4)\n" +"[1, 2, 3] < [1, 2, 4]\n" +"'ABC' < 'C' < 'Pascal' < 'Python'\n" +"(1, 2, 3, 4) < (1, 2, 4)\n" +"(1, 2) < (1, 2, -1)\n" +"(1, 2, 3) == (1.0, 2.0, 3.0)\n" +"(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)" #: tutorial/datastructures.rst:724 -msgid "Note that comparing objects of different types with ``<`` or ``>`` is legal provided that the objects have appropriate comparison methods. For example, mixed numeric types are compared according to their numeric value, so 0 equals 0.0, etc. Otherwise, rather than providing an arbitrary ordering, the interpreter will raise a :exc:`TypeError` exception." -msgstr "" +#, fuzzy +msgid "" +"Note that comparing objects of different types with ``<`` or ``>`` is legal " +"provided that the objects have appropriate comparison methods. For example," +" mixed numeric types are compared according to their numeric value, so 0 " +"equals 0.0, etc. Otherwise, rather than providing an arbitrary ordering, " +"the interpreter will raise a :exc:`TypeError` exception." +msgstr "" +"توجه داشته باشید که مقایسه اشیاء از انواع مختلف با ``<`` یا ``>`` قانونی است" +" مشروط بر اینکه اشیاء دارای روش های مقایسه مناسب باشند. به عنوان مثال، " +"انواع عددی مختلط با توجه به مقدار عددی آنها مقایسه می شوند، بنابراین 0 برابر" +" با 0.0 و غیره است. در غیر این صورت، به جای ارائه یک ترتیب دلخواه، مفسر یک " +"استثنا :exc:`TypeError` را ایجاد می کند." #: tutorial/datastructures.rst:732 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/datastructures.rst:733 -msgid "Other languages may return the mutated object, which allows method chaining, such as ``d->insert(\"a\")->remove(\"b\")->sort();``." +#, fuzzy +msgid "" +"Other languages may return the mutated object, which allows method chaining," +" such as ``d->insert(\"a\")->remove(\"b\")->sort();``." msgstr "" +"زبان های دیگر ممکن است شی جهش یافته را برگردانند، که امکان زنجیره متد را " +"فراهم می کند، مانند ``d->insert(\"a\")->remove(\"b\")->sort();``." diff --git a/tutorial/errors.po b/tutorial/errors.po index 96e2942e..191342ce 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -17,43 +17,93 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/errors.rst:5 +#, fuzzy msgid "Errors and Exceptions" -msgstr "" +msgstr "Errors and Exceptions" #: tutorial/errors.rst:7 -msgid "Until now error messages haven't been more than mentioned, but if you have tried out the examples you have probably seen some. There are (at least) two distinguishable kinds of errors: *syntax errors* and *exceptions*." +#, fuzzy +msgid "" +"Until now error messages haven't been more than mentioned, but if you have " +"tried out the examples you have probably seen some. There are (at least) " +"two distinguishable kinds of errors: *syntax errors* and *exceptions*." msgstr "" +"تا به حال پیام های خطا بیش از ذکر شده نبوده است، اما اگر نمونه هایی را " +"امتحان کرده باشید احتمالاً برخی از آنها را دیده اید. (حداقل) دو نوع خطا " +"قابل تشخیص وجود دارد: *syntax errors* و *exceptions*." #: tutorial/errors.rst:15 +#, fuzzy msgid "Syntax Errors" -msgstr "" +msgstr "خطاهای نحوی" #: tutorial/errors.rst:17 -msgid "Syntax errors, also known as parsing errors, are perhaps the most common kind of complaint you get while you are still learning Python::" +#, fuzzy +msgid "" +"Syntax errors, also known as parsing errors, are perhaps the most common " +"kind of complaint you get while you are still learning Python::" msgstr "" +"خطاهای نحوی که به عنوان خطاهای تجزیه نیز شناخته می شوند، شاید رایج ترین نوع " +"شکایتی باشند که در حین یادگیری پایتون دریافت می کنید::" #: tutorial/errors.rst:20 -msgid ">>> while True print('Hello world')\n" +#, fuzzy +msgid "" +">>> while True print('Hello world')\n" " File \"\", line 1\n" " while True print('Hello world')\n" " ^^^^^\n" "SyntaxError: invalid syntax" msgstr "" +">>> while True print (\"سلام دنیا\")\n" +" فایل \"\", خط 1\n" +" while True print (\"سلام دنیا\")\n" +" ^^^^^\n" +"SyntaxError: نحو نامعتبر است" #: tutorial/errors.rst:26 -msgid "The parser repeats the offending line and displays little arrows pointing at the token in the line where the error was detected. The error may be caused by the absence of a token *before* the indicated token. In the example, the error is detected at the function :func:`print`, since a colon (``':'``) is missing before it. File name and line number are printed so you know where to look in case the input came from a script." -msgstr "" +#, fuzzy +msgid "" +"The parser repeats the offending line and displays little arrows pointing at" +" the token in the line where the error was detected. The error may be " +"caused by the absence of a token *before* the indicated token. In the " +"example, the error is detected at the function :func:`print`, since a colon " +"(``':'``) is missing before it. File name and line number are printed so " +"you know where to look in case the input came from a script." +msgstr "" +"تجزیه کننده خط متخلف را تکرار می کند و فلش های کوچکی را نشان می دهد که به " +"نشانه در خطی که خطا شناسایی شده است نشان می دهد. خطا ممکن است به دلیل عدم " +"وجود رمز *before* نشانه نشان داده شده باشد. در مثال، خطا در تابع " +":func:`print` شناسایی می‌شود، زیرا یک دونقطه (``':'``) قبل از آن وجود ندارد." +" نام فایل و شماره خط چاپ شده است، بنابراین شما می دانید در صورتی که ورودی " +"از یک اسکریپت باشد، کجا را جستجو کنید." #: tutorial/errors.rst:37 +#, fuzzy msgid "Exceptions" -msgstr "" +msgstr "استثنائات" #: tutorial/errors.rst:39 -msgid "Even if a statement or expression is syntactically correct, it may cause an error when an attempt is made to execute it. Errors detected during execution are called *exceptions* and are not unconditionally fatal: you will soon learn how to handle them in Python programs. Most exceptions are not handled by programs, however, and result in error messages as shown here::" -msgstr "" +#, fuzzy +msgid "" +"Even if a statement or expression is syntactically correct, it may cause an " +"error when an attempt is made to execute it. Errors detected during " +"execution are called *exceptions* and are not unconditionally fatal: you " +"will soon learn how to handle them in Python programs. Most exceptions are " +"not handled by programs, however, and result in error messages as shown " +"here::" +msgstr "" +"حتی اگر یک عبارت یا عبارت از نظر نحوی صحیح باشد، ممکن است هنگام تلاش برای " +"اجرای آن خطا ایجاد کند. خطاهایی که در حین اجرا شناسایی می شوند *exceptions* " +"نامیده می شوند و بی قید و شرط کشنده نیستند: به زودی یاد خواهید گرفت که چگونه" +" آنها را در برنامه های پایتون مدیریت کنید. با این حال، اکثر استثناها توسط " +"برنامه ها مدیریت نمی شوند و منجر به پیام های خطا می شوند که در اینجا نشان " +"داده شده است:" #: tutorial/errors.rst:45 -msgid ">>> 10 * (1/0)\n" +#, fuzzy +msgid "" +">>> 10 * (1/0)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" " 10 * (1/0)\n" @@ -72,33 +122,97 @@ msgid ">>> 10 * (1/0)\n" " ~~~~^~~\n" "TypeError: can only concatenate str (not \"int\") to str" msgstr "" +">>> 10 * (1/0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 10 * (1/0)\n" +" ~^~\n" +"ZeroDivisionError: تقسیم بر صفر\n" +">>> 4 + spam*3\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 4 + spam*3\n" +" ^^^^\n" +"NameError: نام \"هرزنامه\" تعریف نشده است\n" +">>> '2' + 2\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +" '2' + 2\n" +" ~~~~^~~\n" +"TypeError: فقط می تواند str (نه \"int\") را به str الحاق کند" #: tutorial/errors.rst:64 -msgid "The last line of the error message indicates what happened. Exceptions come in different types, and the type is printed as part of the message: the types in the example are :exc:`ZeroDivisionError`, :exc:`NameError` and :exc:`TypeError`. The string printed as the exception type is the name of the built-in exception that occurred. This is true for all built-in exceptions, but need not be true for user-defined exceptions (although it is a useful convention). Standard exception names are built-in identifiers (not reserved keywords)." -msgstr "" +#, fuzzy +msgid "" +"The last line of the error message indicates what happened. Exceptions come " +"in different types, and the type is printed as part of the message: the " +"types in the example are :exc:`ZeroDivisionError`, :exc:`NameError` and " +":exc:`TypeError`. The string printed as the exception type is the name of " +"the built-in exception that occurred. This is true for all built-in " +"exceptions, but need not be true for user-defined exceptions (although it is" +" a useful convention). Standard exception names are built-in identifiers " +"(not reserved keywords)." +msgstr "" +"خط آخر پیام خطا نشان می دهد که چه اتفاقی افتاده است. استثناها انواع مختلفی " +"دارند و نوع به عنوان بخشی از پیام چاپ می شود: انواع موجود در مثال " +":exc:`ZeroDivisionError`، :exc:`NameError` و :exc:`TypeError` هستند. رشته " +"چاپ شده به عنوان نوع استثنا، نام استثنای داخلی است که رخ داده است. این برای" +" همه استثناهای داخلی صادق است، اما لازم نیست برای استثناهای تعریف شده توسط " +"کاربر صادق باشد (اگرچه این یک قرارداد مفید است). نام‌های استثنای استاندارد، " +"شناسه‌های داخلی هستند (کلمات کلیدی رزرو شده نیستند)." #: tutorial/errors.rst:72 -msgid "The rest of the line provides detail based on the type of exception and what caused it." +#, fuzzy +msgid "" +"The rest of the line provides detail based on the type of exception and what" +" caused it." msgstr "" +"بقیه خط جزئیات را بر اساس نوع استثنا و آنچه باعث آن شده است ارائه می دهد." #: tutorial/errors.rst:75 -msgid "The preceding part of the error message shows the context where the exception occurred, in the form of a stack traceback. In general it contains a stack traceback listing source lines; however, it will not display lines read from standard input." +#, fuzzy +msgid "" +"The preceding part of the error message shows the context where the " +"exception occurred, in the form of a stack traceback. In general it contains" +" a stack traceback listing source lines; however, it will not display lines " +"read from standard input." msgstr "" +"قسمت قبلی پیام خطا، زمینه ای را که در آن استثنا رخ داده است، به شکل پشته " +"ردیابی نشان می دهد. به طور کلی شامل یک پشته ردیابی خطوط منبع است. با این " +"حال، خطوط خوانده شده از ورودی استاندارد را نمایش نمی دهد." #: tutorial/errors.rst:80 -msgid ":ref:`bltin-exceptions` lists the built-in exceptions and their meanings." -msgstr "" +#, fuzzy +msgid "" +":ref:`bltin-exceptions` lists the built-in exceptions and their meanings." +msgstr ":ref:`bltin-exceptions` استثناهای داخلی و معانی آنها را فهرست می کند." #: tutorial/errors.rst:86 +#, fuzzy msgid "Handling Exceptions" -msgstr "" +msgstr "رسیدگی به استثناها" #: tutorial/errors.rst:88 -msgid "It is possible to write programs that handle selected exceptions. Look at the following example, which asks the user for input until a valid integer has been entered, but allows the user to interrupt the program (using :kbd:`Control-C` or whatever the operating system supports); note that a user-generated interruption is signalled by raising the :exc:`KeyboardInterrupt` exception. ::" -msgstr "" +#, fuzzy +msgid "" +"It is possible to write programs that handle selected exceptions. Look at " +"the following example, which asks the user for input until a valid integer " +"has been entered, but allows the user to interrupt the program (using " +":kbd:`Control-C` or whatever the operating system supports); note that a " +"user-generated interruption is signalled by raising the " +":exc:`KeyboardInterrupt` exception. ::" +msgstr "" +"امکان نوشتن برنامه هایی وجود دارد که استثناهای انتخاب شده را مدیریت کنند. به" +" مثال زیر نگاه کنید، که از کاربر درخواست ورودی می کند تا زمانی که یک عدد " +"صحیح صحیح وارد شود، اما به کاربر اجازه می دهد برنامه را قطع کند (با استفاده " +"از :kbd:`Control-C` یا هر چیزی که سیستم عامل پشتیبانی می کند). توجه داشته " +"باشید که یک وقفه ایجاد شده توسط کاربر با بالا بردن استثنای " +":exc:`KeyboardInterrupt` علامت گذاری می شود. ::" #: tutorial/errors.rst:94 -msgid ">>> while True:\n" +#, fuzzy +msgid "" +">>> while True:\n" "... try:\n" "... x = int(input(\"Please enter a number: \"))\n" "... break\n" @@ -106,42 +220,107 @@ msgid ">>> while True:\n" "... print(\"Oops! That was no valid number. Try again...\")\n" "..." msgstr "" +">>> while True:\n" +"... try:\n" +"... x = int(input(\"Please enter a number: \"))\n" +"... break\n" +"... except ValueError:\n" +"... print(\"Oops! That was no valid number. Try again...\")\n" +"..." #: tutorial/errors.rst:102 +#, fuzzy msgid "The :keyword:`try` statement works as follows." -msgstr "" +msgstr "دستور :keyword:`try` به صورت زیر عمل می کند." #: tutorial/errors.rst:104 -msgid "First, the *try clause* (the statement(s) between the :keyword:`try` and :keyword:`except` keywords) is executed." +#, fuzzy +msgid "" +"First, the *try clause* (the statement(s) between the :keyword:`try` and " +":keyword:`except` keywords) is executed." msgstr "" +"ابتدا *try clause* (عبارت(های) بین کلمات کلیدی :keyword:`try` و " +":keyword:`except`) اجرا می شود." #: tutorial/errors.rst:107 -msgid "If no exception occurs, the *except clause* is skipped and execution of the :keyword:`try` statement is finished." +#, fuzzy +msgid "" +"If no exception occurs, the *except clause* is skipped and execution of the " +":keyword:`try` statement is finished." msgstr "" +"اگر هیچ استثنایی رخ ندهد، *except clause* نادیده گرفته می شود و اجرای دستور " +":keyword:`try` به پایان می رسد." #: tutorial/errors.rst:110 -msgid "If an exception occurs during execution of the :keyword:`try` clause, the rest of the clause is skipped. Then, if its type matches the exception named after the :keyword:`except` keyword, the *except clause* is executed, and then execution continues after the try/except block." +#, fuzzy +msgid "" +"If an exception occurs during execution of the :keyword:`try` clause, the " +"rest of the clause is skipped. Then, if its type matches the exception " +"named after the :keyword:`except` keyword, the *except clause* is executed, " +"and then execution continues after the try/except block." msgstr "" +"اگر در حین اجرای بند :keyword:`try` استثنایی رخ دهد، بقیه بند حذف می شود. " +"سپس، اگر نوع آن با استثنای نام‌گذاری شده پس از کلمه کلیدی :keyword:`except` " +"مطابقت داشته باشد، *except clause* اجرا می‌شود و سپس اجرا بعد از بلوک " +"try/except ادامه می‌یابد." #: tutorial/errors.rst:115 -msgid "If an exception occurs which does not match the exception named in the *except clause*, it is passed on to outer :keyword:`try` statements; if no handler is found, it is an *unhandled exception* and execution stops with an error message." +#, fuzzy +msgid "" +"If an exception occurs which does not match the exception named in the " +"*except clause*, it is passed on to outer :keyword:`try` statements; if no " +"handler is found, it is an *unhandled exception* and execution stops with an" +" error message." msgstr "" +"اگر استثنایی رخ دهد که با استثنای نام‌گذاری شده در *except clause* مطابقت " +"نداشته باشد، به دستورات :keyword:`try` خارجی منتقل می‌شود. اگر کنترل کننده " +"ای پیدا نشد، یک *unhandled exception* است و اجرا با یک پیام خطا متوقف می " +"شود." #: tutorial/errors.rst:119 -msgid "A :keyword:`try` statement may have more than one *except clause*, to specify handlers for different exceptions. At most one handler will be executed. Handlers only handle exceptions that occur in the corresponding *try clause*, not in other handlers of the same :keyword:`!try` statement. An *except clause* may name multiple exceptions as a parenthesized tuple, for example::" -msgstr "" +#, fuzzy +msgid "" +"A :keyword:`try` statement may have more than one *except clause*, to " +"specify handlers for different exceptions. At most one handler will be " +"executed. Handlers only handle exceptions that occur in the corresponding " +"*try clause*, not in other handlers of the same :keyword:`!try` statement. " +"An *except clause* may name multiple exceptions as a parenthesized tuple, " +"for example::" +msgstr "" +"یک دستور :keyword:`try` ممکن است بیش از یک *except clause* داشته باشد تا " +"کنترل کننده هایی را برای استثناهای مختلف مشخص کند. حداکثر یک کنترل کننده " +"اجرا خواهد شد. کنترل‌کننده‌ها فقط استثناهایی را که در *try clause* مربوطه رخ" +" می‌دهند، کنترل می‌کنند، نه در سایر کنترل‌کننده‌های همان عبارت " +":keyword:`!try`. یک *except clause* ممکن است چندین استثنا را به عنوان یک " +"تاپل پرانتز نامگذاری کند، به عنوان مثال:" #: tutorial/errors.rst:125 -msgid "... except (RuntimeError, TypeError, NameError):\n" +#, fuzzy +msgid "" +"... except (RuntimeError, TypeError, NameError):\n" "... pass" msgstr "" +"... به جز (RuntimeError, TypeError, NameError):\n" +"... بگذرد" #: tutorial/errors.rst:128 -msgid "A class in an :keyword:`except` clause matches exceptions which are instances of the class itself or one of its derived classes (but not the other way around --- an *except clause* listing a derived class does not match instances of its base classes). For example, the following code will print B, C, D in that order::" +#, fuzzy +msgid "" +"A class in an :keyword:`except` clause matches exceptions which are " +"instances of the class itself or one of its derived classes (but not the " +"other way around --- an *except clause* listing a derived class does not " +"match instances of its base classes). For example, the following code will " +"print B, C, D in that order::" msgstr "" +"یک کلاس در یک عبارت :keyword:`except` با استثناهایی مطابقت دارد که نمونه " +"هایی از خود کلاس یا یکی از کلاس های مشتق شده آن هستند (اما نه برعکس --- یک " +"*except clause* که یک کلاس مشتق شده را فهرست می کند با نمونه های کلاس های " +"پایه آن مطابقت ندارد). به عنوان مثال، کد زیر B، C، D را به ترتیب چاپ می کند:" #: tutorial/errors.rst:133 -msgid "class B(Exception):\n" +#, fuzzy +msgid "" +"class B(Exception):\n" " pass\n" "\n" "class C(B):\n" @@ -160,21 +339,65 @@ msgid "class B(Exception):\n" " except B:\n" " print(\"B\")" msgstr "" +"class B(Exception):\n" +" pass\n" +"\n" +"class C(B):\n" +" pass\n" +"\n" +"class D(C):\n" +" pass\n" +"\n" +"for cls in [B, C, D]:\n" +" try:\n" +" raise cls()\n" +" except D:\n" +" print(\"D\")\n" +" except C:\n" +" print(\"C\")\n" +" except B:\n" +" print(\"B\")" #: tutorial/errors.rst:152 -msgid "Note that if the *except clauses* were reversed (with ``except B`` first), it would have printed B, B, B --- the first matching *except clause* is triggered." +#, fuzzy +msgid "" +"Note that if the *except clauses* were reversed (with ``except B`` first), " +"it would have printed B, B, B --- the first matching *except clause* is " +"triggered." msgstr "" +"توجه داشته باشید که اگر *except clauses* معکوس می شد (اول با ``except B``), " +"B، B، B چاپ می شد --- اولین *except clause* منطبق فعال می شود." #: tutorial/errors.rst:155 -msgid "When an exception occurs, it may have associated values, also known as the exception's *arguments*. The presence and types of the arguments depend on the exception type." +#, fuzzy +msgid "" +"When an exception occurs, it may have associated values, also known as the " +"exception's *arguments*. The presence and types of the arguments depend on " +"the exception type." msgstr "" +"هنگامی که یک استثنا رخ می دهد، ممکن است مقادیر مرتبطی داشته باشد که به نام " +"*arguments* استثنا نیز شناخته می شود. وجود و انواع آرگومان ها به نوع استثنا " +"بستگی دارد." #: tutorial/errors.rst:159 -msgid "The *except clause* may specify a variable after the exception name. The variable is bound to the exception instance which typically has an ``args`` attribute that stores the arguments. For convenience, builtin exception types define :meth:`~object.__str__` to print all the arguments without explicitly accessing ``.args``. ::" -msgstr "" +#, fuzzy +msgid "" +"The *except clause* may specify a variable after the exception name. The " +"variable is bound to the exception instance which typically has an ``args`` " +"attribute that stores the arguments. For convenience, builtin exception " +"types define :meth:`~object.__str__` to print all the arguments without " +"explicitly accessing ``.args``. ::" +msgstr "" +"*except clause* ممکن است متغیری را بعد از نام استثنا مشخص کند. متغیر به " +"نمونه استثنایی که معمولاً دارای یک ویژگی ``args`` است که آرگومان ها را ذخیره" +" می کند، مقید است. برای راحتی، انواع استثناهای داخلی :meth:`~object.__str__`" +" را برای چاپ تمام آرگومان‌ها بدون دسترسی صریح به ``.args`` تعریف می‌کنند. " +"::" #: tutorial/errors.rst:165 -msgid ">>> try:\n" +#, fuzzy +msgid "" +">>> try:\n" "... raise Exception('spam', 'eggs')\n" "... except Exception as inst:\n" "... print(type(inst)) # the exception type\n" @@ -191,25 +414,78 @@ msgid ">>> try:\n" "x = spam\n" "y = eggs" msgstr "" +">>> امتحان کنید:\n" +"... افزایش استثنا (\"هرزنامه\", \"تخم مرغ\")\n" +"... به جز استثنا به عنوان inst:\n" +"... print(type(inst)) # نوع استثنا\n" +"... print(inst.args) # آرگومان ذخیره شده در args\n" +"... print(inst) # __str__ اجازه می دهد که args به طور مستقیم چاپ شود،\n" +"... # اما ممکن است در زیر کلاس های استثنا لغو شود\n" +"... x, y = inst.args # unpack args\n" +"... چاپ ('x =', x)\n" +"... چاپ ('y =', y)\n" +"...\n" +"\n" +"(\"هرزنامه\", \"تخم مرغ\")\n" +"(\"هرزنامه\", \"تخم مرغ\")\n" +"x = هرزنامه\n" +"y = تخم مرغ" #: tutorial/errors.rst:182 -msgid "The exception's :meth:`~object.__str__` output is printed as the last part ('detail') of the message for unhandled exceptions." +#, fuzzy +msgid "" +"The exception's :meth:`~object.__str__` output is printed as the last part " +"('detail') of the message for unhandled exceptions." msgstr "" +"خروجی :meth:`~object.__str__` استثنا به عنوان آخرین بخش («جزئیات») پیام برای" +" استثناهای کنترل نشده چاپ می شود." #: tutorial/errors.rst:185 -msgid ":exc:`BaseException` is the common base class of all exceptions. One of its subclasses, :exc:`Exception`, is the base class of all the non-fatal exceptions. Exceptions which are not subclasses of :exc:`Exception` are not typically handled, because they are used to indicate that the program should terminate. They include :exc:`SystemExit` which is raised by :meth:`sys.exit` and :exc:`KeyboardInterrupt` which is raised when a user wishes to interrupt the program." -msgstr "" +#, fuzzy +msgid "" +":exc:`BaseException` is the common base class of all exceptions. One of its " +"subclasses, :exc:`Exception`, is the base class of all the non-fatal " +"exceptions. Exceptions which are not subclasses of :exc:`Exception` are not " +"typically handled, because they are used to indicate that the program should" +" terminate. They include :exc:`SystemExit` which is raised by " +":meth:`sys.exit` and :exc:`KeyboardInterrupt` which is raised when a user " +"wishes to interrupt the program." +msgstr "" +":exc:`BaseException` کلاس پایه مشترک همه استثناها است. یکی از زیر کلاس های " +"آن، :exc:`Exception`، کلاس پایه همه استثناهای غیر کشنده است. استثناهایی که " +"زیر کلاس های :exc:`Exception` نیستند معمولاً رسیدگی نمی شوند، زیرا برای نشان" +" دادن اینکه برنامه باید خاتمه یابد استفاده می شود. آنها شامل " +":exc:`SystemExit` است که توسط :meth:`sys.exit` افزایش می یابد و " +":exc:`KeyboardInterrupt` که زمانی که کاربر می خواهد برنامه را قطع کند، " +"افزایش می یابد." #: tutorial/errors.rst:193 -msgid ":exc:`Exception` can be used as a wildcard that catches (almost) everything. However, it is good practice to be as specific as possible with the types of exceptions that we intend to handle, and to allow any unexpected exceptions to propagate on." +#, fuzzy +msgid "" +":exc:`Exception` can be used as a wildcard that catches (almost) everything." +" However, it is good practice to be as specific as possible with the types " +"of exceptions that we intend to handle, and to allow any unexpected " +"exceptions to propagate on." msgstr "" +":exc:`Exception` می تواند به عنوان یک علامت عام استفاده شود که (تقریبا) همه " +"چیز را می گیرد. با این حال، تمرین خوبی است که تا حد امکان در مورد انواع " +"استثناهایی که قصد رسیدگی به آنها را داریم، خاص باشیم و اجازه دهیم هر استثنای" +" غیرمنتظره ای در آن منتشر شود." #: tutorial/errors.rst:198 -msgid "The most common pattern for handling :exc:`Exception` is to print or log the exception and then re-raise it (allowing a caller to handle the exception as well)::" +#, fuzzy +msgid "" +"The most common pattern for handling :exc:`Exception` is to print or log the" +" exception and then re-raise it (allowing a caller to handle the exception " +"as well)::" msgstr "" +"رایج‌ترین الگو برای مدیریت :exc:`Exception` چاپ یا ثبت استثنا و سپس بالا " +"بردن مجدد آن است (به تماس‌گیرنده اجازه می‌دهد تا استثنا را نیز مدیریت کند):" #: tutorial/errors.rst:202 -msgid "import sys\n" +#, fuzzy +msgid "" +"import sys\n" "\n" "try:\n" " f = open('myfile.txt')\n" @@ -223,13 +499,36 @@ msgid "import sys\n" " print(f\"Unexpected {err=}, {type(err)=}\")\n" " raise" msgstr "" +"import sys\n" +"\n" +"try:\n" +" f = open('myfile.txt')\n" +" s = f.readline()\n" +" i = int(s.strip())\n" +"except OSError as err:\n" +" print(\"OS error:\", err)\n" +"except ValueError:\n" +" print(\"Could not convert data to an integer.\")\n" +"except Exception as err:\n" +" print(f\"Unexpected {err=}, {type(err)=}\")\n" +" raise" #: tutorial/errors.rst:216 -msgid "The :keyword:`try` ... :keyword:`except` statement has an optional *else clause*, which, when present, must follow all *except clauses*. It is useful for code that must be executed if the *try clause* does not raise an exception. For example::" +#, fuzzy +msgid "" +"The :keyword:`try` ... :keyword:`except` statement has an optional *else " +"clause*, which, when present, must follow all *except clauses*. It is " +"useful for code that must be executed if the *try clause* does not raise an " +"exception. For example::" msgstr "" +"دستور :keyword:`try` ... :keyword:`except` یک *else clause* اختیاری دارد که " +"در صورت وجود، باید از تمام *except clauses* پیروی کند. اگر *try clause* " +"استثنایی ایجاد نکند برای کدهایی مفید است که باید اجرا شوند. به عنوان مثال::" #: tutorial/errors.rst:221 -msgid "for arg in sys.argv[1:]:\n" +#, fuzzy +msgid "" +"for arg in sys.argv[1:]:\n" " try:\n" " f = open(arg, 'r')\n" " except OSError:\n" @@ -238,17 +537,43 @@ msgid "for arg in sys.argv[1:]:\n" " print(arg, 'has', len(f.readlines()), 'lines')\n" " f.close()" msgstr "" +"for arg in sys.argv[1:]:\n" +" try:\n" +" f = open(arg, 'r')\n" +" except OSError:\n" +" print('cannot open', arg)\n" +" else:\n" +" print(arg, 'has', len(f.readlines()), 'lines')\n" +" f.close()" #: tutorial/errors.rst:230 -msgid "The use of the :keyword:`!else` clause is better than adding additional code to the :keyword:`try` clause because it avoids accidentally catching an exception that wasn't raised by the code being protected by the :keyword:`!try` ... :keyword:`!except` statement." +#, fuzzy +msgid "" +"The use of the :keyword:`!else` clause is better than adding additional code" +" to the :keyword:`try` clause because it avoids accidentally catching an " +"exception that wasn't raised by the code being protected by the " +":keyword:`!try` ... :keyword:`!except` statement." msgstr "" +"استفاده از بند :keyword:`!else` بهتر از افزودن کد اضافی به عبارت " +":keyword:`try` است زیرا از گرفتن تصادفی استثنایی که توسط کد محافظت شده توسط " +"دستور :keyword:`!try` ... :keyword:`!except` ایجاد نشده است جلوگیری می کند." #: tutorial/errors.rst:235 -msgid "Exception handlers do not handle only exceptions that occur immediately in the *try clause*, but also those that occur inside functions that are called (even indirectly) in the *try clause*. For example::" +#, fuzzy +msgid "" +"Exception handlers do not handle only exceptions that occur immediately in " +"the *try clause*, but also those that occur inside functions that are called" +" (even indirectly) in the *try clause*. For example::" msgstr "" +"کنترل‌کننده‌های استثنا فقط استثناهایی را که بلافاصله در *try clause* رخ " +"می‌دهند، مدیریت نمی‌کنند، بلکه مواردی را که در داخل توابع رخ می‌دهند که (حتی" +" غیرمستقیم) در *try clause* فراخوانی می‌شوند را نیز کنترل می‌کنند. به عنوان " +"مثال::" #: tutorial/errors.rst:239 -msgid ">>> def this_fails():\n" +#, fuzzy +msgid "" +">>> def this_fails():\n" "... x = 1/0\n" "...\n" ">>> try:\n" @@ -258,37 +583,80 @@ msgid ">>> def this_fails():\n" "...\n" "Handling run-time error: division by zero" msgstr "" +">>> def this_fails():\n" +"... x = 1/0\n" +"...\n" +">>> امتحان کنید:\n" +"... this_fails()\n" +"... به جز ZeroDivisionError به عنوان err:\n" +"... print('Handling time run error:', err)\n" +"...\n" +"رسیدگی به خطای زمان اجرا: تقسیم بر صفر" #: tutorial/errors.rst:253 +#, fuzzy msgid "Raising Exceptions" -msgstr "" +msgstr "افزایش استثنائات" #: tutorial/errors.rst:255 -msgid "The :keyword:`raise` statement allows the programmer to force a specified exception to occur. For example::" +#, fuzzy +msgid "" +"The :keyword:`raise` statement allows the programmer to force a specified " +"exception to occur. For example::" msgstr "" +"دستور :keyword:`raise` به برنامه نویس اجازه می دهد تا یک استثنا مشخص شده را " +"مجبور به رخ دادن کند. به عنوان مثال::" #: tutorial/errors.rst:258 -msgid ">>> raise NameError('HiThere')\n" +#, fuzzy +msgid "" +">>> raise NameError('HiThere')\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" " raise NameError('HiThere')\n" "NameError: HiThere" msgstr "" +">>> افزایش NameError ('HiThere')\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +" افزایش NameError ('HiThere')\n" +"NameError: Hi There" #: tutorial/errors.rst:264 -msgid "The sole argument to :keyword:`raise` indicates the exception to be raised. This must be either an exception instance or an exception class (a class that derives from :class:`BaseException`, such as :exc:`Exception` or one of its subclasses). If an exception class is passed, it will be implicitly instantiated by calling its constructor with no arguments::" -msgstr "" +#, fuzzy +msgid "" +"The sole argument to :keyword:`raise` indicates the exception to be raised. " +"This must be either an exception instance or an exception class (a class " +"that derives from :class:`BaseException`, such as :exc:`Exception` or one of" +" its subclasses). If an exception class is passed, it will be implicitly " +"instantiated by calling its constructor with no arguments::" +msgstr "" +"تنها آرگومان :keyword:`raise` استثنایی را که باید مطرح شود را نشان می دهد. " +"این باید یا یک نمونه استثنا باشد یا یک کلاس استثنا (کلاسی که از " +":class:`BaseException` مشتق شده است, مانند :exc:`Exception` یا یکی از زیر " +"کلاس های آن). اگر یک کلاس استثنا ارسال شود، به طور ضمنی با فراخوانی سازنده " +"آن بدون هیچ آرگومان نمونه سازی می شود::" #: tutorial/errors.rst:270 +#, fuzzy msgid "raise ValueError # shorthand for 'raise ValueError()'" -msgstr "" +msgstr "raise ValueError # shorthand for 'raise ValueError()'" #: tutorial/errors.rst:272 -msgid "If you need to determine whether an exception was raised but don't intend to handle it, a simpler form of the :keyword:`raise` statement allows you to re-raise the exception::" +#, fuzzy +msgid "" +"If you need to determine whether an exception was raised but don't intend to" +" handle it, a simpler form of the :keyword:`raise` statement allows you to " +"re-raise the exception::" msgstr "" +"اگر باید تعیین کنید که آیا یک استثنا مطرح شده است یا خیر، اما قصد ندارید آن " +"را مدیریت کنید، یک شکل ساده تر از عبارت :keyword:`raise` به شما اجازه می دهد" +" تا استثنا را دوباره مطرح کنید:" #: tutorial/errors.rst:276 -msgid ">>> try:\n" +#, fuzzy +msgid "" +">>> try:\n" "... raise NameError('HiThere')\n" "... except NameError:\n" "... print('An exception flew by!')\n" @@ -300,17 +668,37 @@ msgid ">>> try:\n" " raise NameError('HiThere')\n" "NameError: HiThere" msgstr "" +">>> امتحان کنید:\n" +"... افزایش NameError ('HiThere')\n" +"... به جز NameError:\n" +"... چاپ ('یک استثنا به پایان رسید!')\n" +"... بالا بردن\n" +"...\n" +"یک استثنا پرواز کرد!\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 2، در \n" +" افزایش NameError ('HiThere')\n" +"NameError: Hi There" #: tutorial/errors.rst:292 +#, fuzzy msgid "Exception Chaining" -msgstr "" +msgstr "استثناء زنجیر" #: tutorial/errors.rst:294 -msgid "If an unhandled exception occurs inside an :keyword:`except` section, it will have the exception being handled attached to it and included in the error message::" +#, fuzzy +msgid "" +"If an unhandled exception occurs inside an :keyword:`except` section, it " +"will have the exception being handled attached to it and included in the " +"error message::" msgstr "" +"اگر یک استثنا کنترل نشده در یک بخش :keyword:`except` رخ دهد، این استثنا به " +"آن پیوست شده و در پیام خطا گنجانده شده است:" #: tutorial/errors.rst:298 -msgid ">>> try:\n" +#, fuzzy +msgid "" +">>> try:\n" "... open(\"database.sqlite\")\n" "... except OSError:\n" "... raise RuntimeError(\"unable to handle error\")\n" @@ -328,22 +716,53 @@ msgid ">>> try:\n" " raise RuntimeError(\"unable to handle error\")\n" "RuntimeError: unable to handle error" msgstr "" +">>> امتحان کنید:\n" +"... open(\"database.sqlite\")\n" +"... به جز OSError:\n" +"... افزایش RuntimeError (\"عدم کنترل خطا\")\n" +"...\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 2، در \n" +" open(\"database.sqlite\")\n" +" ~~~~^^^^^^^^^^^^^^^^^^^\n" +"FileNotFoundError: [Errno 2] چنین فایل یا فهرستی وجود ندارد: 'database.sqlite'\n" +"\n" +"در حین رسیدگی به استثنای فوق، یک استثنا دیگر رخ داد:\n" +"\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 4، در \n" +" افزایش RuntimeError (\"عدم رسیدگی به خطا\")\n" +"RuntimeError: قادر به رسیدگی به خطا نیست" #: tutorial/errors.rst:316 -msgid "To indicate that an exception is a direct consequence of another, the :keyword:`raise` statement allows an optional :keyword:`from` clause::" +#, fuzzy +msgid "" +"To indicate that an exception is a direct consequence of another, the " +":keyword:`raise` statement allows an optional :keyword:`from` " +"clause::" msgstr "" +"برای نشان دادن اینکه یک استثنا پیامد مستقیم دیگری است، دستور " +":keyword:`raise` یک عبارت :keyword:`from` اختیاری را مجاز می‌کند:" #: tutorial/errors.rst:319 -msgid "# exc must be exception instance or None.\n" +#, fuzzy +msgid "" +"# exc must be exception instance or None.\n" "raise RuntimeError from exc" msgstr "" +"# exc must be exception instance or None.\n" +"raise RuntimeError from exc" #: tutorial/errors.rst:322 +#, fuzzy msgid "This can be useful when you are transforming exceptions. For example::" msgstr "" +"این می تواند زمانی مفید باشد که در حال تبدیل استثناها هستید. به عنوان مثال::" #: tutorial/errors.rst:324 -msgid ">>> def func():\n" +#, fuzzy +msgid "" +">>> def func():\n" "... raise ConnectionError\n" "...\n" ">>> try:\n" @@ -365,13 +784,41 @@ msgid ">>> def func():\n" " raise RuntimeError('Failed to open database') from exc\n" "RuntimeError: Failed to open database" msgstr "" +">>> def func():\n" +"... افزایش ConnectionError\n" +"...\n" +">>> امتحان کنید:\n" +"... func()\n" +"... به جز ConnectionError به عنوان exc:\n" +"... RuntimeError ('باز کردن پایگاه داده انجام نشد') را از exc\n" +"...\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 2، در \n" +" func()\n" +" ~~~~^^\n" +" فایل \"\", خط 2، در تابع\n" +"خطای اتصال\n" +"\n" +"استثناء فوق علت مستقیم استثناء زیر بود:\n" +"\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 4، در \n" +" افزایش RuntimeError ('باز کردن پایگاه داده انجام نشد') از exc\n" +"RuntimeError: دیتابیس باز نشد" #: tutorial/errors.rst:346 -msgid "It also allows disabling automatic exception chaining using the ``from None`` idiom::" +#, fuzzy +msgid "" +"It also allows disabling automatic exception chaining using the ``from " +"None`` idiom::" msgstr "" +"همچنین امکان غیرفعال کردن زنجیره استثنایی خودکار با استفاده از اصطلاح ``from" +" None``::" #: tutorial/errors.rst:349 -msgid ">>> try:\n" +#, fuzzy +msgid "" +">>> try:\n" "... open('database.sqlite')\n" "... except OSError:\n" "... raise RuntimeError from None\n" @@ -381,41 +828,91 @@ msgid ">>> try:\n" " raise RuntimeError from None\n" "RuntimeError" msgstr "" +">>> امتحان کنید:\n" +"... open('database.sqlite')\n" +"... به جز OSError:\n" +"... RuntimeError را از None بالا ببرید\n" +"...\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 4، در \n" +" RuntimeError را از None افزایش دهید\n" +"خطای زمان اجرا" #: tutorial/errors.rst:359 -msgid "For more information about chaining mechanics, see :ref:`bltin-exceptions`." +#, fuzzy +msgid "" +"For more information about chaining mechanics, see :ref:`bltin-exceptions`." msgstr "" +"برای اطلاعات بیشتر در مورد مکانیک زنجیر، به :ref:`bltin-exceptions` مراجعه " +"کنید." #: tutorial/errors.rst:365 +#, fuzzy msgid "User-defined Exceptions" -msgstr "" +msgstr "استثناهای تعریف شده توسط کاربر" #: tutorial/errors.rst:367 -msgid "Programs may name their own exceptions by creating a new exception class (see :ref:`tut-classes` for more about Python classes). Exceptions should typically be derived from the :exc:`Exception` class, either directly or indirectly." +#, fuzzy +msgid "" +"Programs may name their own exceptions by creating a new exception class " +"(see :ref:`tut-classes` for more about Python classes). Exceptions should " +"typically be derived from the :exc:`Exception` class, either directly or " +"indirectly." msgstr "" +"برنامه ها ممکن است استثناهای خود را با ایجاد یک کلاس استثنای جدید نام گذاری " +"کنند (برای اطلاعات بیشتر در مورد کلاس های پایتون به :ref:`tut-classes` " +"مراجعه کنید). استثناها معمولاً باید به طور مستقیم یا غیر مستقیم از کلاس " +":exc:`Exception` مشتق شوند." #: tutorial/errors.rst:371 -msgid "Exception classes can be defined which do anything any other class can do, but are usually kept simple, often only offering a number of attributes that allow information about the error to be extracted by handlers for the exception." +#, fuzzy +msgid "" +"Exception classes can be defined which do anything any other class can do, " +"but are usually kept simple, often only offering a number of attributes that" +" allow information about the error to be extracted by handlers for the " +"exception." msgstr "" +"کلاس های استثنا را می توان تعریف کرد که هر کلاس دیگری را انجام می دهد، اما " +"معمولاً ساده نگه داشته می شوند، اغلب فقط تعدادی ویژگی ارائه می دهند که اجازه" +" می دهد اطلاعات مربوط به خطا توسط کنترل کننده ها برای استثنا استخراج شود." #: tutorial/errors.rst:375 -msgid "Most exceptions are defined with names that end in \"Error\", similar to the naming of the standard exceptions." +#, fuzzy +msgid "" +"Most exceptions are defined with names that end in \"Error\", similar to the" +" naming of the standard exceptions." msgstr "" +"اکثر استثناها با نام‌هایی تعریف می‌شوند که به «خطا» ختم می‌شوند، مشابه " +"نام‌گذاری استثناهای استاندارد." #: tutorial/errors.rst:378 -msgid "Many standard modules define their own exceptions to report errors that may occur in functions they define." +#, fuzzy +msgid "" +"Many standard modules define their own exceptions to report errors that may " +"occur in functions they define." msgstr "" +"بسیاری از ماژول های استاندارد استثناهای خود را برای گزارش خطاهایی که ممکن " +"است در توابعی که تعریف می کنند رخ دهد، تعریف می کنند." #: tutorial/errors.rst:385 +#, fuzzy msgid "Defining Clean-up Actions" -msgstr "" +msgstr "تعریف اقدامات پاکسازی" #: tutorial/errors.rst:387 -msgid "The :keyword:`try` statement has another optional clause which is intended to define clean-up actions that must be executed under all circumstances. For example::" +#, fuzzy +msgid "" +"The :keyword:`try` statement has another optional clause which is intended " +"to define clean-up actions that must be executed under all circumstances. " +"For example::" msgstr "" +"دستور :keyword:`try` یک بند اختیاری دیگر دارد که برای تعریف اقدامات پاکسازی " +"که باید تحت هر شرایطی اجرا شوند، در نظر گرفته شده است. به عنوان مثال::" #: tutorial/errors.rst:391 -msgid ">>> try:\n" +#, fuzzy +msgid "" +">>> try:\n" "... raise KeyboardInterrupt\n" "... finally:\n" "... print('Goodbye, world!')\n" @@ -426,37 +923,99 @@ msgid ">>> try:\n" " raise KeyboardInterrupt\n" "KeyboardInterrupt" msgstr "" +">>> امتحان کنید:\n" +"... KeyboardInterrupt را افزایش دهید\n" +"... در نهایت:\n" +"... چاپ (\"خداحافظ, دنیا!\")\n" +"...\n" +"خداحافظ ای دنیا!\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 2، در \n" +" افزایش وقفه صفحه کلید\n" +"صفحه کلید وقفه" #: tutorial/errors.rst:402 -msgid "If a :keyword:`finally` clause is present, the :keyword:`!finally` clause will execute as the last task before the :keyword:`try` statement completes. The :keyword:`!finally` clause runs whether or not the :keyword:`!try` statement produces an exception. The following points discuss more complex cases when an exception occurs:" -msgstr "" +#, fuzzy +msgid "" +"If a :keyword:`finally` clause is present, the :keyword:`!finally` clause " +"will execute as the last task before the :keyword:`try` statement completes." +" The :keyword:`!finally` clause runs whether or not the :keyword:`!try` " +"statement produces an exception. The following points discuss more complex " +"cases when an exception occurs:" +msgstr "" +"اگر یک بند :keyword:`finally` وجود داشته باشد، بند :keyword:`!finally` به " +"عنوان آخرین کار قبل از تکمیل دستور :keyword:`try` اجرا می شود. بند " +":keyword:`!finally` اجرا می شود چه دستور :keyword:`!try` یک استثنا ایجاد کند" +" یا نه. نکات زیر موارد پیچیده تری را که یک استثنا رخ می دهد مورد بحث قرار می" +" دهد:" #: tutorial/errors.rst:408 -msgid "If an exception occurs during execution of the :keyword:`!try` clause, the exception may be handled by an :keyword:`except` clause. If the exception is not handled by an :keyword:`!except` clause, the exception is re-raised after the :keyword:`!finally` clause has been executed." +#, fuzzy +msgid "" +"If an exception occurs during execution of the :keyword:`!try` clause, the " +"exception may be handled by an :keyword:`except` clause. If the exception is" +" not handled by an :keyword:`!except` clause, the exception is re-raised " +"after the :keyword:`!finally` clause has been executed." msgstr "" +"اگر یک استثنا در طول اجرای بند :keyword:`!try` رخ دهد، این استثنا ممکن است " +"توسط یک بند :keyword:`except` مدیریت شود. اگر استثنا توسط یک بند " +":keyword:`!except` مدیریت نشود، پس از اجرای بند :keyword:`!finally`، استثنا " +"دوباره مطرح می شود." #: tutorial/errors.rst:414 -msgid "An exception could occur during execution of an :keyword:`!except` or :keyword:`!else` clause. Again, the exception is re-raised after the :keyword:`!finally` clause has been executed." +#, fuzzy +msgid "" +"An exception could occur during execution of an :keyword:`!except` or " +":keyword:`!else` clause. Again, the exception is re-raised after the " +":keyword:`!finally` clause has been executed." msgstr "" +"یک استثنا ممکن است در طول اجرای یک بند :keyword:`!except` یا " +":keyword:`!else` رخ دهد. مجدداً، پس از اجرای بند :keyword:`!finally`، استثنا" +" دوباره مطرح می شود." #: tutorial/errors.rst:418 -msgid "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:`continue` or :keyword:`return` statement, exceptions are not re-raised." +#, fuzzy +msgid "" +"If the :keyword:`!finally` clause executes a :keyword:`break`, " +":keyword:`continue` or :keyword:`return` statement, exceptions are not re-" +"raised." msgstr "" +"اگر عبارت :keyword:`!finally` یک دستور :keyword:`break`، :keyword:`continue`" +" یا :keyword:`return` را اجرا کند، استثناها دوباره مطرح نمی شوند." #: tutorial/errors.rst:422 -msgid "If the :keyword:`!try` statement reaches a :keyword:`break`, :keyword:`continue` or :keyword:`return` statement, the :keyword:`!finally` clause will execute just prior to the :keyword:`!break`, :keyword:`!continue` or :keyword:`!return` statement's execution." +#, fuzzy +msgid "" +"If the :keyword:`!try` statement reaches a :keyword:`break`, " +":keyword:`continue` or :keyword:`return` statement, the :keyword:`!finally` " +"clause will execute just prior to the :keyword:`!break`, " +":keyword:`!continue` or :keyword:`!return` statement's execution." msgstr "" +"اگر دستور :keyword:`!try` به یک دستور :keyword:`break`، :keyword:`continue` " +"یا :keyword:`return` برسد، عبارت :keyword:`!finally` درست قبل از اجرای دستور" +" :keyword:`!break`، :keyword:`!continue` یا :keyword:`!return` اجرا می شود." #: tutorial/errors.rst:428 -msgid "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the returned value will be the one from the :keyword:`!finally` clause's :keyword:`!return` statement, not the value from the :keyword:`!try` clause's :keyword:`!return` statement." +#, fuzzy +msgid "" +"If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the" +" returned value will be the one from the :keyword:`!finally` clause's " +":keyword:`!return` statement, not the value from the :keyword:`!try` " +"clause's :keyword:`!return` statement." msgstr "" +"اگر یک بند :keyword:`!finally` شامل یک دستور :keyword:`!return` باشد، مقدار " +"بازگشتی عبارت :keyword:`!return` عبارت :keyword:`!finally` خواهد بود، نه " +"مقدار دستور :keyword:`!return` بند :keyword:`!try`." #: tutorial/errors.rst:434 +#, fuzzy msgid "For example::" -msgstr "" +msgstr "به عنوان مثال::" #: tutorial/errors.rst:436 -msgid ">>> def bool_return():\n" +#, fuzzy +msgid "" +">>> def bool_return():\n" "... try:\n" "... return True\n" "... finally:\n" @@ -465,13 +1024,24 @@ msgid ">>> def bool_return():\n" ">>> bool_return()\n" "False" msgstr "" +">>> def bool_return():\n" +"... try:\n" +"... return True\n" +"... finally:\n" +"... return False\n" +"...\n" +">>> bool_return()\n" +"False" #: tutorial/errors.rst:445 +#, fuzzy msgid "A more complicated example::" -msgstr "" +msgstr "یک مثال پیچیده تر::" #: tutorial/errors.rst:447 -msgid ">>> def divide(x, y):\n" +#, fuzzy +msgid "" +">>> def divide(x, y):\n" "... try:\n" "... result = x / y\n" "... except ZeroDivisionError:\n" @@ -498,56 +1068,157 @@ msgid ">>> def divide(x, y):\n" " ~~^~~\n" "TypeError: unsupported operand type(s) for /: 'str' and 'str'" msgstr "" +">>> def divide(x,y):\n" +"... سعی کنید:\n" +"... نتیجه = x / y\n" +"... به جز ZeroDivisionError:\n" +"... چاپ (\"تقسیم بر صفر!\")\n" +"... دیگر:\n" +"... چاپ (\"نتیجه است\", نتیجه)\n" +"... در نهایت:\n" +"... print(\"اجرای بند نهایی\")\n" +"...\n" +">>> تقسیم (2, 1)\n" +"نتیجه 2.0 است\n" +"اجرای بند نهایی\n" +">>> تقسیم (2, 0)\n" +"تقسیم بر صفر!\n" +"اجرای بند نهایی\n" +">>> تقسیم (\"2\", \"1\")\n" +"اجرای بند نهایی\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +" تقسیم (\"2\", \"1\")\n" +" ~~~~~~^^^^^^^^^^\n" +" فایل \"\", خط 3، در تقسیم\n" +" نتیجه = x / y\n" +" ~~^~~\n" +"TypeError: نوع(های) عملوند پشتیبانی نشده برای /: 'str' و 'str'" #: tutorial/errors.rst:474 -msgid "As you can see, the :keyword:`finally` clause is executed in any event. The :exc:`TypeError` raised by dividing two strings is not handled by the :keyword:`except` clause and therefore re-raised after the :keyword:`!finally` clause has been executed." +#, fuzzy +msgid "" +"As you can see, the :keyword:`finally` clause is executed in any event. The" +" :exc:`TypeError` raised by dividing two strings is not handled by the " +":keyword:`except` clause and therefore re-raised after the " +":keyword:`!finally` clause has been executed." msgstr "" +"همانطور که می بینید، بند :keyword:`finally` در هر صورت اجرا می شود. " +":exc:`TypeError` که با تقسیم دو رشته ایجاد می شود توسط بند :keyword:`except`" +" مدیریت نمی شود و بنابراین پس از اجرای بند :keyword:`!finally` دوباره مطرح " +"می شود." #: tutorial/errors.rst:479 -msgid "In real world applications, the :keyword:`finally` clause is useful for releasing external resources (such as files or network connections), regardless of whether the use of the resource was successful." +#, fuzzy +msgid "" +"In real world applications, the :keyword:`finally` clause is useful for " +"releasing external resources (such as files or network connections), " +"regardless of whether the use of the resource was successful." msgstr "" +"در برنامه های کاربردی دنیای واقعی، بند :keyword:`finally` برای انتشار منابع " +"خارجی (مانند فایل ها یا اتصالات شبکه), صرف نظر از اینکه استفاده از منبع " +"موفقیت آمیز بوده است مفید است." #: tutorial/errors.rst:487 +#, fuzzy msgid "Predefined Clean-up Actions" -msgstr "" +msgstr "اقدامات پاکسازی از پیش تعریف شده" #: tutorial/errors.rst:489 -msgid "Some objects define standard clean-up actions to be undertaken when the object is no longer needed, regardless of whether or not the operation using the object succeeded or failed. Look at the following example, which tries to open a file and print its contents to the screen. ::" +#, fuzzy +msgid "" +"Some objects define standard clean-up actions to be undertaken when the " +"object is no longer needed, regardless of whether or not the operation using" +" the object succeeded or failed. Look at the following example, which tries " +"to open a file and print its contents to the screen. ::" msgstr "" +"برخی از اشیاء اقدامات پاکسازی استانداردی را تعریف می‌کنند که باید در مواقعی " +"که شی دیگر مورد نیاز نیست، انجام شود، صرف نظر از اینکه آیا عملیات با استفاده" +" از شی موفقیت‌آمیز بوده یا ناموفق بوده است. به مثال زیر نگاه کنید، که سعی می" +" کند یک فایل را باز کند و محتویات آن را روی صفحه چاپ کند. ::" #: tutorial/errors.rst:494 -msgid "for line in open(\"myfile.txt\"):\n" +#, fuzzy +msgid "" +"for line in open(\"myfile.txt\"):\n" " print(line, end=\"\")" msgstr "" +"for line in open(\"myfile.txt\"):\n" +" print(line, end=\"\")" #: tutorial/errors.rst:497 -msgid "The problem with this code is that it leaves the file open for an indeterminate amount of time after this part of the code has finished executing. This is not an issue in simple scripts, but can be a problem for larger applications. The :keyword:`with` statement allows objects like files to be used in a way that ensures they are always cleaned up promptly and correctly. ::" -msgstr "" +#, fuzzy +msgid "" +"The problem with this code is that it leaves the file open for an " +"indeterminate amount of time after this part of the code has finished " +"executing. This is not an issue in simple scripts, but can be a problem for " +"larger applications. The :keyword:`with` statement allows objects like files" +" to be used in a way that ensures they are always cleaned up promptly and " +"correctly. ::" +msgstr "" +"مشکل این کد این است که پس از اتمام اجرای این قسمت از کد، فایل را برای مدت " +"زمان نامشخصی باز می گذارد. این مشکل در اسکریپت های ساده نیست، اما می تواند " +"برای برنامه های بزرگتر مشکل ساز باشد. دستور :keyword:`with` به اشیایی مانند " +"فایل‌ها اجازه می‌دهد به گونه‌ای استفاده شوند که اطمینان حاصل شود که همیشه " +"به‌درستی و به‌درستی پاک می‌شوند. ::" #: tutorial/errors.rst:503 -msgid "with open(\"myfile.txt\") as f:\n" +#, fuzzy +msgid "" +"with open(\"myfile.txt\") as f:\n" " for line in f:\n" " print(line, end=\"\")" msgstr "" +"with open(\"myfile.txt\") as f:\n" +" for line in f:\n" +" print(line, end=\"\")" #: tutorial/errors.rst:507 -msgid "After the statement is executed, the file *f* is always closed, even if a problem was encountered while processing the lines. Objects which, like files, provide predefined clean-up actions will indicate this in their documentation." +#, fuzzy +msgid "" +"After the statement is executed, the file *f* is always closed, even if a " +"problem was encountered while processing the lines. Objects which, like " +"files, provide predefined clean-up actions will indicate this in their " +"documentation." msgstr "" +"پس از اجرای دستور، فایل *f* همیشه بسته می شود، حتی اگر هنگام پردازش خطوط با " +"مشکلی مواجه شود. اشیایی که مانند فایل‌ها، اقدامات پاکسازی از پیش تعریف شده " +"را ارائه می‌کنند، این موضوع را در مستندات خود نشان می‌دهند." #: tutorial/errors.rst:515 +#, fuzzy msgid "Raising and Handling Multiple Unrelated Exceptions" -msgstr "" +msgstr "ایجاد و رسیدگی به استثناهای متعدد نامربوط" #: tutorial/errors.rst:517 -msgid "There are situations where it is necessary to report several exceptions that have occurred. This is often the case in concurrency frameworks, when several tasks may have failed in parallel, but there are also other use cases where it is desirable to continue execution and collect multiple errors rather than raise the first exception." +#, fuzzy +msgid "" +"There are situations where it is necessary to report several exceptions that" +" have occurred. This is often the case in concurrency frameworks, when " +"several tasks may have failed in parallel, but there are also other use " +"cases where it is desirable to continue execution and collect multiple " +"errors rather than raise the first exception." msgstr "" +"شرایطی وجود دارد که لازم است چندین استثناء رخ داده گزارش شود. این اغلب در " +"چارچوب‌های همزمانی اتفاق می‌افتد، زمانی که چندین کار ممکن است به طور موازی " +"شکست بخورند، اما موارد استفاده دیگری نیز وجود دارد که در آن‌ها به جای مطرح " +"کردن اولین استثنا، ادامه اجرا و جمع‌آوری خطاهای متعدد مطلوب است." #: tutorial/errors.rst:523 -msgid "The builtin :exc:`ExceptionGroup` wraps a list of exception instances so that they can be raised together. It is an exception itself, so it can be caught like any other exception. ::" +#, fuzzy +msgid "" +"The builtin :exc:`ExceptionGroup` wraps a list of exception instances so " +"that they can be raised together. It is an exception itself, so it can be " +"caught like any other exception. ::" msgstr "" +":exc:`ExceptionGroup` داخلی فهرستی از موارد استثنا را می‌پیچد تا بتوان آنها " +"را با هم افزایش داد. این خود یک استثنا است، بنابراین می توان آن را مانند هر " +"استثنا دیگری گرفت. ::" #: tutorial/errors.rst:527 -msgid ">>> def f():\n" +#, fuzzy +msgid "" +">>> def f():\n" "... excs = [OSError('error 1'), SystemError('error 2')]\n" "... raise ExceptionGroup('there were problems', excs)\n" "...\n" @@ -572,13 +1243,50 @@ msgid ">>> def f():\n" "caught : e\n" ">>>" msgstr "" +">>> def f():\n" +"... excs = [OSError('Error 1'), SystemError('Error 2')]\n" +"... رایز ExceptionGroup (\"مشکلاتی وجود داشت\", excs)\n" +"...\n" +">>> f()\n" +" + ردیابی گروه استثنا (آخرین تماس):\n" +" | فایل \"\", خط 1، در \n" +" | f()\n" +" | ~^^\n" +" | فایل \"\", خط 3، در f\n" +" | افزایش ExceptionGroup (\"مشکلاتی وجود داشت\", excs)\n" +" | ExceptionGroup: مشکلاتی وجود داشت (2 استثناء فرعی)\n" +" +-+---------------- 1 -----------------\n" +" | خطای OSE: خطای 1\n" +" +---------------- 2 ----------------\n" +" | خطای سیستم: خطای 2\n" +" +-----------------------------------\n" +">>> امتحان کنید:\n" +"... f()\n" +"... به جز استثنا به عنوان e:\n" +"... چاپ (f'caught {type(e)}: e')\n" +"...\n" +"گرفتار : e\n" +">>>" #: tutorial/errors.rst:552 -msgid "By using ``except*`` instead of ``except``, we can selectively handle only the exceptions in the group that match a certain type. In the following example, which shows a nested exception group, each ``except*`` clause extracts from the group exceptions of a certain type while letting all other exceptions propagate to other clauses and eventually to be reraised. ::" -msgstr "" +#, fuzzy +msgid "" +"By using ``except*`` instead of ``except``, we can selectively handle only " +"the exceptions in the group that match a certain type. In the following " +"example, which shows a nested exception group, each ``except*`` clause " +"extracts from the group exceptions of a certain type while letting all other" +" exceptions propagate to other clauses and eventually to be reraised. ::" +msgstr "" +"با استفاده از ``except*`` به جای ``except``، می‌توانیم به‌طور انتخابی فقط " +"استثناهای گروه را که با یک نوع خاص مطابقت دارند، مدیریت کنیم. در مثال زیر، " +"که یک گروه استثنای تودرتو را نشان می‌دهد، هر عبارت ``except*`` از استثناهای " +"گروه یک نوع خاص استخراج می‌کند در حالی که اجازه می‌دهد همه استثناهای دیگر به" +" بندهای دیگر انتشار یابند و در نهایت دوباره مطرح شوند. ::" #: tutorial/errors.rst:559 -msgid ">>> def f():\n" +#, fuzzy +msgid "" +">>> def f():\n" "... raise ExceptionGroup(\n" "... \"group1\",\n" "... [\n" @@ -619,13 +1327,63 @@ msgid ">>> def f():\n" " +------------------------------------\n" ">>>" msgstr "" +">>> def f():\n" +"... ExceptionGroup را افزایش دهید(\n" +"... \"گروه 1\",\n" +"... [\n" +"... OSError(1)\n" +"... سیستم خطا (2),\n" +"... ExceptionGroup(\n" +"... \"گروه 2\",\n" +"... [\n" +"... OSError(3),\n" +"... RecursionError (4)\n" +"...]\n" +"...)\n" +"...]\n" +"...)\n" +"...\n" +">>> امتحان کنید:\n" +"... f()\n" +"به جز * OSError as e:\n" +"... print(\"There were OSErrors\")\n" +"... except* SystemError به عنوان e:\n" +"... چاپ (\"خطاهای سیستمی وجود داشت\")\n" +"...\n" +"خطاهای OSE وجود داشت\n" +"خطاهای سیستمی وجود داشت\n" +" + ردیابی گروه استثنا (آخرین تماس):\n" +" | فایل \"\", خط 2، در \n" +" | f()\n" +" | ~^^\n" +" | فایل \"\", خط 2، در f\n" +" | افزایش ExceptionGroup(\n" +" | ...<12 خط>...\n" +" | )\n" +" | ExceptionGroup: group1 (1 زیر استثنا)\n" +" +-+---------------- 1 -----------------\n" +" | ExceptionGroup: group2 (1 زیر استثنا)\n" +" +-+---------------- 1 -----------------\n" +" | RecursionError: 4\n" +" +-----------------------------------\n" +">>>" #: tutorial/errors.rst:600 -msgid "Note that the exceptions nested in an exception group must be instances, not types. This is because in practice the exceptions would typically be ones that have already been raised and caught by the program, along the following pattern::" +#, fuzzy +msgid "" +"Note that the exceptions nested in an exception group must be instances, not" +" types. This is because in practice the exceptions would typically be ones " +"that have already been raised and caught by the program, along the following" +" pattern::" msgstr "" +"توجه داشته باشید که استثناهای تو در تو در یک گروه استثنایی باید نمونه باشند،" +" نه نوع. این به این دلیل است که در عمل استثناها معمولاً مواردی هستند که " +"قبلاً توسط برنامه مطرح شده و در الگوی زیر ثبت شده اند:" #: tutorial/errors.rst:605 -msgid ">>> excs = []\n" +#, fuzzy +msgid "" +">>> excs = []\n" "... for test in tests:\n" "... try:\n" "... test.run()\n" @@ -636,17 +1394,44 @@ msgid ">>> excs = []\n" "... raise ExceptionGroup(\"Test Failures\", excs)\n" "..." msgstr "" +">>> excs = []\n" +"... for test in tests:\n" +"... try:\n" +"... test.run()\n" +"... except Exception as e:\n" +"... excs.append(e)\n" +"...\n" +">>> if excs:\n" +"... raise ExceptionGroup(\"Test Failures\", excs)\n" +"..." #: tutorial/errors.rst:620 +#, fuzzy msgid "Enriching Exceptions with Notes" -msgstr "" +msgstr "غنی سازی استثناها با یادداشت ها" #: tutorial/errors.rst:622 -msgid "When an exception is created in order to be raised, it is usually initialized with information that describes the error that has occurred. There are cases where it is useful to add information after the exception was caught. For this purpose, exceptions have a method ``add_note(note)`` that accepts a string and adds it to the exception's notes list. The standard traceback rendering includes all notes, in the order they were added, after the exception. ::" -msgstr "" +#, fuzzy +msgid "" +"When an exception is created in order to be raised, it is usually " +"initialized with information that describes the error that has occurred. " +"There are cases where it is useful to add information after the exception " +"was caught. For this purpose, exceptions have a method ``add_note(note)`` " +"that accepts a string and adds it to the exception's notes list. The " +"standard traceback rendering includes all notes, in the order they were " +"added, after the exception. ::" +msgstr "" +"هنگامی که یک استثنا ایجاد می شود تا مطرح شود، معمولاً با اطلاعاتی که خطای رخ" +" داده را توصیف می کند مقداردهی اولیه می شود. مواردی وجود دارد که اضافه کردن " +"اطلاعات پس از کشف استثنا مفید است. برای این منظور، استثناها دارای یک متد " +"``add_note(note)`` هستند که یک رشته را می پذیرد و آن را به لیست یادداشت های " +"استثنا اضافه می کند. رندر استاندارد ردیابی شامل همه یادداشت‌ها، به ترتیبی که" +" پس از استثنا اضافه شده‌اند، می‌شود. ::" #: tutorial/errors.rst:629 -msgid ">>> try:\n" +#, fuzzy +msgid "" +">>> try:\n" "... raise TypeError('bad type')\n" "... except Exception as e:\n" "... e.add_note('Add some information')\n" @@ -661,13 +1446,37 @@ msgid ">>> try:\n" "Add some more information\n" ">>>" msgstr "" +">>> امتحان کنید:\n" +"... افزایش TypeError ('نوع بد')\n" +"... به جز استثنا به عنوان e:\n" +"... e.add_note('Add some information')\n" +"... e.add_note('اطلاعات بیشتری اضافه کنید')\n" +"... بالا بردن\n" +"...\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 2، در \n" +" افزایش TypeError ('نوع بد')\n" +"TypeError: نوع بد\n" +"مقداری اطلاعات اضافه کنید\n" +"اطلاعات بیشتری اضافه کنید\n" +">>>" #: tutorial/errors.rst:644 -msgid "For example, when collecting exceptions into an exception group, we may want to add context information for the individual errors. In the following each exception in the group has a note indicating when this error has occurred. ::" +#, fuzzy +msgid "" +"For example, when collecting exceptions into an exception group, we may want" +" to add context information for the individual errors. In the following each" +" exception in the group has a note indicating when this error has occurred. " +"::" msgstr "" +"به عنوان مثال، هنگام جمع آوری استثناها در یک گروه استثنا، ممکن است بخواهیم " +"اطلاعات زمینه را برای خطاهای فردی اضافه کنیم. در ادامه هر استثنا در گروه " +"دارای یک یادداشت است که نشان می دهد چه زمانی این خطا رخ داده است. ::" #: tutorial/errors.rst:648 -msgid ">>> def f():\n" +#, fuzzy +msgid "" +">>> def f():\n" "... raise OSError('operation failed')\n" "...\n" ">>> excs = []\n" @@ -713,3 +1522,48 @@ msgid ">>> def f():\n" " +------------------------------------\n" ">>>" msgstr "" +">>> def f():\n" +"... افزایش OSError ('عملیات ناموفق')\n" +"...\n" +">>> excs = []\n" +">>> برای i در محدوده (3):\n" +"... سعی کنید:\n" +"... f()\n" +"... به جز استثنا به عنوان e:\n" +"... e.add_note(f'در تکرار {i+1}')\n" +"... excs.append(e)\n" +"...\n" +">>> افزایش ExceptionGroup (\"ما مشکلاتی داریم\", excs)\n" +" + ردیابی گروه استثنا (آخرین تماس):\n" +" | فایل \"\", خط 1، در \n" +" | افزایش ExceptionGroup (\"ما مشکلاتی داریم\", excs)\n" +" | ExceptionGroup: ما مشکلاتی داریم (3 استثناء فرعی)\n" +" +-+---------------- 1 -----------------\n" +" | ردیابی (آخرین تماس اخیر):\n" +" | فایل \"\", خط 3، در \n" +" | f()\n" +" | ~^^\n" +" | فایل \"\", خط 2، در f\n" +" | افزایش OSError ('عملیات ناموفق')\n" +" | خطای OSE: عملیات انجام نشد\n" +" | در تکرار 1 اتفاق افتاد\n" +" +---------------- 2 ----------------\n" +" | ردیابی (آخرین تماس اخیر):\n" +" | فایل \"\", خط 3، در \n" +" | f()\n" +" | ~^^\n" +" | فایل \"\", خط 2، در f\n" +" | افزایش OSError ('عملیات ناموفق')\n" +" | خطای OSE: عملیات انجام نشد\n" +" | در تکرار 2 اتفاق افتاد\n" +" +---------------- 3 ----------------\n" +" | ردیابی (آخرین تماس اخیر):\n" +" | فایل \"\", خط 3، در \n" +" | f()\n" +" | ~^^\n" +" | فایل \"\", خط 2، در f\n" +" | افزایش OSError ('عملیات ناموفق')\n" +" | خطای OSE: عملیات انجام نشد\n" +" | در تکرار 3 اتفاق افتاد\n" +" +-----------------------------------\n" +">>>" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index b512c7c2..0e3df001 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -17,94 +17,219 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/floatingpoint.rst:10 +#, fuzzy msgid "Floating-Point Arithmetic: Issues and Limitations" -msgstr "" +msgstr "محاسبات ممیز شناور: مسائل و محدودیت ها" #: tutorial/floatingpoint.rst:16 -msgid "Floating-point numbers are represented in computer hardware as base 2 (binary) fractions. For example, the **decimal** fraction ``0.625`` has value 6/10 + 2/100 + 5/1000, and in the same way the **binary** fraction ``0.101`` has value 1/2 + 0/4 + 1/8. These two fractions have identical values, the only real difference being that the first is written in base 10 fractional notation, and the second in base 2." -msgstr "" +#, fuzzy +msgid "" +"Floating-point numbers are represented in computer hardware as base 2 " +"(binary) fractions. For example, the **decimal** fraction ``0.625`` has " +"value 6/10 + 2/100 + 5/1000, and in the same way the **binary** fraction " +"``0.101`` has value 1/2 + 0/4 + 1/8. These two fractions have identical " +"values, the only real difference being that the first is written in base 10 " +"fractional notation, and the second in base 2." +msgstr "" +"اعداد ممیز شناور در سخت افزار کامپیوتر به صورت کسری پایه 2 (دودویی) نشان " +"داده می شوند. به عنوان مثال، کسر **decimal** ``0.625`` دارای ارزش 6/10 + " +"2/100 + 5/1000 است و به همین ترتیب کسر **binary** ``0.101`` دارای ارزش 1/2 +" +" 0/4 + 1/8 است. این دو کسر مقادیر یکسانی دارند، تنها تفاوت واقعی این است که " +"اولی با نماد کسری پایه 10 و دومی در پایه 2 نوشته شده است." #: tutorial/floatingpoint.rst:23 -msgid "Unfortunately, most decimal fractions cannot be represented exactly as binary fractions. A consequence is that, in general, the decimal floating-point numbers you enter are only approximated by the binary floating-point numbers actually stored in the machine." +#, fuzzy +msgid "" +"Unfortunately, most decimal fractions cannot be represented exactly as " +"binary fractions. A consequence is that, in general, the decimal floating-" +"point numbers you enter are only approximated by the binary floating-point " +"numbers actually stored in the machine." msgstr "" +"متأسفانه، اکثر کسرهای اعشاری نمی توانند دقیقاً به صورت کسرهای دودویی نمایش " +"داده شوند. نتیجه این است که، به طور کلی، اعداد ممیز شناور اعشاری که وارد " +"می‌کنید، تنها با اعداد ممیز شناور باینری که واقعاً در دستگاه ذخیره می‌شوند، " +"تقریبی دارند." #: tutorial/floatingpoint.rst:28 -msgid "The problem is easier to understand at first in base 10. Consider the fraction 1/3. You can approximate that as a base 10 fraction::" +#, fuzzy +msgid "" +"The problem is easier to understand at first in base 10. Consider the " +"fraction 1/3. You can approximate that as a base 10 fraction::" msgstr "" +"درک مسئله در ابتدا در پایه 10 آسانتر است. کسری 1/3 را در نظر بگیرید. شما می" +" توانید آن را به عنوان کسری پایه 10 تقریب بزنید:" #: tutorial/floatingpoint.rst:31 +#, fuzzy msgid "0.3" -msgstr "" +msgstr "0.3" -#: tutorial/floatingpoint.rst:33 -#: tutorial/floatingpoint.rst:37 +#: tutorial/floatingpoint.rst:33 tutorial/floatingpoint.rst:37 +#, fuzzy msgid "or, better, ::" -msgstr "" +msgstr "یا بهتر ::" #: tutorial/floatingpoint.rst:35 +#, fuzzy msgid "0.33" -msgstr "" +msgstr "0.33" #: tutorial/floatingpoint.rst:39 +#, fuzzy msgid "0.333" -msgstr "" +msgstr "0.333" #: tutorial/floatingpoint.rst:41 -msgid "and so on. No matter how many digits you're willing to write down, the result will never be exactly 1/3, but will be an increasingly better approximation of 1/3." +#, fuzzy +msgid "" +"and so on. No matter how many digits you're willing to write down, the " +"result will never be exactly 1/3, but will be an increasingly better " +"approximation of 1/3." msgstr "" +"و غیره مهم نیست که چند رقم را بخواهید یادداشت کنید، نتیجه هرگز دقیقاً 1/3 " +"نخواهد بود، بلکه تقریب فزاینده بهتری از 1/3 خواهد بود." #: tutorial/floatingpoint.rst:45 -msgid "In the same way, no matter how many base 2 digits you're willing to use, the decimal value 0.1 cannot be represented exactly as a base 2 fraction. In base 2, 1/10 is the infinitely repeating fraction ::" +#, fuzzy +msgid "" +"In the same way, no matter how many base 2 digits you're willing to use, the" +" decimal value 0.1 cannot be represented exactly as a base 2 fraction. In " +"base 2, 1/10 is the infinitely repeating fraction ::" msgstr "" +"به همین ترتیب، مهم نیست که چند رقم پایه 2 را می خواهید استفاده کنید، مقدار " +"اعشاری 0.1 نمی تواند دقیقاً به عنوان یک کسر پایه 2 نمایش داده شود. در پایه " +"2، 1/10 کسر بی نهایت تکراری است::" #: tutorial/floatingpoint.rst:49 +#, fuzzy msgid "0.0001100110011001100110011001100110011001100110011..." -msgstr "" +msgstr "0.0001100110011001100110011001100110011001100110011..." #: tutorial/floatingpoint.rst:51 -msgid "Stop at any finite number of bits, and you get an approximation. On most machines today, floats are approximated using a binary fraction with the numerator using the first 53 bits starting with the most significant bit and with the denominator as a power of two. In the case of 1/10, the binary fraction is ``3602879701896397 / 2 ** 55`` which is close to but not exactly equal to the true value of 1/10." -msgstr "" +#, fuzzy +msgid "" +"Stop at any finite number of bits, and you get an approximation. On most " +"machines today, floats are approximated using a binary fraction with the " +"numerator using the first 53 bits starting with the most significant bit and" +" with the denominator as a power of two. In the case of 1/10, the binary " +"fraction is ``3602879701896397 / 2 ** 55`` which is close to but not exactly" +" equal to the true value of 1/10." +msgstr "" +"روی هر تعداد بیت محدودی توقف کنید و یک تقریب به دست می آورید. در اکثر " +"ماشین‌های امروزی، شناورها با استفاده از یک کسر دودویی با عددی که از 53 بیت " +"اول استفاده می‌کند، با مهم‌ترین بیت شروع می‌شود و مخرج آن به توان دو می‌رسد." +" در مورد 1/10، کسر باینری ``3602879701896397 / 2 ** 55`` است که نزدیک است " +"اما دقیقاً برابر با مقدار واقعی 1/10 نیست." #: tutorial/floatingpoint.rst:58 -msgid "Many users are not aware of the approximation because of the way values are displayed. Python only prints a decimal approximation to the true decimal value of the binary approximation stored by the machine. On most machines, if Python were to print the true decimal value of the binary approximation stored for 0.1, it would have to display::" +#, fuzzy +msgid "" +"Many users are not aware of the approximation because of the way values are " +"displayed. Python only prints a decimal approximation to the true decimal " +"value of the binary approximation stored by the machine. On most machines, " +"if Python were to print the true decimal value of the binary approximation " +"stored for 0.1, it would have to display::" msgstr "" +"بسیاری از کاربران به دلیل نحوه نمایش مقادیر از تقریب آگاه نیستند. پایتون " +"فقط یک تقریب اعشاری را به مقدار اعشاری واقعی تقریب باینری ذخیره شده توسط " +"ماشین چاپ می کند. در اکثر ماشین‌ها، اگر پایتون مقدار اعشاری واقعی تقریب " +"باینری ذخیره شده برای 0.1 را چاپ کند، باید نشان دهد:" #: tutorial/floatingpoint.rst:64 -msgid ">>> 0.1\n" +#, fuzzy +msgid "" +">>> 0.1\n" "0.1000000000000000055511151231257827021181583404541015625" msgstr "" +">>> 0.1\n" +"0.1000000000000000055511151231257827021181583404541015625" #: tutorial/floatingpoint.rst:67 -msgid "That is more digits than most people find useful, so Python keeps the number of digits manageable by displaying a rounded value instead:" +#, fuzzy +msgid "" +"That is more digits than most people find useful, so Python keeps the number" +" of digits manageable by displaying a rounded value instead:" msgstr "" +"این ارقام بیشتر از آن چیزی است که بیشتر مردم مفید می دانند، بنابراین پایتون " +"با نمایش یک مقدار گرد شده، تعداد ارقام را قابل مدیریت نگه می دارد:" #: tutorial/floatingpoint.rst:70 -msgid ">>> 1 / 10\n" +#, fuzzy +msgid "" +">>> 1 / 10\n" "0.1" msgstr "" +">>> 1 / 10\n" +"0.1" #: tutorial/floatingpoint.rst:75 -msgid "Just remember, even though the printed result looks like the exact value of 1/10, the actual stored value is the nearest representable binary fraction." +#, fuzzy +msgid "" +"Just remember, even though the printed result looks like the exact value of " +"1/10, the actual stored value is the nearest representable binary fraction." msgstr "" +"فقط به یاد داشته باشید، حتی اگر نتیجه چاپ شده شبیه مقدار دقیق 1/10 باشد، " +"مقدار ذخیره شده واقعی نزدیکترین کسر باینری قابل نمایش است." #: tutorial/floatingpoint.rst:78 -msgid "Interestingly, there are many different decimal numbers that share the same nearest approximate binary fraction. For example, the numbers ``0.1`` and ``0.10000000000000001`` and ``0.1000000000000000055511151231257827021181583404541015625`` are all approximated by ``3602879701896397 / 2 ** 55``. Since all of these decimal values share the same approximation, any one of them could be displayed while still preserving the invariant ``eval(repr(x)) == x``." -msgstr "" +#, fuzzy +msgid "" +"Interestingly, there are many different decimal numbers that share the same " +"nearest approximate binary fraction. For example, the numbers ``0.1`` and " +"``0.10000000000000001`` and " +"``0.1000000000000000055511151231257827021181583404541015625`` are all " +"approximated by ``3602879701896397 / 2 ** 55``. Since all of these decimal " +"values share the same approximation, any one of them could be displayed " +"while still preserving the invariant ``eval(repr(x)) == x``." +msgstr "" +"جالب اینجاست که اعداد اعشاری مختلف زیادی وجود دارند که نزدیکترین کسر دودویی " +"تقریبی یکسانی دارند. به عنوان مثال، اعداد ``0.1`` و ``0.10000000000000001``" +" و ``0.1000000000000000055511151231257827021181583404541015625`` همگی با " +"``3602879701896397 / 2 ** 55`` تقریبی هستند. از آنجایی که همه این مقادیر " +"اعشاری تقریب یکسانی دارند، هر یک از آنها می تواند با حفظ ``eval(repr(x)) == " +"x`` ثابت نمایش داده شود." #: tutorial/floatingpoint.rst:86 -msgid "Historically, the Python prompt and built-in :func:`repr` function would choose the one with 17 significant digits, ``0.10000000000000001``. Starting with Python 3.1, Python (on most systems) is now able to choose the shortest of these and simply display ``0.1``." +#, fuzzy +msgid "" +"Historically, the Python prompt and built-in :func:`repr` function would " +"choose the one with 17 significant digits, ``0.10000000000000001``. " +"Starting with Python 3.1, Python (on most systems) is now able to choose the" +" shortest of these and simply display ``0.1``." msgstr "" +"از لحاظ تاریخی، تابع اعلان پایتون و تابع :func:`repr` داخلی، یکی با 17 رقم " +"قابل توجه، ``0.10000000000000001`` را انتخاب می کند. با شروع پایتون 3.1، " +"پایتون (در اکثر سیستم ها) اکنون می تواند کوتاه ترین را انتخاب کند و به سادگی" +" ``0.1`` را نمایش دهد." #: tutorial/floatingpoint.rst:91 -msgid "Note that this is in the very nature of binary floating point: this is not a bug in Python, and it is not a bug in your code either. You'll see the same kind of thing in all languages that support your hardware's floating-point arithmetic (although some languages may not *display* the difference by default, or in all output modes)." -msgstr "" +#, fuzzy +msgid "" +"Note that this is in the very nature of binary floating point: this is not a" +" bug in Python, and it is not a bug in your code either. You'll see the " +"same kind of thing in all languages that support your hardware's floating-" +"point arithmetic (although some languages may not *display* the difference " +"by default, or in all output modes)." +msgstr "" +"توجه داشته باشید که این در ماهیت نقطه شناور باینری است: این یک باگ در پایتون" +" نیست و در کد شما نیز وجود ندارد. در همه زبان‌هایی که از محاسبات ممیز شناور" +" سخت‌افزار شما پشتیبانی می‌کنند، چیزهای مشابهی خواهید دید (اگرچه ممکن است " +"برخی از زبان‌ها به‌طور پیش‌فرض یا در همه حالت‌های خروجی تفاوت *display* را " +"نداشته باشند)." #: tutorial/floatingpoint.rst:97 -msgid "For more pleasant output, you may wish to use string formatting to produce a limited number of significant digits:" +#, fuzzy +msgid "" +"For more pleasant output, you may wish to use string formatting to produce a" +" limited number of significant digits:" msgstr "" +"برای خروجی دلپذیرتر، ممکن است بخواهید از قالب بندی رشته برای تولید تعداد " +"محدودی ارقام قابل توجه استفاده کنید:" #: tutorial/floatingpoint.rst:100 -msgid ">>> format(math.pi, '.12g') # give 12 significant digits\n" +#, fuzzy +msgid "" +">>> format(math.pi, '.12g') # give 12 significant digits\n" "'3.14159265359'\n" "\n" ">>> format(math.pi, '.2f') # give 2 digits after the point\n" @@ -113,129 +238,322 @@ msgid ">>> format(math.pi, '.12g') # give 12 significant digits\n" ">>> repr(math.pi)\n" "'3.141592653589793'" msgstr "" +">>> format(math.pi, '.12g') # give 12 significant digits\n" +"'3.14159265359'\n" +"\n" +">>> format(math.pi, '.2f') # give 2 digits after the point\n" +"'3.14'\n" +"\n" +">>> repr(math.pi)\n" +"'3.141592653589793'" #: tutorial/floatingpoint.rst:111 -msgid "It's important to realize that this is, in a real sense, an illusion: you're simply rounding the *display* of the true machine value." +#, fuzzy +msgid "" +"It's important to realize that this is, in a real sense, an illusion: you're" +" simply rounding the *display* of the true machine value." msgstr "" +"درک این نکته مهم است که این به معنای واقعی یک توهم است: شما به سادگی " +"*display* مقدار واقعی ماشین را گرد می کنید." #: tutorial/floatingpoint.rst:114 -msgid "One illusion may beget another. For example, since 0.1 is not exactly 1/10, summing three values of 0.1 may not yield exactly 0.3, either:" +#, fuzzy +msgid "" +"One illusion may beget another. For example, since 0.1 is not exactly 1/10," +" summing three values of 0.1 may not yield exactly 0.3, either:" msgstr "" +"یک توهم ممکن است توهم دیگری ایجاد کند. برای مثال، از آنجایی که 0.1 دقیقاً " +"1/10 نیست، با جمع کردن سه مقدار 0.1 ممکن است دقیقاً 0.3 به دست نیاید:" #: tutorial/floatingpoint.rst:117 -msgid ">>> 0.1 + 0.1 + 0.1 == 0.3\n" +#, fuzzy +msgid "" +">>> 0.1 + 0.1 + 0.1 == 0.3\n" "False" msgstr "" +">>> 0.1 + 0.1 + 0.1 == 0.3\n" +"False" #: tutorial/floatingpoint.rst:122 -msgid "Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 cannot get any closer to the exact value of 3/10, then pre-rounding with :func:`round` function cannot help:" +#, fuzzy +msgid "" +"Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3" +" cannot get any closer to the exact value of 3/10, then pre-rounding with " +":func:`round` function cannot help:" msgstr "" +"همچنین، از آنجایی که 0.1 نمی تواند به مقدار دقیق 1/10 نزدیک شود و 0.3 نمی " +"تواند به مقدار دقیق 3/10 نزدیک شود، بنابراین پیش گرد کردن با تابع " +":func:`round` نمی تواند کمک کند:" #: tutorial/floatingpoint.rst:126 -msgid ">>> round(0.1, 1) + round(0.1, 1) + round(0.1, 1) == round(0.3, 1)\n" +#, fuzzy +msgid "" +">>> round(0.1, 1) + round(0.1, 1) + round(0.1, 1) == round(0.3, 1)\n" "False" msgstr "" +">>> round(0.1, 1) + round(0.1, 1) + round(0.1, 1) == round(0.3, 1)\n" +"False" #: tutorial/floatingpoint.rst:131 -msgid "Though the numbers cannot be made closer to their intended exact values, the :func:`math.isclose` function can be useful for comparing inexact values:" +#, fuzzy +msgid "" +"Though the numbers cannot be made closer to their intended exact values, the" +" :func:`math.isclose` function can be useful for comparing inexact values:" msgstr "" +"اگرچه نمی توان اعداد را به مقادیر دقیق مورد نظر نزدیکتر کرد، تابع " +":func:`math.isclose` می تواند برای مقایسه مقادیر غیر دقیق مفید باشد:" #: tutorial/floatingpoint.rst:134 -msgid ">>> math.isclose(0.1 + 0.1 + 0.1, 0.3)\n" +#, fuzzy +msgid "" +">>> math.isclose(0.1 + 0.1 + 0.1, 0.3)\n" "True" msgstr "" +">>> math.isclose(0.1 + 0.1 + 0.1, 0.3)\n" +"True" #: tutorial/floatingpoint.rst:139 -msgid "Alternatively, the :func:`round` function can be used to compare rough approximations:" +#, fuzzy +msgid "" +"Alternatively, the :func:`round` function can be used to compare rough " +"approximations:" msgstr "" +"همچنین می توان از تابع :func:`round` برای مقایسه تقریب های تقریبی استفاده " +"کرد:" #: tutorial/floatingpoint.rst:142 -msgid ">>> round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)\n" +#, fuzzy +msgid "" +">>> round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)\n" "True" msgstr "" +">>> round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)\n" +"True" #: tutorial/floatingpoint.rst:147 -msgid "Binary floating-point arithmetic holds many surprises like this. The problem with \"0.1\" is explained in precise detail below, in the \"Representation Error\" section. See `Examples of Floating Point Problems `_ for a pleasant summary of how binary floating point works and the kinds of problems commonly encountered in practice. Also see `The Perils of Floating Point `_ for a more complete account of other common surprises." -msgstr "" +#, fuzzy +msgid "" +"Binary floating-point arithmetic holds many surprises like this. The " +"problem with \"0.1\" is explained in precise detail below, in the " +"\"Representation Error\" section. See `Examples of Floating Point Problems " +"`_ for" +" a pleasant summary of how binary floating point works and the kinds of " +"problems commonly encountered in practice. Also see `The Perils of Floating" +" Point `_ for a more complete " +"account of other common surprises." +msgstr "" +"محاسبات ممیز شناور دودویی شگفتی‌های زیادی از این دست را در خود دارد. مشکل " +"\"0.1\" با جزئیات دقیق در زیر، در بخش \"خطای نمایش\" توضیح داده شده است. " +"برای یک خلاصه دلپذیر از نحوه عملکرد ممیز شناور باینری و انواع مشکلاتی که " +"معمولا در عمل با آن مواجه می شوید، به `Examples of Floating Point Problems " +"`_ " +"مراجعه کنید. همچنین `The Perils of Floating Point " +"`_ را برای توضیح کامل تر از سایر" +" شگفتی های رایج ببینید." #: tutorial/floatingpoint.rst:156 -msgid "As that says near the end, \"there are no easy answers.\" Still, don't be unduly wary of floating point! The errors in Python float operations are inherited from the floating-point hardware, and on most machines are on the order of no more than 1 part in 2\\*\\*53 per operation. That's more than adequate for most tasks, but you do need to keep in mind that it's not decimal arithmetic and that every float operation can suffer a new rounding error." -msgstr "" +#, fuzzy +msgid "" +"As that says near the end, \"there are no easy answers.\" Still, don't be " +"unduly wary of floating point! The errors in Python float operations are " +"inherited from the floating-point hardware, and on most machines are on the " +"order of no more than 1 part in 2\\*\\*53 per operation. That's more than " +"adequate for most tasks, but you do need to keep in mind that it's not " +"decimal arithmetic and that every float operation can suffer a new rounding " +"error." +msgstr "" +"همانطور که نزدیک به پایان می گوید، \"هیچ پاسخ آسانی وجود ندارد.\" با این " +"حال، بی جهت نسبت به ممیز شناور محتاط نباشید! خطاها در عملیات شناور پایتون " +"از سخت افزار ممیز شناور به ارث برده می شوند و در اکثر ماشین ها به ترتیب بیش " +"از 1 قسمت در 2\\*\\*53 در هر عملیات نیست. این برای بیشتر کارها بیش از " +"اندازه کافی است، اما باید به خاطر داشته باشید که حساب اعشاری نیست و هر " +"عملیات شناور ممکن است با یک خطای گرد کردن جدید مواجه شود." #: tutorial/floatingpoint.rst:163 -msgid "While pathological cases do exist, for most casual use of floating-point arithmetic you'll see the result you expect in the end if you simply round the display of your final results to the number of decimal digits you expect. :func:`str` usually suffices, and for finer control see the :meth:`str.format` method's format specifiers in :ref:`formatstrings`." -msgstr "" +#, fuzzy +msgid "" +"While pathological cases do exist, for most casual use of floating-point " +"arithmetic you'll see the result you expect in the end if you simply round " +"the display of your final results to the number of decimal digits you " +"expect. :func:`str` usually suffices, and for finer control see the " +":meth:`str.format` method's format specifiers in :ref:`formatstrings`." +msgstr "" +"در حالی که موارد پاتولوژیک وجود دارد، برای اکثر استفاده‌های معمولی از " +"محاسبات ممیز شناور، اگر به سادگی نمایش نتایج نهایی خود را به تعداد ارقام " +"اعشاری مورد انتظارتان گرد کنید، در پایان نتیجه‌ای را خواهید دید که انتظار " +"دارید. :func:`str` معمولاً کافی است و برای کنترل دقیق تر، مشخص کننده های " +"قالب روش :meth:`str.format` را در :ref:`formatstrings` ببینید." #: tutorial/floatingpoint.rst:169 -msgid "For use cases which require exact decimal representation, try using the :mod:`decimal` module which implements decimal arithmetic suitable for accounting applications and high-precision applications." +#, fuzzy +msgid "" +"For use cases which require exact decimal representation, try using the " +":mod:`decimal` module which implements decimal arithmetic suitable for " +"accounting applications and high-precision applications." msgstr "" +"برای موارد استفاده که نیاز به نمایش اعشاری دقیق دارند، سعی کنید از ماژول " +":mod:`decimal` استفاده کنید که محاسبات اعشاری را مناسب برای برنامه های " +"حسابداری و برنامه های کاربردی با دقت بالا پیاده سازی می کند." #: tutorial/floatingpoint.rst:173 -msgid "Another form of exact arithmetic is supported by the :mod:`fractions` module which implements arithmetic based on rational numbers (so the numbers like 1/3 can be represented exactly)." +#, fuzzy +msgid "" +"Another form of exact arithmetic is supported by the :mod:`fractions` module" +" which implements arithmetic based on rational numbers (so the numbers like " +"1/3 can be represented exactly)." msgstr "" +"شکل دیگری از محاسبات دقیق توسط ماژول :mod:`fractions` پشتیبانی می شود که " +"محاسبات را بر اساس اعداد گویا پیاده سازی می کند (بنابراین اعدادی مانند 1/3 " +"را می توان دقیقاً نشان داد)." #: tutorial/floatingpoint.rst:177 -msgid "If you are a heavy user of floating-point operations you should take a look at the NumPy package and many other packages for mathematical and statistical operations supplied by the SciPy project. See ." +#, fuzzy +msgid "" +"If you are a heavy user of floating-point operations you should take a look " +"at the NumPy package and many other packages for mathematical and " +"statistical operations supplied by the SciPy project. See " +"." msgstr "" +"اگر کاربر سنگین عملیات ممیز شناور هستید، باید به بسته NumPy و بسیاری از بسته" +" های دیگر برای عملیات ریاضی و آماری ارائه شده توسط پروژه SciPy نگاهی " +"بیندازید. به مراجعه کنید." #: tutorial/floatingpoint.rst:181 -msgid "Python provides tools that may help on those rare occasions when you really *do* want to know the exact value of a float. The :meth:`float.as_integer_ratio` method expresses the value of a float as a fraction:" +#, fuzzy +msgid "" +"Python provides tools that may help on those rare occasions when you really " +"*do* want to know the exact value of a float. The " +":meth:`float.as_integer_ratio` method expresses the value of a float as a " +"fraction:" msgstr "" +"پایتون ابزارهایی را ارائه می دهد که ممکن است در موارد نادری که واقعاً *do* " +"می خواهید ارزش دقیق یک شناور را بدانید، به شما کمک می کند. روش " +":meth:`float.as_integer_ratio` مقدار یک شناور را به صورت کسری بیان می کند:" #: tutorial/floatingpoint.rst:186 -msgid ">>> x = 3.14159\n" +#, fuzzy +msgid "" +">>> x = 3.14159\n" ">>> x.as_integer_ratio()\n" "(3537115888337719, 1125899906842624)" msgstr "" +">>> x = 3.14159\n" +">>> x.as_integer_ratio()\n" +"(3537115888337719, 1125899906842624)" #: tutorial/floatingpoint.rst:192 -msgid "Since the ratio is exact, it can be used to losslessly recreate the original value:" +#, fuzzy +msgid "" +"Since the ratio is exact, it can be used to losslessly recreate the original" +" value:" msgstr "" +"از آنجایی که نسبت دقیق است، می توان از آن برای بازآفرینی بدون ضرر مقدار اصلی" +" استفاده کرد:" #: tutorial/floatingpoint.rst:195 -msgid ">>> x == 3537115888337719 / 1125899906842624\n" +#, fuzzy +msgid "" +">>> x == 3537115888337719 / 1125899906842624\n" "True" msgstr "" +">>> x == 3537115888337719 / 1125899906842624\n" +"True" #: tutorial/floatingpoint.rst:200 -msgid "The :meth:`float.hex` method expresses a float in hexadecimal (base 16), again giving the exact value stored by your computer:" +#, fuzzy +msgid "" +"The :meth:`float.hex` method expresses a float in hexadecimal (base 16), " +"again giving the exact value stored by your computer:" msgstr "" +"روش :meth:`float.hex` یک شناور در هگزادسیمال (پایه 16) را بیان می کند، که " +"مجدداً مقدار دقیق ذخیره شده توسط رایانه شما را نشان می دهد:" #: tutorial/floatingpoint.rst:203 -msgid ">>> x.hex()\n" +#, fuzzy +msgid "" +">>> x.hex()\n" "'0x1.921f9f01b866ep+1'" msgstr "" +">>> x.hex()\n" +"'0x1.921f9f01b866ep+1'" #: tutorial/floatingpoint.rst:208 -msgid "This precise hexadecimal representation can be used to reconstruct the float value exactly:" +#, fuzzy +msgid "" +"This precise hexadecimal representation can be used to reconstruct the float" +" value exactly:" msgstr "" +"این نمایش هگزادسیمال دقیق را می توان برای بازسازی مقدار شناور دقیقاً مورد " +"استفاده قرار داد:" #: tutorial/floatingpoint.rst:211 -msgid ">>> x == float.fromhex('0x1.921f9f01b866ep+1')\n" +#, fuzzy +msgid "" +">>> x == float.fromhex('0x1.921f9f01b866ep+1')\n" "True" msgstr "" +">>> x == float.fromhex('0x1.921f9f01b866ep+1')\n" +"True" #: tutorial/floatingpoint.rst:216 -msgid "Since the representation is exact, it is useful for reliably porting values across different versions of Python (platform independence) and exchanging data with other languages that support the same format (such as Java and C99)." +#, fuzzy +msgid "" +"Since the representation is exact, it is useful for reliably porting values " +"across different versions of Python (platform independence) and exchanging " +"data with other languages that support the same format (such as Java and " +"C99)." msgstr "" +"از آنجایی که نمایش دقیق است، برای انتقال مطمئن مقادیر در نسخه‌های مختلف " +"پایتون (استقلال پلتفرم) و تبادل داده با زبان‌های دیگری که از فرمت یکسانی " +"پشتیبانی می‌کنند (مانند جاوا و C99) مفید است." #: tutorial/floatingpoint.rst:220 -msgid "Another helpful tool is the :func:`sum` function which helps mitigate loss-of-precision during summation. It uses extended precision for intermediate rounding steps as values are added onto a running total. That can make a difference in overall accuracy so that the errors do not accumulate to the point where they affect the final total:" -msgstr "" +#, fuzzy +msgid "" +"Another helpful tool is the :func:`sum` function which helps mitigate loss-" +"of-precision during summation. It uses extended precision for intermediate " +"rounding steps as values are added onto a running total. That can make a " +"difference in overall accuracy so that the errors do not accumulate to the " +"point where they affect the final total:" +msgstr "" +"یکی دیگر از ابزارهای مفید تابع :func:`sum` است که به کاهش افت دقت در هنگام " +"جمع بندی کمک می کند. از دقت گسترده‌ای برای مراحل گرد کردن میانی استفاده " +"می‌کند، زیرا مقادیر به مجموع در حال اجرا اضافه می‌شوند. این می تواند در دقت " +"کلی تفاوت ایجاد کند به طوری که خطاها تا جایی جمع نمی شوند که بر کل نهایی " +"تأثیر بگذارند:" #: tutorial/floatingpoint.rst:226 -msgid ">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" +#, fuzzy +msgid "" +">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" "False\n" ">>> sum([0.1] * 10) == 1.0\n" "True" msgstr "" +">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" +"False\n" +">>> sum([0.1] * 10) == 1.0\n" +"True" #: tutorial/floatingpoint.rst:233 -msgid "The :func:`math.fsum` goes further and tracks all of the \"lost digits\" as values are added onto a running total so that the result has only a single rounding. This is slower than :func:`sum` but will be more accurate in uncommon cases where large magnitude inputs mostly cancel each other out leaving a final sum near zero:" -msgstr "" +#, fuzzy +msgid "" +"The :func:`math.fsum` goes further and tracks all of the \"lost digits\" as " +"values are added onto a running total so that the result has only a single " +"rounding. This is slower than :func:`sum` but will be more accurate in " +"uncommon cases where large magnitude inputs mostly cancel each other out " +"leaving a final sum near zero:" +msgstr "" +":func:`math.fsum` فراتر می رود و تمام «ارقام گمشده» را ردیابی می کند زیرا " +"مقادیر به مجموع در حال اجرا اضافه می شوند به طوری که نتیجه فقط یک گرد کردن " +"دارد. این سرعت کندتر از :func:`sum` است، اما در موارد غیرمعمول که ورودی‌های" +" قدر بزرگ عمدتاً یکدیگر را خنثی می‌کنند و جمع نهایی نزدیک به صفر می‌شوند، " +"دقیق‌تر خواهد بود:" #: tutorial/floatingpoint.rst:239 -msgid ">>> arr = [-0.10430216751806065, -266310978.67179024, 143401161448607.16,\n" +#, fuzzy +msgid "" +">>> arr = [-0.10430216751806065, -266310978.67179024, 143401161448607.16,\n" "... -143401161400469.7, 266262841.31058735, -0.003244936839808227]\n" ">>> float(sum(map(Fraction, arr))) # Exact summation with single rounding\n" "8.042173697819788e-13\n" @@ -250,116 +568,245 @@ msgid ">>> arr = [-0.10430216751806065, -266310978.67179024, 143401161448607.16, ">>> total # Straight addition has no correct digits!\n" "-0.0051575902860057365" msgstr "" +">>> arr = [-0.10430216751806065, -266310978.67179024, 143401161448607.16,\n" +"... -143401161400469.7, 266262841.31058735, -0.003244936839808227]\n" +">>> float(sum(map(Fraction, arr))) # Exact summation with single rounding\n" +"8.042173697819788e-13\n" +">>> math.fsum(arr) # Single rounding\n" +"8.042173697819788e-13\n" +">>> sum(arr) # Multiple roundings in extended precision\n" +"8.042178034628478e-13\n" +">>> total = 0.0\n" +">>> for x in arr:\n" +"... total += x # Multiple roundings in standard precision\n" +"...\n" +">>> total # Straight addition has no correct digits!\n" +"-0.0051575902860057365" #: tutorial/floatingpoint.rst:260 +#, fuzzy msgid "Representation Error" -msgstr "" +msgstr "خطای نمایش" #: tutorial/floatingpoint.rst:262 -msgid "This section explains the \"0.1\" example in detail, and shows how you can perform an exact analysis of cases like this yourself. Basic familiarity with binary floating-point representation is assumed." +#, fuzzy +msgid "" +"This section explains the \"0.1\" example in detail, and shows how you can " +"perform an exact analysis of cases like this yourself. Basic familiarity " +"with binary floating-point representation is assumed." msgstr "" +"این بخش مثال \"0.1\" را با جزئیات توضیح می دهد و نشان می دهد که چگونه می " +"توانید تجزیه و تحلیل دقیق مواردی مانند این را خودتان انجام دهید. آشنایی " +"اولیه با نمایش ممیز شناور باینری فرض شده است." #: tutorial/floatingpoint.rst:266 -msgid ":dfn:`Representation error` refers to the fact that some (most, actually) decimal fractions cannot be represented exactly as binary (base 2) fractions. This is the chief reason why Python (or Perl, C, C++, Java, Fortran, and many others) often won't display the exact decimal number you expect." +#, fuzzy +msgid "" +":dfn:`Representation error` refers to the fact that some (most, actually) " +"decimal fractions cannot be represented exactly as binary (base 2) " +"fractions. This is the chief reason why Python (or Perl, C, C++, Java, " +"Fortran, and many others) often won't display the exact decimal number you " +"expect." msgstr "" +":dfn: «خطای نمایش» به این واقعیت اشاره دارد که برخی (بیشترین, در واقع) " +"کسرهای اعشاری را نمی توان دقیقاً به صورت کسرهای باینری (مبنای 2) نشان داد. " +"این دلیل اصلی این است که چرا پایتون (یا Perl, C, C++, Java, Fortran و بسیاری" +" دیگر) اغلب عدد اعشاری دقیقی را که شما انتظار دارید نمایش نمی‌دهد." #: tutorial/floatingpoint.rst:271 -msgid "Why is that? 1/10 is not exactly representable as a binary fraction. Since at least 2000, almost all machines use IEEE 754 binary floating-point arithmetic, and almost all platforms map Python floats to IEEE 754 binary64 \"double precision\" values. IEEE 754 binary64 values contain 53 bits of precision, so on input the computer strives to convert 0.1 to the closest fraction it can of the form *J*/2**\\ *N* where *J* is an integer containing exactly 53 bits. Rewriting ::" -msgstr "" +#, fuzzy +msgid "" +"Why is that? 1/10 is not exactly representable as a binary fraction. Since" +" at least 2000, almost all machines use IEEE 754 binary floating-point " +"arithmetic, and almost all platforms map Python floats to IEEE 754 binary64 " +"\"double precision\" values. IEEE 754 binary64 values contain 53 bits of " +"precision, so on input the computer strives to convert 0.1 to the closest " +"fraction it can of the form *J*/2**\\ *N* where *J* is an integer containing" +" exactly 53 bits. Rewriting ::" +msgstr "" +"چرا اینطور است؟ 1/10 دقیقاً به عنوان یک کسر باینری قابل نمایش نیست. حداقل " +"از سال 2000، تقریباً همه ماشین‌ها از محاسبات ممیز شناور باینری IEEE 754 " +"استفاده می‌کنند و تقریباً همه پلتفرم‌ها شناورهای Python را به مقادیر «دقت " +"مضاعف» IEEE 754 باینری 64 نگاشت می‌کنند. مقادیر باینری 64 IEEE 754 حاوی 53 " +"بیت دقت است، بنابراین در ورودی کامپیوتر تلاش می کند تا 0.1 را به نزدیکترین " +"کسر تبدیل کند به شکل *J*/2**\\ *N* where *J* یک عدد صحیح حاوی دقیقاً 53 بیت " +"است. بازنویسی ::" #: tutorial/floatingpoint.rst:280 +#, fuzzy msgid "1 / 10 ~= J / (2**N)" -msgstr "" +msgstr "1/10 ~= J / (2**N)" #: tutorial/floatingpoint.rst:282 +#, fuzzy msgid "as ::" -msgstr "" +msgstr "به عنوان ::" #: tutorial/floatingpoint.rst:284 +#, fuzzy msgid "J ~= 2**N / 10" -msgstr "" +msgstr "J ~= 2**N / 10" #: tutorial/floatingpoint.rst:286 -msgid "and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< 2**53``), the best value for *N* is 56:" +#, fuzzy +msgid "" +"and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< " +"2**53``), the best value for *N* is 56:" msgstr "" +"و با یادآوری اینکه *J* دقیقاً 53 بیت دارد (``>= 2**52`` است اما ``< " +"2**53``), بهترین مقدار برای *N* 56 است:" #: tutorial/floatingpoint.rst:289 -msgid ">>> 2**52 <= 2**56 // 10 < 2**53\n" +#, fuzzy +msgid "" +">>> 2**52 <= 2**56 // 10 < 2**53\n" "True" msgstr "" +">>> 2**52 <= 2**56 // 10 < 2**53\n" +"True" #: tutorial/floatingpoint.rst:294 -msgid "That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. The best possible value for *J* is then that quotient rounded:" +#, fuzzy +msgid "" +"That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits." +" The best possible value for *J* is then that quotient rounded:" msgstr "" +"یعنی 56 تنها مقدار *N* است که دقیقاً 53 بیت برای *J* باقی می گذارد. بهترین " +"مقدار ممکن برای *J* این است که ضریب گرد شود:" #: tutorial/floatingpoint.rst:297 -msgid ">>> q, r = divmod(2**56, 10)\n" +#, fuzzy +msgid "" +">>> q, r = divmod(2**56, 10)\n" ">>> r\n" "6" msgstr "" +">>> q, r = divmod(2**56, 10)\n" +">>> r\n" +"6" #: tutorial/floatingpoint.rst:303 -msgid "Since the remainder is more than half of 10, the best approximation is obtained by rounding up:" +#, fuzzy +msgid "" +"Since the remainder is more than half of 10, the best approximation is " +"obtained by rounding up:" msgstr "" +"از آنجایی که باقیمانده بیش از نیمی از 10 است، بهترین تقریب با گرد کردن به " +"دست می آید:" #: tutorial/floatingpoint.rst:306 -msgid ">>> q+1\n" +#, fuzzy +msgid "" +">>> q+1\n" "7205759403792794" msgstr "" +">>> q+1\n" +"7205759403792794" #: tutorial/floatingpoint.rst:313 -msgid "Therefore the best possible approximation to 1/10 in IEEE 754 double precision is::" -msgstr "" +#, fuzzy +msgid "" +"Therefore the best possible approximation to 1/10 in IEEE 754 double " +"precision is::" +msgstr "بنابراین بهترین تقریب ممکن به 1/10 در IEEE 754 دقت دوگانه این است:" #: tutorial/floatingpoint.rst:316 +#, fuzzy msgid "7205759403792794 / 2 ** 56" -msgstr "" +msgstr "7205759403792794 / 2 ** 56" #: tutorial/floatingpoint.rst:318 -msgid "Dividing both the numerator and denominator by two reduces the fraction to::" -msgstr "" +#, fuzzy +msgid "" +"Dividing both the numerator and denominator by two reduces the fraction to::" +msgstr "تقسیم صورت و مخرج بر دو کسر را به:" #: tutorial/floatingpoint.rst:320 +#, fuzzy msgid "3602879701896397 / 2 ** 55" -msgstr "" +msgstr "3602879701896397 / 2 ** 55" #: tutorial/floatingpoint.rst:322 -msgid "Note that since we rounded up, this is actually a little bit larger than 1/10; if we had not rounded up, the quotient would have been a little bit smaller than 1/10. But in no case can it be *exactly* 1/10!" +#, fuzzy +msgid "" +"Note that since we rounded up, this is actually a little bit larger than " +"1/10; if we had not rounded up, the quotient would have been a little bit " +"smaller than 1/10. But in no case can it be *exactly* 1/10!" msgstr "" +"توجه داشته باشید که از آنجایی که ما گرد کردیم، این مقدار در واقع کمی بزرگتر " +"از 1/10 است. اگر به بالا گرد نمی کردیم، ضریب کمی کوچکتر از 1/10 بود. اما به" +" هیچ وجه نمی تواند *exactly* 1/10 باشد!" #: tutorial/floatingpoint.rst:326 -msgid "So the computer never \"sees\" 1/10: what it sees is the exact fraction given above, the best IEEE 754 double approximation it can get:" +#, fuzzy +msgid "" +"So the computer never \"sees\" 1/10: what it sees is the exact fraction " +"given above, the best IEEE 754 double approximation it can get:" msgstr "" +"بنابراین کامپیوتر هرگز 1/10 را \"نمی‌بیند\": چیزی که می‌بیند کسر دقیقی است " +"که در بالا داده شده است، بهترین تقریب IEEE 754 که می‌تواند به دست آورد:" #: tutorial/floatingpoint.rst:329 -msgid ">>> 0.1 * 2 ** 55\n" +#, fuzzy +msgid "" +">>> 0.1 * 2 ** 55\n" "3602879701896397.0" msgstr "" +">>> 0.1 * 2 ** 55\n" +"3602879701896397.0" #: tutorial/floatingpoint.rst:334 -msgid "If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 decimal digits:" +#, fuzzy +msgid "" +"If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 " +"decimal digits:" msgstr "" +"اگر آن کسر را در 10\\*\\*55 ضرب کنیم، می‌توانیم مقدار آن را تا 55 رقم اعشاری" +" ببینیم:" #: tutorial/floatingpoint.rst:337 -msgid ">>> 3602879701896397 * 10 ** 55 // 2 ** 55\n" +#, fuzzy +msgid "" +">>> 3602879701896397 * 10 ** 55 // 2 ** 55\n" "1000000000000000055511151231257827021181583404541015625" msgstr "" +">>> 3602879701896397 * 10 ** 55 // 2 ** 55\n" +"1000000000000000055511151231257827021181583404541015625" #: tutorial/floatingpoint.rst:342 -msgid "meaning that the exact number stored in the computer is equal to the decimal value 0.1000000000000000055511151231257827021181583404541015625. Instead of displaying the full decimal value, many languages (including older versions of Python), round the result to 17 significant digits:" +#, fuzzy +msgid "" +"meaning that the exact number stored in the computer is equal to the decimal" +" value 0.1000000000000000055511151231257827021181583404541015625. Instead of" +" displaying the full decimal value, many languages (including older versions" +" of Python), round the result to 17 significant digits:" msgstr "" +"به این معنی که عدد دقیق ذخیره شده در کامپیوتر برابر با مقدار اعشاری " +"0.100000000000000055511151231257827021181583404541015625 است. به جای نمایش " +"مقدار اعشاری کامل، بسیاری از زبان ها (از جمله نسخه های قدیمی پایتون), نتیجه " +"را به 17 رقم قابل توجه گرد می کنند:" #: tutorial/floatingpoint.rst:347 -msgid ">>> format(0.1, '.17f')\n" +#, fuzzy +msgid "" +">>> format(0.1, '.17f')\n" "'0.10000000000000001'" msgstr "" +">>> format(0.1, '.17f')\n" +"'0.10000000000000001'" #: tutorial/floatingpoint.rst:352 -msgid "The :mod:`fractions` and :mod:`decimal` modules make these calculations easy:" +#, fuzzy +msgid "" +"The :mod:`fractions` and :mod:`decimal` modules make these calculations " +"easy:" msgstr "" +"ماژول های :mod:`fractions` و :mod:`decimal` این محاسبات را آسان می کنند:" #: tutorial/floatingpoint.rst:355 -msgid ">>> from decimal import Decimal\n" +#, fuzzy +msgid "" +">>> from decimal import Decimal\n" ">>> from fractions import Fraction\n" "\n" ">>> Fraction.from_float(0.1)\n" @@ -374,3 +821,17 @@ msgid ">>> from decimal import Decimal\n" ">>> format(Decimal.from_float(0.1), '.17')\n" "'0.10000000000000001'" msgstr "" +">>> from decimal import Decimal\n" +">>> from fractions import Fraction\n" +"\n" +">>> Fraction.from_float(0.1)\n" +"Fraction(3602879701896397, 36028797018963968)\n" +"\n" +">>> (0.1).as_integer_ratio()\n" +"(3602879701896397, 36028797018963968)\n" +"\n" +">>> Decimal.from_float(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +"\n" +">>> format(Decimal.from_float(0.1), '.17')\n" +"'0.10000000000000001'" diff --git a/tutorial/index.po b/tutorial/index.po index 603e9770..92c88af7 100644 --- a/tutorial/index.po +++ b/tutorial/index.po @@ -17,33 +17,96 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/index.rst:5 +#, fuzzy msgid "The Python Tutorial" -msgstr "" +msgstr "آموزش پایتون" #: tutorial/index.rst:7 -msgid "Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python's elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms." +#, fuzzy +msgid "" +"Python is an easy to learn, powerful programming language. It has efficient " +"high-level data structures and a simple but effective approach to object-" +"oriented programming. Python's elegant syntax and dynamic typing, together " +"with its interpreted nature, make it an ideal language for scripting and " +"rapid application development in many areas on most platforms." msgstr "" +"پایتون یک زبان برنامه نویسی قدرتمند و آسان برای یادگیری است. دارای ساختارهای" +" داده ای کارآمد در سطح بالا و یک رویکرد ساده اما موثر برای برنامه نویسی شی " +"گرا. نحو زیبا و تایپ پویا پایتون، همراه با ماهیت تفسیری آن، آن را به زبانی " +"ایده آل برای اسکریپت نویسی و توسعه سریع برنامه در بسیاری از زمینه ها در اکثر" +" پلتفرم ها تبدیل کرده است." #: tutorial/index.rst:13 -msgid "The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python web site, https://www.python.org/, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation." +#, fuzzy +msgid "" +"The Python interpreter and the extensive standard library are freely " +"available in source or binary form for all major platforms from the Python " +"web site, https://www.python.org/, and may be freely distributed. The same " +"site also contains distributions of and pointers to many free third party " +"Python modules, programs and tools, and additional documentation." msgstr "" +"مفسر پایتون و کتابخانه استاندارد گسترده به صورت منبع یا باینری برای همه " +"پلتفرم‌های اصلی از وب‌سایت پایتون، https://www.python.org/ آزادانه در دسترس " +"هستند و ممکن است آزادانه توزیع شوند. همین سایت همچنین حاوی توزیع‌ها و " +"اشاره‌گرها به بسیاری از ماژول‌های شخص ثالث رایگان پایتون، برنامه‌ها و " +"ابزارها و اسناد اضافی است." #: tutorial/index.rst:19 -msgid "The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). Python is also suitable as an extension language for customizable applications." +#, fuzzy +msgid "" +"The Python interpreter is easily extended with new functions and data types " +"implemented in C or C++ (or other languages callable from C). Python is also" +" suitable as an extension language for customizable applications." msgstr "" +"مفسر پایتون به راحتی با توابع و انواع داده های جدید پیاده سازی شده در C یا " +"C++ (یا سایر زبان های قابل فراخوانی از C) گسترش می یابد. پایتون همچنین به " +"عنوان یک زبان افزونه برای برنامه های کاربردی قابل تنظیم مناسب است." #: tutorial/index.rst:23 -msgid "This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. It helps to have a Python interpreter handy for hands-on experience, but all examples are self-contained, so the tutorial can be read off-line as well." +#, fuzzy +msgid "" +"This tutorial introduces the reader informally to the basic concepts and " +"features of the Python language and system. It helps to have a Python " +"interpreter handy for hands-on experience, but all examples are self-" +"contained, so the tutorial can be read off-line as well." msgstr "" +"این آموزش خواننده را به صورت غیر رسمی با مفاهیم و ویژگی های اساسی زبان و " +"سیستم پایتون آشنا می کند. داشتن یک مفسر پایتون برای تجربه عملی کمک می کند، " +"اما همه نمونه ها مستقل هستند، بنابراین می توان آموزش را به صورت آفلاین نیز " +"خواند." #: tutorial/index.rst:28 -msgid "For a description of standard objects and modules, see :ref:`library-index`. :ref:`reference-index` gives a more formal definition of the language. To write extensions in C or C++, read :ref:`extending-index` and :ref:`c-api-index`. There are also several books covering Python in depth." +#, fuzzy +msgid "" +"For a description of standard objects and modules, see :ref:`library-index`." +" :ref:`reference-index` gives a more formal definition of the language. To " +"write extensions in C or C++, read :ref:`extending-index` and :ref:`c-api-" +"index`. There are also several books covering Python in depth." msgstr "" +"برای توضیح اشیاء و ماژول های استاندارد، به :ref:`library-index` مراجعه کنید." +" :ref:`reference-index` تعریف رسمی تری از زبان ارائه می دهد. برای نوشتن " +"برنامه های افزودنی در C یا C++، :ref:`extending-index` و :ref:`c-api-index` " +"را بخوانید. همچنین چندین کتاب وجود دارد که پایتون را به طور عمیق پوشش می " +"دهد." #: tutorial/index.rst:33 -msgid "This tutorial does not attempt to be comprehensive and cover every single feature, or even every commonly used feature. Instead, it introduces many of Python's most noteworthy features, and will give you a good idea of the language's flavor and style. After reading it, you will be able to read and write Python modules and programs, and you will be ready to learn more about the various Python library modules described in :ref:`library-index`." +#, fuzzy +msgid "" +"This tutorial does not attempt to be comprehensive and cover every single " +"feature, or even every commonly used feature. Instead, it introduces many of" +" Python's most noteworthy features, and will give you a good idea of the " +"language's flavor and style. After reading it, you will be able to read and " +"write Python modules and programs, and you will be ready to learn more about" +" the various Python library modules described in :ref:`library-index`." msgstr "" +"این آموزش سعی نمی‌کند جامع باشد و تک تک ویژگی‌ها یا حتی هر ویژگی معمولی را " +"پوشش دهد. در عوض، بسیاری از قابل توجه ترین ویژگی های پایتون را معرفی می کند " +"و به شما ایده خوبی از طعم و سبک زبان می دهد. پس از خواندن آن، می توانید " +"ماژول ها و برنامه های پایتون را بخوانید و بنویسید، و آماده خواهید بود تا در " +"مورد ماژول های مختلف کتابخانه Python که در :ref:`library-index` توضیح داده " +"شده است، اطلاعات بیشتری کسب کنید." #: tutorial/index.rst:40 +#, fuzzy msgid "The :ref:`glossary` is also worth going through." -msgstr "" +msgstr ":ref:`glossary` نیز ارزش دیدن را دارد." diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 11ef8900..ccf32166 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -17,70 +17,173 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/inputoutput.rst:5 +#, fuzzy msgid "Input and Output" -msgstr "" +msgstr "Input and Output" #: tutorial/inputoutput.rst:7 -msgid "There are several ways to present the output of a program; data can be printed in a human-readable form, or written to a file for future use. This chapter will discuss some of the possibilities." +#, fuzzy +msgid "" +"There are several ways to present the output of a program; data can be " +"printed in a human-readable form, or written to a file for future use. This " +"chapter will discuss some of the possibilities." msgstr "" +"راه های مختلفی برای ارائه خروجی یک برنامه وجود دارد. داده ها را می توان به " +"شکل قابل خواندن توسط انسان چاپ کرد یا برای استفاده در آینده در یک فایل نوشت." +" این فصل برخی از احتمالات را مورد بحث قرار خواهد داد." #: tutorial/inputoutput.rst:15 +#, fuzzy msgid "Fancier Output Formatting" -msgstr "" +msgstr "قالب بندی خروجی فانتزی" #: tutorial/inputoutput.rst:17 -msgid "So far we've encountered two ways of writing values: *expression statements* and the :func:`print` function. (A third way is using the :meth:`~io.TextIOBase.write` method of file objects; the standard output file can be referenced as ``sys.stdout``. See the Library Reference for more information on this.)" +#, fuzzy +msgid "" +"So far we've encountered two ways of writing values: *expression statements*" +" and the :func:`print` function. (A third way is using the " +":meth:`~io.TextIOBase.write` method of file objects; the standard output " +"file can be referenced as ``sys.stdout``. See the Library Reference for more" +" information on this.)" msgstr "" +"تا کنون با دو روش برای نوشتن مقادیر مواجه شده‌ایم: *expression statements* و" +" تابع :func:`print`. (روش سوم استفاده از روش :meth:`~io.TextIOBase.write` " +"برای اشیاء فایل است؛ فایل خروجی استاندارد را می توان به عنوان ``sys.stdout``" +" ارجاع داد. برای اطلاعات بیشتر در این مورد به مرجع کتابخانه مراجعه کنید.)" #: tutorial/inputoutput.rst:22 -msgid "Often you'll want more control over the formatting of your output than simply printing space-separated values. There are several ways to format output." +#, fuzzy +msgid "" +"Often you'll want more control over the formatting of your output than " +"simply printing space-separated values. There are several ways to format " +"output." msgstr "" +"اغلب شما می خواهید کنترل بیشتری بر قالب بندی خروجی خود داشته باشید تا صرفاً " +"چاپ مقادیر جدا شده از فضا. روش های مختلفی برای فرمت کردن خروجی وجود دارد." #: tutorial/inputoutput.rst:25 -msgid "To use :ref:`formatted string literals `, begin a string with ``f`` or ``F`` before the opening quotation mark or triple quotation mark. Inside this string, you can write a Python expression between ``{`` and ``}`` characters that can refer to variables or literal values." +#, fuzzy +msgid "" +"To use :ref:`formatted string literals `, begin a string with" +" ``f`` or ``F`` before the opening quotation mark or triple quotation mark. " +"Inside this string, you can write a Python expression between ``{`` and " +"``}`` characters that can refer to variables or literal values." msgstr "" +"برای استفاده از :ref:`formatted string literals `، یک رشته را" +" با ``f`` یا ``F`` قبل از گیومه آغازین یا علامت نقل قول سه گانه شروع کنید. " +"در داخل این رشته، می‌توانید یک عبارت پایتون بین کاراکترهای ``{`` و ``}`` " +"بنویسید که می‌تواند به متغیرها یا مقادیر واقعی اشاره کند." #: tutorial/inputoutput.rst:32 -msgid ">>> year = 2016\n" +#, fuzzy +msgid "" +">>> year = 2016\n" ">>> event = 'Referendum'\n" ">>> f'Results of the {year} {event}'\n" "'Results of the 2016 Referendum'" msgstr "" +">>> year = 2016\n" +">>> event = 'Referendum'\n" +">>> f'Results of the {year} {event}'\n" +"'Results of the 2016 Referendum'" #: tutorial/inputoutput.rst:37 -msgid "The :meth:`str.format` method of strings requires more manual effort. You'll still use ``{`` and ``}`` to mark where a variable will be substituted and can provide detailed formatting directives, but you'll also need to provide the information to be formatted. In the following code block there are two examples of how to format variables:" -msgstr "" +#, fuzzy +msgid "" +"The :meth:`str.format` method of strings requires more manual effort. " +"You'll still use ``{`` and ``}`` to mark where a variable will be " +"substituted and can provide detailed formatting directives, but you'll also " +"need to provide the information to be formatted. In the following code block" +" there are two examples of how to format variables:" +msgstr "" +"روش :meth:`str.format` رشته ها به تلاش دستی بیشتری نیاز دارد. شما همچنان از" +" ``{`` و ``}`` برای علامت‌گذاری جایی که متغیر جایگزین می‌شود و می‌تواند " +"دستورالعمل‌های قالب‌بندی دقیق را ارائه کند، استفاده می‌کنید، اما همچنین باید" +" اطلاعاتی را برای قالب‌بندی ارائه کنید. در بلوک کد زیر دو مثال از نحوه قالب " +"بندی متغیرها وجود دارد:" #: tutorial/inputoutput.rst:46 -msgid ">>> yes_votes = 42_572_654\n" +#, fuzzy +msgid "" +">>> yes_votes = 42_572_654\n" ">>> total_votes = 85_705_149\n" ">>> percentage = yes_votes / total_votes\n" ">>> '{:-9} YES votes {:2.2%}'.format(yes_votes, percentage)\n" "' 42572654 YES votes 49.67%'" msgstr "" +">>> yes_votes = 42_572_654\n" +">>> total_votes = 85_705_149\n" +">>> percentage = yes_votes / total_votes\n" +">>> '{:-9} YES votes {:2.2%}'.format(yes_votes, percentage)\n" +"' 42572654 YES votes 49.67%'" #: tutorial/inputoutput.rst:52 -msgid "Notice how the ``yes_votes`` are padded with spaces and a negative sign only for negative numbers. The example also prints ``percentage`` multiplied by 100, with 2 decimal places and followed by a percent sign (see :ref:`formatspec` for details)." +#, fuzzy +msgid "" +"Notice how the ``yes_votes`` are padded with spaces and a negative sign only" +" for negative numbers. The example also prints ``percentage`` multiplied by " +"100, with 2 decimal places and followed by a percent sign (see " +":ref:`formatspec` for details)." msgstr "" +"توجه کنید که چگونه ``yes_votes`` با فاصله و علامت منفی فقط برای اعداد منفی " +"پر شده است. این مثال همچنین ``percentage`` ضربدر 100، با 2 رقم اعشار و به " +"دنبال آن علامت درصد چاپ می کند (برای جزئیات به :ref:`formatspec` مراجعه " +"کنید)." #: tutorial/inputoutput.rst:57 -msgid "Finally, you can do all the string handling yourself by using string slicing and concatenation operations to create any layout you can imagine. The string type has some methods that perform useful operations for padding strings to a given column width." +#, fuzzy +msgid "" +"Finally, you can do all the string handling yourself by using string slicing" +" and concatenation operations to create any layout you can imagine. The " +"string type has some methods that perform useful operations for padding " +"strings to a given column width." msgstr "" +"در نهایت، می‌توانید با استفاده از عملیات برش و الحاق رشته‌ها برای ایجاد هر " +"طرحی که می‌توانید تصور کنید، تمام مدیریت رشته را خودتان انجام دهید. نوع " +"رشته دارای روش‌هایی است که عملیات مفیدی را برای قرار دادن رشته‌ها به عرض " +"ستون معین انجام می‌دهد." #: tutorial/inputoutput.rst:62 -msgid "When you don't need fancy output but just want a quick display of some variables for debugging purposes, you can convert any value to a string with the :func:`repr` or :func:`str` functions." +#, fuzzy +msgid "" +"When you don't need fancy output but just want a quick display of some " +"variables for debugging purposes, you can convert any value to a string with" +" the :func:`repr` or :func:`str` functions." msgstr "" +"هنگامی که به خروجی فانتزی نیاز ندارید اما فقط می خواهید یک نمایش سریع از " +"برخی متغیرها برای اهداف اشکال زدایی داشته باشید، می توانید هر مقداری را با " +"توابع :func:`repr` یا :func:`str` به رشته ای تبدیل کنید." #: tutorial/inputoutput.rst:66 -msgid "The :func:`str` function is meant to return representations of values which are fairly human-readable, while :func:`repr` is meant to generate representations which can be read by the interpreter (or will force a :exc:`SyntaxError` if there is no equivalent syntax). For objects which don't have a particular representation for human consumption, :func:`str` will return the same value as :func:`repr`. Many values, such as numbers or structures like lists and dictionaries, have the same representation using either function. Strings, in particular, have two distinct representations." -msgstr "" +#, fuzzy +msgid "" +"The :func:`str` function is meant to return representations of values which " +"are fairly human-readable, while :func:`repr` is meant to generate " +"representations which can be read by the interpreter (or will force a " +":exc:`SyntaxError` if there is no equivalent syntax). For objects which " +"don't have a particular representation for human consumption, :func:`str` " +"will return the same value as :func:`repr`. Many values, such as numbers or" +" structures like lists and dictionaries, have the same representation using " +"either function. Strings, in particular, have two distinct representations." +msgstr "" +"تابع :func:`str` برای برگرداندن نمایش‌هایی از مقادیری است که نسبتاً قابل " +"خواندن توسط انسان هستند، در حالی که :func:`repr` برای تولید نمایش‌هایی است " +"که می‌توانند توسط مفسر خوانده شوند (یا اگر دستوری معادل وجود نداشته باشد " +":exc:`SyntaxError` را مجبور می‌کند). برای اشیایی که نمایش خاصی برای مصرف " +"انسان ندارند، :func:`str` همان مقدار :func:`repr` را برمی‌گرداند. بسیاری از" +" مقادیر، مانند اعداد یا ساختارهایی مانند لیست ها و فرهنگ لغت ها، با استفاده " +"از هر یک از تابع ها نمایش یکسانی دارند. رشته ها، به ویژه، دو نمایش مجزا " +"دارند." #: tutorial/inputoutput.rst:75 +#, fuzzy msgid "Some examples::" -msgstr "" +msgstr "چند نمونه::" #: tutorial/inputoutput.rst:77 -msgid ">>> s = 'Hello, world.'\n" +#, fuzzy +msgid "" +">>> s = 'Hello, world.'\n" ">>> str(s)\n" "'Hello, world.'\n" ">>> repr(s)\n" @@ -101,35 +204,93 @@ msgid ">>> s = 'Hello, world.'\n" ">>> repr((x, y, ('spam', 'eggs')))\n" "\"(32.5, 40000, ('spam', 'eggs'))\"" msgstr "" +">>> s = 'سلام, دنیا.'\n" +">>> خیابان(ها)\n" +"\"سلام, دنیا.\"\n" +">>> نماینده(های)\n" +"\"\"سلام, دنیا.\"\n" +">>> خیابان (1/7)\n" +"'0.14285714285714285'\n" +">>> x = 10 * 3.25\n" +">>> y = 200 * 200\n" +">>> s = 'مقدار x ' + repr(x) + ' است و y ' + repr(y) + '...'\n" +">>> چاپ(های)\n" +"مقدار x 32.5 و y برابر 40000 است...\n" +">>> # repr() یک رشته نقل قول رشته و اسلش را اضافه می کند:\n" +">>> سلام = 'سلام, دنیا\\n'\n" +">>> سلام = پاسخ (سلام)\n" +">>> چاپ (سلام)\n" +"\"سلام, دنیا\\n\"\n" +">>> # آرگومان repr() ممکن است هر شی پایتون باشد:\n" +">>> repr((x, y, (\"هرزنامه\", \"تخم مرغ\")))\n" +"\"(32.5, 40000, (\"هرزنامه\", \"تخم مرغ\"))\"" #: tutorial/inputoutput.rst:98 -msgid "The :mod:`string` module contains a :class:`~string.Template` class that offers yet another way to substitute values into strings, using placeholders like ``$x`` and replacing them with values from a dictionary, but offers much less control of the formatting." +#, fuzzy +msgid "" +"The :mod:`string` module contains a :class:`~string.Template` class that " +"offers yet another way to substitute values into strings, using placeholders" +" like ``$x`` and replacing them with values from a dictionary, but offers " +"much less control of the formatting." msgstr "" +"ماژول :mod:`string` شامل یک کلاس :class:`~string.Template` است که راه دیگری " +"را برای جایگزینی مقادیر به رشته ها، با استفاده از متغیرهایی مانند ``$x`` و " +"جایگزینی آنها با مقادیر یک فرهنگ لغت ارائه می دهد، اما کنترل بسیار کمتری بر " +"قالب بندی ارائه می دهد." #: tutorial/inputoutput.rst:114 +#, fuzzy msgid "Formatted String Literals" -msgstr "" +msgstr "رشته های قالب بندی شده" #: tutorial/inputoutput.rst:116 -msgid ":ref:`Formatted string literals ` (also called f-strings for short) let you include the value of Python expressions inside a string by prefixing the string with ``f`` or ``F`` and writing expressions as ``{expression}``." +#, fuzzy +msgid "" +":ref:`Formatted string literals ` (also called f-strings for " +"short) let you include the value of Python expressions inside a string by " +"prefixing the string with ``f`` or ``F`` and writing expressions as " +"``{expression}``." msgstr "" +":ref:`Formatted string literals ` (که به اختصار رشته‌های f نیز " +"نامیده می‌شود) به شما امکان می‌دهد با پیشوند رشته با ``f`` یا ``F`` و نوشتن " +"عبارات به‌عنوان ``{expression}``، مقدار عبارات پایتون را در داخل یک رشته " +"قرار دهید." #: tutorial/inputoutput.rst:121 -msgid "An optional format specifier can follow the expression. This allows greater control over how the value is formatted. The following example rounds pi to three places after the decimal::" +#, fuzzy +msgid "" +"An optional format specifier can follow the expression. This allows greater " +"control over how the value is formatted. The following example rounds pi to " +"three places after the decimal::" msgstr "" +"یک مشخص کننده فرمت اختیاری می تواند عبارت را دنبال کند. این اجازه می دهد تا " +"کنترل بیشتری بر نحوه قالب بندی مقدار داشته باشید. مثال زیر پی را به سه مکان " +"بعد از اعشار گرد می کند:" #: tutorial/inputoutput.rst:125 -msgid ">>> import math\n" +#, fuzzy +msgid "" +">>> import math\n" ">>> print(f'The value of pi is approximately {math.pi:.3f}.')\n" "The value of pi is approximately 3.142." msgstr "" +">>> وارد کردن ریاضی\n" +">>> print(f'مقدار pi تقریباً {math.pi:.3f} است.')\n" +"مقدار pi تقریباً 3.142 است." #: tutorial/inputoutput.rst:129 -msgid "Passing an integer after the ``':'`` will cause that field to be a minimum number of characters wide. This is useful for making columns line up. ::" +#, fuzzy +msgid "" +"Passing an integer after the ``':'`` will cause that field to be a minimum " +"number of characters wide. This is useful for making columns line up. ::" msgstr "" +"عبور یک عدد صحیح بعد از ``':'`` باعث می شود که آن فیلد حداقل تعداد کاراکترها" +" را داشته باشد. این برای ایجاد ردیف ستون ها مفید است. ::" #: tutorial/inputoutput.rst:132 -msgid ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}\n" +#, fuzzy +msgid "" +">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}\n" ">>> for name, phone in table.items():\n" "... print(f'{name:10} ==> {phone:10d}')\n" "...\n" @@ -137,109 +298,224 @@ msgid ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}\n" "Jack ==> 4098\n" "Dcab ==> 7678" msgstr "" +">>> جدول = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}\n" +">>> برای نام, تلفن در table.items():\n" +"... چاپ (f'{name:10} ==> {phone:10d}')\n" +"...\n" +"Sjoerd ==> 4127\n" +"جک ==> 4098\n" +"Dcab ==> 7678" #: tutorial/inputoutput.rst:140 -msgid "Other modifiers can be used to convert the value before it is formatted. ``'!a'`` applies :func:`ascii`, ``'!s'`` applies :func:`str`, and ``'!r'`` applies :func:`repr`::" +#, fuzzy +msgid "" +"Other modifiers can be used to convert the value before it is formatted. " +"``'!a'`` applies :func:`ascii`, ``'!s'`` applies :func:`str`, and ``'!r'`` " +"applies :func:`repr`::" msgstr "" +"برای تبدیل مقدار قبل از قالب بندی می توان از اصلاح کننده های دیگر استفاده " +"کرد. ``'!a'`` :func:`ascii` را اعمال می کند، ``'!s'`` :func:`str` را اعمال " +"می کند و ``'!r'`` :func:`repr` را اعمال می کند::" #: tutorial/inputoutput.rst:144 -msgid ">>> animals = 'eels'\n" +#, fuzzy +msgid "" +">>> animals = 'eels'\n" ">>> print(f'My hovercraft is full of {animals}.')\n" "My hovercraft is full of eels.\n" ">>> print(f'My hovercraft is full of {animals!r}.')\n" "My hovercraft is full of 'eels'." msgstr "" +">>> حیوانات = 'مارماهی'\n" +">>> چاپ (f'Hovercraft من پر از {حیوانات} است.')\n" +"هاورکرافت من پر از مارماهی است.\n" +">>> چاپ (f'Hovercraft من پر از {حیوانات!r} است.')\n" +"هاورکرافت من پر از \"مارماهی\" است." #: tutorial/inputoutput.rst:150 -msgid "The ``=`` specifier can be used to expand an expression to the text of the expression, an equal sign, then the representation of the evaluated expression:" +#, fuzzy +msgid "" +"The ``=`` specifier can be used to expand an expression to the text of the " +"expression, an equal sign, then the representation of the evaluated " +"expression:" msgstr "" +"مشخص کننده ``=`` را می توان برای گسترش یک عبارت به متن عبارت، علامت مساوی و " +"سپس نمایش عبارت ارزیابی شده استفاده کرد:" #: tutorial/inputoutput.rst:159 -msgid "See :ref:`self-documenting expressions ` for more information on the ``=`` specifier. For a reference on these format specifications, see the reference guide for the :ref:`formatspec`." +#, fuzzy +msgid "" +"See :ref:`self-documenting expressions ` for more " +"information on the ``=`` specifier. For a reference on these format " +"specifications, see the reference guide for the :ref:`formatspec`." msgstr "" +"برای اطلاعات بیشتر در مورد مشخص کننده ``=`` به :ref:`self-documenting " +"expressions ` مراجعه کنید. برای مرجع در مورد این مشخصات " +"فرمت، راهنمای مرجع :ref:`formatspec` را ببینید." #: tutorial/inputoutput.rst:166 +#, fuzzy msgid "The String format() Method" -msgstr "" +msgstr "روش String format()." #: tutorial/inputoutput.rst:168 +#, fuzzy msgid "Basic usage of the :meth:`str.format` method looks like this::" -msgstr "" +msgstr "استفاده اصلی از روش :meth:`str.format` به این صورت است:" #: tutorial/inputoutput.rst:170 -msgid ">>> print('We are the {} who say \"{}!\"'.format('knights', 'Ni'))\n" +#, fuzzy +msgid "" +">>> print('We are the {} who say \"{}!\"'.format('knights', 'Ni'))\n" "We are the knights who say \"Ni!\"" msgstr "" +">>> print('ما {}هایی هستیم که می گوییم \"{}!\"'.format('knights', 'Ni'))\n" +"ما شوالیه هایی هستیم که می گوییم \"نی!\"" #: tutorial/inputoutput.rst:173 -msgid "The brackets and characters within them (called format fields) are replaced with the objects passed into the :meth:`str.format` method. A number in the brackets can be used to refer to the position of the object passed into the :meth:`str.format` method. ::" +#, fuzzy +msgid "" +"The brackets and characters within them (called format fields) are replaced " +"with the objects passed into the :meth:`str.format` method. A number in the" +" brackets can be used to refer to the position of the object passed into the" +" :meth:`str.format` method. ::" msgstr "" +"براکت ها و کاراکترهای درون آنها (که فیلدهای قالب نامیده می شوند) با اشیاء " +"ارسال شده به روش :meth:`str.format` جایگزین می شوند. می توان از یک عدد در " +"براکت ها برای اشاره به موقعیت شیء ارسال شده به روش :meth:`str.format` " +"استفاده کرد. ::" #: tutorial/inputoutput.rst:178 -msgid ">>> print('{0} and {1}'.format('spam', 'eggs'))\n" +#, fuzzy +msgid "" +">>> print('{0} and {1}'.format('spam', 'eggs'))\n" "spam and eggs\n" ">>> print('{1} and {0}'.format('spam', 'eggs'))\n" "eggs and spam" msgstr "" +">>> print('{0} and {1}'.format('spam', 'eggs'))\n" +"spam and eggs\n" +">>> print('{1} and {0}'.format('spam', 'eggs'))\n" +"eggs and spam" #: tutorial/inputoutput.rst:183 -msgid "If keyword arguments are used in the :meth:`str.format` method, their values are referred to by using the name of the argument. ::" +#, fuzzy +msgid "" +"If keyword arguments are used in the :meth:`str.format` method, their values" +" are referred to by using the name of the argument. ::" msgstr "" +"اگر از آرگومان های کلیدواژه در روش :meth:`str.format` استفاده شود، مقادیر " +"آنها با استفاده از نام آرگومان ارجاع داده می شود. ::" #: tutorial/inputoutput.rst:186 -msgid ">>> print('This {food} is {adjective}.'.format(\n" +#, fuzzy +msgid "" +">>> print('This {food} is {adjective}.'.format(\n" "... food='spam', adjective='absolutely horrible'))\n" "This spam is absolutely horrible." msgstr "" +">>> print('This {food} {adjective} است.'.format(\n" +"... غذا='spam', صفت='بسیار وحشتناک'))\n" +"این هرزنامه کاملا وحشتناک است." #: tutorial/inputoutput.rst:190 +#, fuzzy msgid "Positional and keyword arguments can be arbitrarily combined::" msgstr "" +"آرگومان های موقعیت و کلمه کلیدی را می توان به صورت دلخواه با هم ترکیب کرد:" #: tutorial/inputoutput.rst:192 -msgid ">>> print('The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred',\n" +#, fuzzy +msgid "" +">>> print('The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred',\n" "... other='Georg'))\n" "The story of Bill, Manfred, and Georg." msgstr "" +">>> print('The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred',\n" +"... other='Georg'))\n" +"داستان بیل، مانفرد و جورج." #: tutorial/inputoutput.rst:196 -msgid "If you have a really long format string that you don't want to split up, it would be nice if you could reference the variables to be formatted by name instead of by position. This can be done by simply passing the dict and using square brackets ``'[]'`` to access the keys. ::" +#, fuzzy +msgid "" +"If you have a really long format string that you don't want to split up, it " +"would be nice if you could reference the variables to be formatted by name " +"instead of by position. This can be done by simply passing the dict and " +"using square brackets ``'[]'`` to access the keys. ::" msgstr "" +"اگر رشته‌ای با فرمت بسیار طولانی دارید که نمی‌خواهید آن را از هم جدا کنید، " +"خوب است اگر بتوانید به متغیرها اشاره کنید که با نام قالب‌بندی شوند به جای " +"موقعیت. این کار را می توان با عبور دادن دستور و استفاده از براکت های مربع " +"``'[]'`` برای دسترسی به کلیدها انجام داد. ::" #: tutorial/inputoutput.rst:201 -msgid ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" +#, fuzzy +msgid "" +">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" ">>> print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '\n" "... 'Dcab: {0[Dcab]:d}'.format(table))\n" "Jack: 4098; Sjoerd: 4127; Dcab: 8637678" msgstr "" +">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" +">>> print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '\n" +"... 'Dcab: {0[Dcab]:d}'.format(table))\n" +"Jack: 4098; Sjoerd: 4127; Dcab: 8637678" #: tutorial/inputoutput.rst:206 -msgid "This could also be done by passing the ``table`` dictionary as keyword arguments with the ``**`` notation. ::" +#, fuzzy +msgid "" +"This could also be done by passing the ``table`` dictionary as keyword " +"arguments with the ``**`` notation. ::" msgstr "" +"این را می توان با ارسال فرهنگ لغت ``table`` به عنوان آرگومان های کلیدواژه با" +" نماد ``**`` نیز انجام داد. ::" #: tutorial/inputoutput.rst:209 -msgid ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" +#, fuzzy +msgid "" +">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" ">>> print('Jack: {Jack:d}; Sjoerd: {Sjoerd:d}; Dcab: {Dcab:d}'.format(**table))\n" "Jack: 4098; Sjoerd: 4127; Dcab: 8637678" msgstr "" +">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" +">>> print('Jack: {Jack:d}; Sjoerd: {Sjoerd:d}; Dcab: {Dcab:d}'.format(**table))\n" +"Jack: 4098; Sjoerd: 4127; Dcab: 8637678" #: tutorial/inputoutput.rst:213 -msgid "This is particularly useful in combination with the built-in function :func:`vars`, which returns a dictionary containing all local variables::" +#, fuzzy +msgid "" +"This is particularly useful in combination with the built-in function " +":func:`vars`, which returns a dictionary containing all local variables::" msgstr "" +"این به ویژه در ترکیب با تابع داخلی :func:`vars` مفید است، که یک فرهنگ لغت " +"حاوی تمام متغیرهای محلی را برمی گرداند:" #: tutorial/inputoutput.rst:216 -msgid ">>> table = {k: str(v) for k, v in vars().items()}\n" +#, fuzzy +msgid "" +">>> table = {k: str(v) for k, v in vars().items()}\n" ">>> message = \" \".join([f'{k}: ' + '{' + k +'};' for k in table.keys()])\n" ">>> print(message.format(**table))\n" "__name__: __main__; __doc__: None; __package__: None; __loader__: ..." msgstr "" +">>> table = {k: str(v) for k, v in vars().items()}\n" +">>> message = \" \".join([f'{k}: ' + '{' + k +'};' for k in table.keys()])\n" +">>> print(message.format(**table))\n" +"__name__: __main__; __doc__: None; __package__: None; __loader__: ..." #: tutorial/inputoutput.rst:221 -msgid "As an example, the following lines produce a tidily aligned set of columns giving integers and their squares and cubes::" +#, fuzzy +msgid "" +"As an example, the following lines produce a tidily aligned set of columns " +"giving integers and their squares and cubes::" msgstr "" +"به عنوان مثال، خطوط زیر مجموعه ای منظم از ستون ها را ایجاد می کند که اعداد " +"صحیح و مربع ها و مکعب های آنها را ارائه می دهد:" #: tutorial/inputoutput.rst:224 -msgid ">>> for x in range(1, 11):\n" +#, fuzzy +msgid "" +">>> for x in range(1, 11):\n" "... print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x))\n" "...\n" " 1 1 1\n" @@ -253,21 +529,43 @@ msgid ">>> for x in range(1, 11):\n" " 9 81 729\n" "10 100 1000" msgstr "" +">>> برای x در محدوده (1, 11):\n" +"... print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x))\n" +"...\n" +" 1 1 1\n" +" 2 4 8\n" +" 3 9 27\n" +" 4 16 64\n" +" 5 25 125\n" +" 6 36 216\n" +" 7 49 343\n" +" 8 64 512\n" +" 9 81 729\n" +"10 100 1000" #: tutorial/inputoutput.rst:238 -msgid "For a complete overview of string formatting with :meth:`str.format`, see :ref:`formatstrings`." +#, fuzzy +msgid "" +"For a complete overview of string formatting with :meth:`str.format`, see " +":ref:`formatstrings`." msgstr "" +"برای یک نمای کلی از قالب بندی رشته با :meth:`str.format`، به " +":ref:`formatstrings` مراجعه کنید." #: tutorial/inputoutput.rst:243 +#, fuzzy msgid "Manual String Formatting" -msgstr "" +msgstr "قالب بندی رشته های دستی" #: tutorial/inputoutput.rst:245 +#, fuzzy msgid "Here's the same table of squares and cubes, formatted manually::" -msgstr "" +msgstr "در اینجا همان جدول مربع و مکعب است که به صورت دستی فرمت شده است:" #: tutorial/inputoutput.rst:247 -msgid ">>> for x in range(1, 11):\n" +#, fuzzy +msgid "" +">>> for x in range(1, 11):\n" "... print(repr(x).rjust(2), repr(x*x).rjust(3), end=' ')\n" "... # Note use of 'end' on previous line\n" "... print(repr(x*x*x).rjust(4))\n" @@ -283,181 +581,464 @@ msgid ">>> for x in range(1, 11):\n" " 9 81 729\n" "10 100 1000" msgstr "" +">>> برای x در محدوده (1, 11):\n" +"... print(repr(x).rjust(2), repr(x*x).rjust(3), end=' ')\n" +"... # Note use of 'end' on previous line\n" +"... print(repr(x*x*x).rjust(4))\n" +"...\n" +" 1 1 1\n" +" 2 4 8\n" +" 3 9 27\n" +" 4 16 64\n" +" 5 25 125\n" +" 6 36 216\n" +" 7 49 343\n" +" 8 64 512\n" +" 9 81 729\n" +"10 100 1000" #: tutorial/inputoutput.rst:263 -msgid "(Note that the one space between each column was added by the way :func:`print` works: it always adds spaces between its arguments.)" +#, fuzzy +msgid "" +"(Note that the one space between each column was added by the way " +":func:`print` works: it always adds spaces between its arguments.)" msgstr "" +"(توجه داشته باشید که یک فاصله بین هر ستون با روش کار :func:`print` اضافه شده" +" است: همیشه بین آرگومان های خود فاصله اضافه می کند.)" #: tutorial/inputoutput.rst:266 -msgid "The :meth:`str.rjust` method of string objects right-justifies a string in a field of a given width by padding it with spaces on the left. There are similar methods :meth:`str.ljust` and :meth:`str.center`. These methods do not write anything, they just return a new string. If the input string is too long, they don't truncate it, but return it unchanged; this will mess up your column lay-out but that's usually better than the alternative, which would be lying about a value. (If you really want truncation you can always add a slice operation, as in ``x.ljust(n)[:n]``.)" -msgstr "" +#, fuzzy +msgid "" +"The :meth:`str.rjust` method of string objects right-justifies a string in a" +" field of a given width by padding it with spaces on the left. There are " +"similar methods :meth:`str.ljust` and :meth:`str.center`. These methods do " +"not write anything, they just return a new string. If the input string is " +"too long, they don't truncate it, but return it unchanged; this will mess up" +" your column lay-out but that's usually better than the alternative, which " +"would be lying about a value. (If you really want truncation you can always " +"add a slice operation, as in ``x.ljust(n)[:n]``.)" +msgstr "" +"روش :meth:`str.rjust` برای اشیاء رشته‌ای، رشته‌ای را در یک میدان با عرض معین" +" با پر کردن آن با فاصله‌های سمت چپ توجیه می‌کند. روش های مشابه " +":meth:`str.ljust` و :meth:`str.center` وجود دارد. این متدها چیزی نمی نویسند،" +" فقط یک رشته جدید برمی گردانند. اگر رشته ورودی خیلی طولانی باشد، آن را کوتاه" +" نمی‌کنند، بلکه آن را بدون تغییر برمی‌گردانند. این طرح بندی ستون شما را به " +"هم می زند، اما معمولاً بهتر از گزینه جایگزین است که در مورد یک مقدار دروغ می" +" گوید. (اگر واقعاً می‌خواهید کوتاه‌سازی کنید, همیشه می‌توانید عملیات برش را " +"مانند ``x.ljust(n)[:n]`` اضافه کنید.)" #: tutorial/inputoutput.rst:275 -msgid "There is another method, :meth:`str.zfill`, which pads a numeric string on the left with zeros. It understands about plus and minus signs::" +#, fuzzy +msgid "" +"There is another method, :meth:`str.zfill`, which pads a numeric string on " +"the left with zeros. It understands about plus and minus signs::" msgstr "" +"روش دیگری به نام :meth:`str.zfill` وجود دارد که یک رشته عددی را در سمت چپ با" +" صفر قرار می دهد. علائم مثبت و منفی را درک می کند:" #: tutorial/inputoutput.rst:278 -msgid ">>> '12'.zfill(5)\n" +#, fuzzy +msgid "" +">>> '12'.zfill(5)\n" "'00012'\n" ">>> '-3.14'.zfill(7)\n" "'-003.14'\n" ">>> '3.14159265359'.zfill(5)\n" "'3.14159265359'" msgstr "" +">>> '12'.zfill(5)\n" +"'00012'\n" +">>> '-3.14'.zfill(7)\n" +"'-003.14'\n" +">>> '3.14159265359'.zfill(5)\n" +"'3.14159265359'" #: tutorial/inputoutput.rst:287 +#, fuzzy msgid "Old string formatting" -msgstr "" +msgstr "قالب بندی رشته های قدیمی" #: tutorial/inputoutput.rst:289 -msgid "The % operator (modulo) can also be used for string formatting. Given ``format % values`` (where *format* is a string), ``%`` conversion specifications in *format* are replaced with zero or more elements of *values*. This operation is commonly known as string interpolation. For example::" +#, fuzzy +msgid "" +"The % operator (modulo) can also be used for string formatting. Given " +"``format % values`` (where *format* is a string), ``%`` conversion " +"specifications in *format* are replaced with zero or more elements of " +"*values*. This operation is commonly known as string interpolation. For " +"example::" msgstr "" +"عملگر % (modulo) همچنین می تواند برای قالب بندی رشته استفاده شود. با توجه به" +" ``format % values`` (که در آن *format* یک رشته است), مشخصات تبدیل ``%`` در " +"*format* با عناصر صفر یا بیشتر از *values* جایگزین می شود. این عملیات " +"معمولاً به عنوان درون یابی رشته ای شناخته می شود. به عنوان مثال::" #: tutorial/inputoutput.rst:296 -msgid ">>> import math\n" +#, fuzzy +msgid "" +">>> import math\n" ">>> print('The value of pi is approximately %5.3f.' % math.pi)\n" "The value of pi is approximately 3.142." msgstr "" +">>> وارد کردن ریاضی\n" +">>> print('مقدار pi تقریباً %5.3f است.' % math.pi)\n" +"مقدار pi تقریباً 3.142 است." #: tutorial/inputoutput.rst:300 -msgid "More information can be found in the :ref:`old-string-formatting` section." +#, fuzzy +msgid "" +"More information can be found in the :ref:`old-string-formatting` section." msgstr "" +"اطلاعات بیشتر را می توانید در بخش :ref:`old-string-formatting` بیابید." #: tutorial/inputoutput.rst:306 +#, fuzzy msgid "Reading and Writing Files" -msgstr "" +msgstr "خواندن و نوشتن فایل ها" #: tutorial/inputoutput.rst:312 -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)``" +#, fuzzy +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)``" #: tutorial/inputoutput.rst:318 +#, fuzzy msgid ">>> f = open('workfile', 'w', encoding=\"utf-8\")" -msgstr "" +msgstr ">>> f = open('workfile', 'w', encoding=\"utf-8\")" #: tutorial/inputoutput.rst:325 -msgid "The first argument is a string containing the filename. The second argument is another string containing a few characters describing the way in which the file will be used. *mode* can be ``'r'`` when the file will only be read, ``'w'`` for only writing (an existing file with the same name will be erased), and ``'a'`` opens the file for appending; any data written to the file is automatically added to the end. ``'r+'`` opens the file for both reading and writing. The *mode* argument is optional; ``'r'`` will be assumed if it's omitted." -msgstr "" +#, fuzzy +msgid "" +"The first argument is a string containing the filename. The second argument" +" is another string containing a few characters describing the way in which " +"the file will be used. *mode* can be ``'r'`` when the file will only be " +"read, ``'w'`` for only writing (an existing file with the same name will be " +"erased), and ``'a'`` opens the file for appending; any data written to the " +"file is automatically added to the end. ``'r+'`` opens the file for both " +"reading and writing. The *mode* argument is optional; ``'r'`` will be " +"assumed if it's omitted." +msgstr "" +"آرگومان اول رشته ای است که نام فایل را در خود دارد. آرگومان دوم رشته دیگری " +"است که حاوی چند کاراکتر است که نحوه استفاده از فایل را توصیف می کند. *mode*" +" می تواند ``'r'`` باشد زمانی که فایل فقط خوانده شود، ``'w'`` فقط برای نوشتن " +"(فایل موجود با همین نام پاک می شود) و ``'a'`` فایل را برای الحاق باز می کند." +" هر داده ای که در فایل نوشته شده است به طور خودکار به انتها اضافه می شود. " +"``'r+'`` فایل را برای خواندن و نوشتن باز می کند. آرگومان *mode* اختیاری است." +" در صورت حذف ``'r'`` فرض می شود." #: tutorial/inputoutput.rst:334 -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 "" +#, fuzzy +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:`حالت باینری` " +"باز می‌شود. داده‌های حالت باینری به صورت اشیاء :class:`bytes` خوانده و " +"نوشته می‌شوند. هنگام باز کردن فایل در حالت باینری نمی‌توانید *encoding* را " +"مشخص کنید." #: tutorial/inputoutput.rst:344 -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 "" +#, fuzzy +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` را خراب " +"می کند. هنگام خواندن و نوشتن چنین فایل هایی بسیار مراقب باشید که از حالت " +"باینری استفاده کنید." #: tutorial/inputoutput.rst:352 -msgid "It is good practice to use the :keyword:`with` keyword when dealing with file objects. The advantage is that the file is properly closed after its suite finishes, even if an exception is raised at some point. Using :keyword:`!with` is also much shorter than writing equivalent :keyword:`try`\\ -\\ :keyword:`finally` blocks::" +#, fuzzy +msgid "" +"It is good practice to use the :keyword:`with` keyword when dealing with " +"file objects. The advantage is that the file is properly closed after its " +"suite finishes, even if an exception is raised at some point. Using " +":keyword:`!with` is also much shorter than writing equivalent " +":keyword:`try`\\ -\\ :keyword:`finally` blocks::" msgstr "" +"استفاده از کلمه کلیدی :keyword:`with` هنگام برخورد با اشیاء فایل تمرین خوبی " +"است. مزیت این است که فایل پس از اتمام مجموعه به درستی بسته می شود، حتی اگر " +"در نقطه ای استثنا مطرح شود. استفاده از :keyword:`!with` نیز بسیار کوتاهتر " +"از نوشتن بلوک های معادل :keyword:`try`\\ -\\ :keyword:`finally` است::" #: tutorial/inputoutput.rst:358 -msgid ">>> with open('workfile', encoding=\"utf-8\") as f:\n" +#, fuzzy +msgid "" +">>> with open('workfile', encoding=\"utf-8\") as f:\n" "... read_data = f.read()\n" "\n" ">>> # We can check that the file has been automatically closed.\n" ">>> f.closed\n" "True" msgstr "" +">>> with open('workfile', encoding=\"utf-8\") as f:\n" +"... read_data = f.read()\n" +"\n" +">>> # We can check that the file has been automatically closed.\n" +">>> f.closed\n" +"True" #: tutorial/inputoutput.rst:365 -msgid "If you're not using the :keyword:`with` keyword, then you should call ``f.close()`` to close the file and immediately free up any system resources used by it." +#, fuzzy +msgid "" +"If you're not using the :keyword:`with` keyword, then you should call " +"``f.close()`` to close the file and immediately free up any system resources" +" used by it." msgstr "" +"اگر از کلمه کلیدی :keyword:`with` استفاده نمی کنید، باید با ``f.close()`` " +"تماس بگیرید تا فایل را ببندید و فوراً منابع سیستمی که توسط آن استفاده می شود" +" آزاد کنید." #: tutorial/inputoutput.rst:370 -msgid "Calling ``f.write()`` without using the :keyword:`!with` keyword or calling ``f.close()`` **might** result in the arguments of ``f.write()`` not being completely written to the disk, even if the program exits successfully." +#, fuzzy +msgid "" +"Calling ``f.write()`` without using the :keyword:`!with` keyword or calling " +"``f.close()`` **might** result in the arguments of ``f.write()`` not being " +"completely written to the disk, even if the program exits successfully." msgstr "" +"فراخوانی ``f.write()`` بدون استفاده از کلمه کلیدی :keyword:`!with` یا " +"فراخوانی ``f.close()`` **might** باعث می شود که آرگومان های ``f.write()`` به" +" طور کامل روی دیسک نوشته نشود، حتی اگر برنامه با موفقیت خارج شود." #: tutorial/inputoutput.rst:378 -msgid "After a file object is closed, either by a :keyword:`with` statement or by calling ``f.close()``, attempts to use the file object will automatically fail. ::" +#, fuzzy +msgid "" +"After a file object is closed, either by a :keyword:`with` statement or by " +"calling ``f.close()``, attempts to use the file object will automatically " +"fail. ::" msgstr "" +"پس از بسته شدن یک شی فایل، یا با دستور :keyword:`with` یا با فراخوانی " +"``f.close()``، تلاش برای استفاده از شی فایل به طور خودکار شکست خواهد خورد. " +"::" #: tutorial/inputoutput.rst:382 -msgid ">>> f.close()\n" +#, fuzzy +msgid "" +">>> f.close()\n" ">>> f.read()\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "ValueError: I/O operation on closed file." msgstr "" +">>> f.close()\n" +">>> f.read()\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"ValueError: عملیات I/O روی فایل بسته." #: tutorial/inputoutput.rst:392 +#, fuzzy msgid "Methods of File Objects" -msgstr "" +msgstr "روش های فایل اشیاء" #: tutorial/inputoutput.rst:394 -msgid "The rest of the examples in this section will assume that a file object called ``f`` has already been created." +#, fuzzy +msgid "" +"The rest of the examples in this section will assume that a file object " +"called ``f`` has already been created." msgstr "" +"بقیه مثال های این بخش فرض می کنند که یک شی فایل به نام ``f`` قبلا ایجاد شده " +"است." #: tutorial/inputoutput.rst:397 -msgid "To read a file's contents, call ``f.read(size)``, which reads some quantity of data and returns it as a string (in text mode) or bytes object (in binary mode). *size* is an optional numeric argument. When *size* is omitted or negative, the entire contents of the file will be read and returned; it's your problem if the file is twice as large as your machine's memory. Otherwise, at most *size* characters (in text mode) or *size* bytes (in binary mode) are read and returned. If the end of the file has been reached, ``f.read()`` will return an empty string (``''``). ::" -msgstr "" +#, fuzzy +msgid "" +"To read a file's contents, call ``f.read(size)``, which reads some quantity " +"of data and returns it as a string (in text mode) or bytes object (in binary" +" mode). *size* is an optional numeric argument. When *size* is omitted or " +"negative, the entire contents of the file will be read and returned; it's " +"your problem if the file is twice as large as your machine's memory. " +"Otherwise, at most *size* characters (in text mode) or *size* bytes (in " +"binary mode) are read and returned. If the end of the file has been reached," +" ``f.read()`` will return an empty string (``''``). ::" +msgstr "" +"برای خواندن محتویات یک فایل، با ``f.read(size)`` تماس بگیرید، که مقداری از " +"داده را می خواند و آن را به صورت رشته (در حالت متنی) یا شی بایت (در حالت " +"باینری) برمی گرداند. *size* یک آرگومان عددی اختیاری است. هنگامی که *size* " +"حذف یا منفی باشد، کل محتویات فایل خوانده شده و برگردانده می شود. اگر حجم " +"فایل دو برابر حافظه دستگاه شما باشد، مشکل شماست. در غیر این صورت، حداکثر " +"کاراکترهای *size* (در حالت متنی) یا *size* بایت (در حالت باینری) خوانده و " +"برگردانده می شوند. اگر به پایان فایل رسیده باشد، ``f.read()`` یک رشته خالی " +"(``''``) برمی گرداند. ::" #: tutorial/inputoutput.rst:406 -msgid ">>> f.read()\n" +#, fuzzy +msgid "" +">>> f.read()\n" "'This is the entire file.\\n'\n" ">>> f.read()\n" "''" msgstr "" +">>> f.read()\n" +"'This is the entire file.\\n'\n" +">>> f.read()\n" +"''" #: tutorial/inputoutput.rst:411 -msgid "``f.readline()`` reads a single line from the file; a newline character (``\\n``) is left at the end of the string, and is only omitted on the last line of the file if the file doesn't end in a newline. This makes the return value unambiguous; if ``f.readline()`` returns an empty string, the end of the file has been reached, while a blank line is represented by ``'\\n'``, a string containing only a single newline. ::" -msgstr "" +#, fuzzy +msgid "" +"``f.readline()`` reads a single line from the file; a newline character " +"(``\\n``) is left at the end of the string, and is only omitted on the last " +"line of the file if the file doesn't end in a newline. This makes the " +"return value unambiguous; if ``f.readline()`` returns an empty string, the " +"end of the file has been reached, while a blank line is represented by " +"``'\\n'``, a string containing only a single newline. ::" +msgstr "" +"``f.readline()`` یک خط از فایل را می خواند. یک کاراکتر خط جدید (``\\n``) در " +"انتهای رشته باقی می‌ماند و تنها در صورتی که فایل به خط جدید ختم نشود، در " +"آخرین خط فایل حذف می‌شود. این باعث می شود مقدار بازگشتی مبهم باشد. اگر " +"``f.readline()`` یک رشته خالی را برگرداند، به انتهای فایل رسیده است، در حالی" +" که یک خط خالی با ``'\\n'`` نشان داده می شود، رشته ای که فقط یک خط جدید " +"دارد. ::" #: tutorial/inputoutput.rst:418 -msgid ">>> f.readline()\n" +#, fuzzy +msgid "" +">>> f.readline()\n" "'This is the first line of the file.\\n'\n" ">>> f.readline()\n" "'Second line of the file\\n'\n" ">>> f.readline()\n" "''" msgstr "" +">>> f.readline()\n" +"'This is the first line of the file.\\n'\n" +">>> f.readline()\n" +"'Second line of the file\\n'\n" +">>> f.readline()\n" +"''" #: tutorial/inputoutput.rst:425 -msgid "For reading lines from a file, you can loop over the file object. This is memory efficient, fast, and leads to simple code::" +#, fuzzy +msgid "" +"For reading lines from a file, you can loop over the file object. This is " +"memory efficient, fast, and leads to simple code::" msgstr "" +"برای خواندن خطوط از یک فایل، می توانید روی شی فایل حلقه بزنید. این حافظه " +"کارآمد، سریع است و منجر به کدهای ساده می شود:" #: tutorial/inputoutput.rst:428 -msgid ">>> for line in f:\n" +#, fuzzy +msgid "" +">>> for line in f:\n" "... print(line, end='')\n" "...\n" "This is the first line of the file.\n" "Second line of the file" msgstr "" +">>> برای خط در f:\n" +"... چاپ (خط, پایان='')\n" +"...\n" +"این خط اول فایل است.\n" +"خط دوم فایل" #: tutorial/inputoutput.rst:434 -msgid "If you want to read all the lines of a file in a list you can also use ``list(f)`` or ``f.readlines()``." +#, fuzzy +msgid "" +"If you want to read all the lines of a file in a list you can also use " +"``list(f)`` or ``f.readlines()``." msgstr "" +"اگر می خواهید تمام خطوط یک فایل را در یک لیست بخوانید، می توانید از " +"``list(f)`` یا ``f.readlines()`` نیز استفاده کنید." #: tutorial/inputoutput.rst:437 -msgid "``f.write(string)`` writes the contents of *string* to the file, returning the number of characters written. ::" +#, fuzzy +msgid "" +"``f.write(string)`` writes the contents of *string* to the file, returning " +"the number of characters written. ::" msgstr "" +"``f.write(string)`` محتویات *string* را در فایل می نویسد و تعداد کاراکترهای " +"نوشته شده را برمی گرداند. ::" #: tutorial/inputoutput.rst:440 -msgid ">>> f.write('This is a test\\n')\n" +#, fuzzy +msgid "" +">>> f.write('This is a test\\n')\n" "15" msgstr "" +">>> f.write('This is a test\\n')\n" +"15" #: tutorial/inputoutput.rst:443 -msgid "Other types of objects need to be converted -- either to a string (in text mode) or a bytes object (in binary mode) -- before writing them::" +#, fuzzy +msgid "" +"Other types of objects need to be converted -- either to a string (in text " +"mode) or a bytes object (in binary mode) -- before writing them::" msgstr "" +"انواع دیگر اشیاء باید قبل از نوشتن آنها تبدیل شوند - یا به یک رشته (در حالت " +"متنی) یا یک شی بایت (در حالت باینری) -" #: tutorial/inputoutput.rst:446 -msgid ">>> value = ('the answer', 42)\n" +#, fuzzy +msgid "" +">>> value = ('the answer', 42)\n" ">>> s = str(value) # convert the tuple to string\n" ">>> f.write(s)\n" "18" msgstr "" +">>> value = ('the answer', 42)\n" +">>> s = str(value) # convert the tuple to string\n" +">>> f.write(s)\n" +"18" #: tutorial/inputoutput.rst:451 -msgid "``f.tell()`` returns an integer giving the file object's current position in the file represented as number of bytes from the beginning of the file when in binary mode and an opaque number when in text mode." +#, fuzzy +msgid "" +"``f.tell()`` returns an integer giving the file object's current position in" +" the file represented as number of bytes from the beginning of the file when" +" in binary mode and an opaque number when in text mode." msgstr "" +"``f.tell()`` یک عدد صحیح را برمی گرداند که موقعیت فعلی شی فایل را در فایل " +"نشان می دهد که به صورت تعداد بایت از ابتدای فایل در حالت باینری و یک عدد مات" +" در حالت متنی نمایش داده می شود." #: tutorial/inputoutput.rst:455 -msgid "To change the file object's position, use ``f.seek(offset, whence)``. The position is computed from adding *offset* to a reference point; the reference point is selected by the *whence* argument. A *whence* value of 0 measures from the beginning of the file, 1 uses the current file position, and 2 uses the end of the file as the reference point. *whence* can be omitted and defaults to 0, using the beginning of the file as the reference point. ::" -msgstr "" +#, fuzzy +msgid "" +"To change the file object's position, use ``f.seek(offset, whence)``. The " +"position is computed from adding *offset* to a reference point; the " +"reference point is selected by the *whence* argument. A *whence* value of 0" +" measures from the beginning of the file, 1 uses the current file position, " +"and 2 uses the end of the file as the reference point. *whence* can be " +"omitted and defaults to 0, using the beginning of the file as the reference " +"point. ::" +msgstr "" +"برای تغییر موقعیت شی فایل، از ``f.seek(offset, whence)`` استفاده کنید. " +"موقعیت از اضافه کردن *offset* به یک نقطه مرجع محاسبه می شود. نقطه مرجع توسط " +"آرگومان *whence* انتخاب می شود. مقدار *whence* 0 از ابتدای فایل اندازه گیری" +" می شود، 1 از موقعیت فعلی فایل استفاده می کند، و 2 از انتهای فایل به عنوان " +"نقطه مرجع استفاده می کند. *whence* را می توان حذف کرد و با استفاده از " +"ابتدای فایل به عنوان نقطه مرجع، 0 را پیش فرض قرار داد. ::" #: tutorial/inputoutput.rst:462 -msgid ">>> f = open('workfile', 'rb+')\n" +#, fuzzy +msgid "" +">>> f = open('workfile', 'rb+')\n" ">>> f.write(b'0123456789abcdef')\n" "16\n" ">>> f.seek(5) # Go to the 6th byte in the file\n" @@ -469,122 +1050,259 @@ msgid ">>> f = open('workfile', 'rb+')\n" ">>> f.read(1)\n" "b'd'" msgstr "" +">>> f = open('workfile', 'rb+')\n" +">>> f.write(b'0123456789abcdef')\n" +"16\n" +">>> f.seek(5) # Go to the 6th byte in the file\n" +"5\n" +">>> f.read(1)\n" +"b'5'\n" +">>> f.seek(-3, 2) # Go to the 3rd byte before the end\n" +"13\n" +">>> f.read(1)\n" +"b'd'" #: tutorial/inputoutput.rst:474 -msgid "In text files (those opened without a ``b`` in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with ``seek(0, 2)``) and the only valid *offset* values are those returned from the ``f.tell()``, or zero. Any other *offset* value produces undefined behaviour." -msgstr "" +#, fuzzy +msgid "" +"In text files (those opened without a ``b`` in the mode string), only seeks " +"relative to the beginning of the file are allowed (the exception being " +"seeking to the very file end with ``seek(0, 2)``) and the only valid " +"*offset* values are those returned from the ``f.tell()``, or zero. Any other" +" *offset* value produces undefined behaviour." +msgstr "" +"در فایل‌های متنی (آنهایی که بدون ``b`` در رشته حالت باز می‌شوند), فقط " +"جستجوهای مربوط به ابتدای فایل مجاز هستند (به استثنای جستجو تا انتهای فایل با" +" ``seek(0, 2)``) و تنها مقادیر معتبر *offset* آنهایی هستند که از " +"``f.tell()`` یا صفر برگردانده می‌شوند. هر مقدار دیگر *offset* رفتار نامشخصی " +"ایجاد می کند." #: tutorial/inputoutput.rst:480 -msgid "File objects have some additional methods, such as :meth:`~io.IOBase.isatty` and :meth:`~io.IOBase.truncate` which are less frequently used; consult the Library Reference for a complete guide to file objects." +#, fuzzy +msgid "" +"File objects have some additional methods, such as :meth:`~io.IOBase.isatty`" +" and :meth:`~io.IOBase.truncate` which are less frequently used; consult the" +" Library Reference for a complete guide to file objects." msgstr "" +"اشیاء فایل دارای چند روش اضافی هستند، مانند :meth:`~io.IOBase.isatty` و " +":meth:`~io.IOBase.truncate` که کمتر مورد استفاده قرار می گیرند. برای " +"راهنمایی کامل برای اشیاء فایل به مرجع کتابخانه مراجعه کنید." #: tutorial/inputoutput.rst:488 +#, fuzzy msgid "Saving structured data with :mod:`json`" -msgstr "" +msgstr "ذخیره داده های ساخت یافته با :mod:`json`" #: tutorial/inputoutput.rst:492 -msgid "Strings can easily be written to and read from a file. Numbers take a bit more effort, since the :meth:`~io.TextIOBase.read` method only returns strings, which will have to be passed to a function like :func:`int`, which takes a string like ``'123'`` and returns its numeric value 123. When you want to save more complex data types like nested lists and dictionaries, parsing and serializing by hand becomes complicated." -msgstr "" +#, fuzzy +msgid "" +"Strings can easily be written to and read from a file. Numbers take a bit " +"more effort, since the :meth:`~io.TextIOBase.read` method only returns " +"strings, which will have to be passed to a function like :func:`int`, which " +"takes a string like ``'123'`` and returns its numeric value 123. When you " +"want to save more complex data types like nested lists and dictionaries, " +"parsing and serializing by hand becomes complicated." +msgstr "" +"رشته ها را می توان به راحتی در یک فایل نوشت و از آن خواند. اعداد کمی تلاش " +"بیشتری می‌برند، زیرا روش :meth:`~io.TextIOBase.read` فقط رشته‌ها را " +"برمی‌گرداند، که باید به تابعی مانند :func:`int` منتقل شوند، که رشته‌ای مانند" +" ``'123'`` را می‌گیرد و مقدار عددی آن را 123 برمی‌گرداند. وقتی می‌خواهید " +"انواع داده‌های پیچیده‌تری مانند فهرست‌های تودرتو و فرهنگ‌های لغت را ذخیره " +"کنید، تجزیه و سریال‌سازی با دست انجام می‌شود." #: tutorial/inputoutput.rst:499 -msgid "Rather than having users constantly writing and debugging code to save complicated data types to files, Python allows you to use the popular data interchange format called `JSON (JavaScript Object Notation) `_. The standard module called :mod:`json` can take Python data hierarchies, and convert them to string representations; this process is called :dfn:`serializing`. Reconstructing the data from the string representation is called :dfn:`deserializing`. Between serializing and deserializing, the string representing the object may have been stored in a file or data, or sent over a network connection to some distant machine." -msgstr "" +#, fuzzy +msgid "" +"Rather than having users constantly writing and debugging code to save " +"complicated data types to files, Python allows you to use the popular data " +"interchange format called `JSON (JavaScript Object Notation) " +"`_. The standard module called :mod:`json` can take " +"Python data hierarchies, and convert them to string representations; this " +"process is called :dfn:`serializing`. Reconstructing the data from the " +"string representation is called :dfn:`deserializing`. Between serializing " +"and deserializing, the string representing the object may have been stored " +"in a file or data, or sent over a network connection to some distant " +"machine." +msgstr "" +"پایتون به جای اینکه کاربران دائماً کد می نویسند و اشکال زدایی می کنند تا " +"انواع داده های پیچیده را در فایل ها ذخیره کنند، به شما امکان می دهد از فرمت " +"تبادل داده محبوب به نام `JSON (JavaScript Object Notation) " +"`_ استفاده کنید. ماژول استاندارد به نام :mod:`json` می " +"تواند سلسله مراتب داده پایتون را بگیرد و آنها را به نمایش رشته تبدیل کند. " +"این فرآیند :dfn:`serializing` نامیده می شود. بازسازی داده ها از نمایش رشته " +":dfn:`deserializing` نامیده می شود. بین سریال‌سازی و سریال‌زدایی، رشته‌ای " +"که شی را نشان می‌دهد ممکن است در یک فایل یا داده ذخیره شده باشد یا از طریق " +"یک اتصال شبکه به ماشینی دور ارسال شده باشد." #: tutorial/inputoutput.rst:510 -msgid "The JSON format is commonly used by modern applications to allow for data exchange. Many programmers are already familiar with it, which makes it a good choice for interoperability." +#, fuzzy +msgid "" +"The JSON format is commonly used by modern applications to allow for data " +"exchange. Many programmers are already familiar with it, which makes it a " +"good choice for interoperability." msgstr "" +"فرمت JSON معمولاً توسط برنامه های مدرن استفاده می شود تا امکان تبادل داده ها" +" را فراهم کند. بسیاری از برنامه نویسان در حال حاضر با آن آشنا هستند، که آن " +"را به گزینه خوبی برای قابلیت همکاری تبدیل می کند." #: tutorial/inputoutput.rst:514 -msgid "If you have an object ``x``, you can view its JSON string representation with a simple line of code::" +#, fuzzy +msgid "" +"If you have an object ``x``, you can view its JSON string representation " +"with a simple line of code::" msgstr "" +"اگر یک شی ``x`` دارید، می توانید نمایش رشته JSON آن را با یک خط کد ساده " +"مشاهده کنید:" #: tutorial/inputoutput.rst:517 -msgid ">>> import json\n" +#, fuzzy +msgid "" +">>> import json\n" ">>> x = [1, 'simple', 'list']\n" ">>> json.dumps(x)\n" "'[1, \"simple\", \"list\"]'" msgstr "" +">>> import json\n" +">>> x = [1, 'simple', 'list']\n" +">>> json.dumps(x)\n" +"'[1, \"simple\", \"list\"]'" #: tutorial/inputoutput.rst:522 -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::" +#, fuzzy +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` است که برای نوشتن باز شده است، می توانیم این کار را انجام " +"دهیم:" #: tutorial/inputoutput.rst:526 +#, fuzzy msgid "json.dump(x, f)" -msgstr "" +msgstr "json.dump(x, f)" #: tutorial/inputoutput.rst:528 -msgid "To decode the object again, if ``f`` is a :term:`binary file` or :term:`text file` object which has been opened for reading::" +#, fuzzy +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` باشد که برای خواندن باز شده است:" #: tutorial/inputoutput.rst:531 +#, fuzzy msgid "x = json.load(f)" -msgstr "" +msgstr "x = json.load(f)" #: tutorial/inputoutput.rst:534 -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." +#, fuzzy +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\"`` استفاده " +"کنید." #: tutorial/inputoutput.rst:537 -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." +#, fuzzy +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` توضیحی در این باره دارد." #: tutorial/inputoutput.rst:543 +#, fuzzy msgid ":mod:`pickle` - the pickle module" -msgstr "" +msgstr ":mod:`pickle` - ماژول ترشی" #: tutorial/inputoutput.rst:545 -msgid "Contrary to :ref:`JSON `, *pickle* is a protocol which allows the serialization of arbitrarily complex Python objects. As such, it is specific to Python and cannot be used to communicate with applications written in other languages. It is also insecure by default: deserializing pickle data coming from an untrusted source can execute arbitrary code, if the data was crafted by a skilled attacker." -msgstr "" +#, fuzzy +msgid "" +"Contrary to :ref:`JSON `, *pickle* is a protocol which allows the " +"serialization of arbitrarily complex Python objects. As such, it is " +"specific to Python and cannot be used to communicate with applications " +"written in other languages. It is also insecure by default: deserializing " +"pickle data coming from an untrusted source can execute arbitrary code, if " +"the data was crafted by a skilled attacker." +msgstr "" +"برخلاف :ref:`JSON `، *pickle* پروتکلی است که امکان سریال سازی " +"اشیاء پیچیده پایتون را می دهد. به این ترتیب، مخصوص پایتون است و نمی توان از" +" آن برای برقراری ارتباط با برنامه هایی که به زبان های دیگر نوشته شده اند " +"استفاده کرد. همچنین به‌طور پیش‌فرض ناامن است: اگر داده‌ها توسط یک مهاجم " +"ماهر ساخته شده باشند، داده‌های ترشی که از منبع نامعتبر به دست می‌آیند " +"می‌توانند کد دلخواه را اجرا کنند." #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "formatted string literal" -msgstr "" +msgstr "رشته فرمت شده به معنای واقعی کلمه" #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "interpolated string literal" -msgstr "" +msgstr "رشته درونیابی شده تحت اللفظی" #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "string" -msgstr "" +msgstr "رشته" #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "formatted literal" -msgstr "" +msgstr "فرمت شده تحت اللفظی" #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "interpolated literal" -msgstr "" +msgstr "تحت اللفظی درون یابی شده" #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "f-string" -msgstr "" +msgstr "رشته f" #: tutorial/inputoutput.rst:103 +#, fuzzy msgid "fstring" -msgstr "" +msgstr "fstring" #: tutorial/inputoutput.rst:308 +#, fuzzy msgid "built-in function" -msgstr "" +msgstr "عملکرد داخلی" #: tutorial/inputoutput.rst:308 +#, fuzzy msgid "open" -msgstr "" +msgstr "باز کردن" #: tutorial/inputoutput.rst:308 +#, fuzzy msgid "object" -msgstr "" +msgstr "شی" #: tutorial/inputoutput.rst:308 +#, fuzzy msgid "file" -msgstr "" +msgstr "فایل" #: tutorial/inputoutput.rst:490 +#, fuzzy msgid "module" -msgstr "" +msgstr "ماژول" #: tutorial/inputoutput.rst:490 +#, fuzzy msgid "json" -msgstr "" +msgstr "json" diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 224c9c3a..e9434f7a 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -17,29 +17,88 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/interactive.rst:5 +#, fuzzy msgid "Interactive Input Editing and History Substitution" -msgstr "" +msgstr "ویرایش تعاملی ورودی و جایگزینی تاریخچه" #: tutorial/interactive.rst:7 -msgid "Some versions of the Python interpreter support editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. This is implemented using the `GNU Readline`_ library, which supports various styles of editing. This library has its own documentation which we won't duplicate here." +#, fuzzy +msgid "" +"Some versions of the Python interpreter support editing of the current input" +" line and history substitution, similar to facilities found in the Korn " +"shell and the GNU Bash shell. This is implemented using the `GNU Readline`_" +" library, which supports various styles of editing. This library has its " +"own documentation which we won't duplicate here." msgstr "" +"برخی از نسخه‌های مفسر پایتون از ویرایش خط ورودی فعلی و جایگزینی تاریخچه " +"پشتیبانی می‌کنند، مشابه امکانات موجود در پوسته Korn و پوسته Bash GNU. این " +"با استفاده از کتابخانه `GNU Readline`_، که از سبک های مختلف ویرایش پشتیبانی " +"می کند، پیاده سازی می شود. این کتابخانه مستندات خاص خود را دارد که ما در " +"اینجا کپی نمی کنیم." #: tutorial/interactive.rst:17 +#, fuzzy msgid "Tab Completion and History Editing" -msgstr "" +msgstr "تکمیل برگه و ویرایش تاریخچه" #: tutorial/interactive.rst:19 -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." +#, fuzzy +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:`automatically " +"enabled ` است به طوری که کلید :kbd:`Tab` تابع تکمیل را " +"فراخوانی می کند. به نام دستورات پایتون، متغیرهای محلی فعلی و نام ماژول های " +"موجود نگاه می کند. برای عبارات نقطه‌دار مانند ``string.a``، عبارت را تا " +"``'.'`` نهایی ارزیابی می‌کند و سپس تکمیل‌هایی را از ویژگی‌های شی حاصل " +"پیشنهاد می‌کند. توجه داشته باشید که اگر یک شی با متد " +":meth:`~object.__getattr__` بخشی از عبارت باشد، ممکن است کد تعریف شده توسط " +"برنامه را اجرا کند. پیکربندی پیش فرض همچنین تاریخچه شما را در فایلی به نام " +":file:`.python_history` در فهرست کاربری شما ذخیره می کند. تاریخچه در جلسه " +"بعدی مترجم تعاملی دوباره در دسترس خواهد بود." #: tutorial/interactive.rst:36 +#, fuzzy msgid "Alternatives to the Interactive Interpreter" -msgstr "" +msgstr "جایگزین های مترجم تعاملی" #: tutorial/interactive.rst:38 -msgid "This facility is an enormous step forward compared to earlier versions of the interpreter; however, some wishes are left: It would be nice if the proper indentation were suggested on continuation lines (the parser knows if an indent token is required next). The completion mechanism might use the interpreter's symbol table. A command to check (or even suggest) matching parentheses, quotes, etc., would also be useful." +#, fuzzy +msgid "" +"This facility is an enormous step forward compared to earlier versions of " +"the interpreter; however, some wishes are left: It would be nice if the " +"proper indentation were suggested on continuation lines (the parser knows if" +" an indent token is required next). The completion mechanism might use the " +"interpreter's symbol table. A command to check (or even suggest) matching " +"parentheses, quotes, etc., would also be useful." msgstr "" +"این تسهیلات در مقایسه با نسخه های قبلی مفسر یک گام بزرگ به جلو است. با این " +"حال، برخی از آرزوها باقی مانده است: خوب است اگر تورفتگی مناسب در خطوط ادامه " +"پیشنهاد شود (تجزیه کننده می داند که آیا یک نشانه تورفتگی در مرحله بعد مورد " +"نیاز است). مکانیسم تکمیل ممکن است از جدول نمادهای مفسر استفاده کند. دستوری" +" برای بررسی (یا حتی پیشنهاد) مطابق با پرانتزها، نقل قول ها و غیره نیز مفید " +"خواهد بود." #: tutorial/interactive.rst:45 -msgid "One alternative enhanced interactive interpreter that has been around for quite some time is IPython_, which features tab completion, object exploration and advanced history management. It can also be thoroughly customized and embedded into other applications. Another similar enhanced interactive environment is bpython_." +#, fuzzy +msgid "" +"One alternative enhanced interactive interpreter that has been around for " +"quite some time is IPython_, which features tab completion, object " +"exploration and advanced history management. It can also be thoroughly " +"customized and embedded into other applications. Another similar enhanced " +"interactive environment is bpython_." msgstr "" +"یکی از مفسرهای تعاملی پیشرفته جایگزین که برای مدتی طولانی وجود داشته است، " +"IPython_ است که شامل تکمیل برگه، کاوش شی و مدیریت پیشرفته تاریخچه است. " +"همچنین می توان آن را به طور کامل سفارشی کرد و در برنامه های دیگر جاسازی کرد." +" یکی دیگر از محیط های تعاملی پیشرفته مشابه bpython_ است." diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index efdcf0e9..bec39c3d 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -17,142 +17,348 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/interpreter.rst:5 +#, fuzzy msgid "Using the Python Interpreter" -msgstr "" +msgstr "با استفاده از مترجم پایتون" #: tutorial/interpreter.rst:11 +#, fuzzy msgid "Invoking the Interpreter" -msgstr "" +msgstr "استناد به مترجم" #: tutorial/interpreter.rst:13 -msgid "The Python interpreter is usually installed as |usr_local_bin_python_x_dot_y_literal| on those machines where it is available; putting :file:`/usr/local/bin` in your Unix shell's search path makes it possible to start it by typing the command:" +#, fuzzy +msgid "" +"The Python interpreter is usually installed as " +"|usr_local_bin_python_x_dot_y_literal| on those machines where it is " +"available; putting :file:`/usr/local/bin` in your Unix shell's search path " +"makes it possible to start it by typing the command:" msgstr "" +"مفسر پایتون معمولاً به صورت |usr_local_bin_python_x_dot_y_literal| در ماشین " +"هایی که در دسترس است؛ قرار دادن :file:`/usr/local/bin` در مسیر جستجوی پوسته " +"یونیکس، شروع آن را با تایپ دستور ممکن می سازد:" #: tutorial/interpreter.rst:17 +#, fuzzy msgid "python3.13" -msgstr "" +msgstr "پایتون 3.13" #: tutorial/interpreter.rst:21 -msgid "to the shell. [#]_ Since the choice of the directory where the interpreter lives is an installation option, other places are possible; check with your local Python guru or system administrator. (E.g., :file:`/usr/local/python` is a popular alternative location.)" +#, fuzzy +msgid "" +"to the shell. [#]_ Since the choice of the directory where the interpreter " +"lives is an installation option, other places are possible; check with your " +"local Python guru or system administrator. (E.g., :file:`/usr/local/python`" +" is a popular alternative location.)" msgstr "" +"به پوسته [#]_ از آنجایی که انتخاب دایرکتوری که مفسر در آن زندگی می کند یک " +"گزینه نصب است، مکان های دیگری امکان پذیر است. با گورو محلی پایتون یا مدیر " +"سیستم خود تماس بگیرید. (به عنوان مثال, :file:`/usr/local/python` یک مکان " +"جایگزین محبوب است.)" #: tutorial/interpreter.rst:26 -msgid "On Windows machines where you have installed Python from the :ref:`Microsoft Store `, the |python_x_dot_y_literal| command will be available. If you have the :ref:`py.exe launcher ` installed, you can use the :file:`py` command. See :ref:`setting-envvars` for other ways to launch Python." -msgstr "" +#, fuzzy +msgid "" +"On Windows machines where you have installed Python from the :ref:`Microsoft" +" Store `, the |python_x_dot_y_literal| command will be " +"available. If you have the :ref:`py.exe launcher ` installed, you " +"can use the :file:`py` command. See :ref:`setting-envvars` for other ways to" +" launch Python." +msgstr "" +"در ماشین های ویندوزی که پایتون را از :ref:`Microsoft Store ` " +"نصب کرده اید، |python_x_dot_y_literal| فرمان در دسترس خواهد بود. اگر " +":ref:`py.exe launcher ` را نصب کرده اید، می توانید از دستور " +":file:`py` استفاده کنید. برای راه‌اندازی پایتون به :ref:`setting-envvars` " +"مراجعه کنید." #: tutorial/interpreter.rst:31 -msgid "Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` on Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn't work, you can exit the interpreter by typing the following command: ``quit()``." +#, fuzzy +msgid "" +"Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` " +"on Windows) at the primary prompt causes the interpreter to exit with a zero" +" exit status. If that doesn't work, you can exit the interpreter by typing " +"the following command: ``quit()``." msgstr "" +"تایپ یک کاراکتر انتهای فایل (:kbd:`Control-D` در یونیکس, :kbd:`Control-Z` در" +" ویندوز) در اعلان اولیه باعث می شود که مفسر با وضعیت خروج صفر خارج شود. اگر" +" کار نکرد، می توانید با تایپ دستور زیر از مفسر خارج شوید: ``quit()``." #: tutorial/interpreter.rst:36 -msgid "The interpreter's line-editing features include interactive editing, history substitution and code completion on systems that support the `GNU Readline `_ library. Perhaps the quickest check to see whether command line editing is supported is typing :kbd:`Control-P` to the first Python prompt you get. If it beeps, you have command line editing; see Appendix :ref:`tut-interacting` for an introduction to the keys. If nothing appears to happen, or if ``^P`` is echoed, command line editing isn't available; you'll only be able to use backspace to remove characters from the current line." -msgstr "" +#, fuzzy +msgid "" +"The interpreter's line-editing features include interactive editing, history" +" substitution and code completion on systems that support the `GNU Readline " +"`_ library. Perhaps " +"the quickest check to see whether command line editing is supported is " +"typing :kbd:`Control-P` to the first Python prompt you get. If it beeps, " +"you have command line editing; see Appendix :ref:`tut-interacting` for an " +"introduction to the keys. If nothing appears to happen, or if ``^P`` is " +"echoed, command line editing isn't available; you'll only be able to use " +"backspace to remove characters from the current line." +msgstr "" +"ویژگی‌های ویرایش خط مفسر شامل ویرایش تعاملی، جایگزینی تاریخچه و تکمیل کد در " +"سیستم‌هایی است که از کتابخانه `GNU Readline " +"`_ پشتیبانی می‌کنند. " +"شاید سریع‌ترین بررسی برای اینکه ببینید آیا ویرایش خط فرمان پشتیبانی می‌شود، " +"تایپ :kbd:`Control-P` در اولین اعلان پایتون باشد. اگر بوق می‌دهد، ویرایش خط" +" فرمان دارید. برای آشنایی با کلیدها به پیوست :ref:`tut-interacting` مراجعه " +"کنید. اگر به نظر می‌رسد هیچ اتفاقی نمی‌افتد، یا اگر ``^P`` تکرار می‌شود، " +"ویرایش خط فرمان در دسترس نیست. شما فقط می توانید از backspace برای حذف " +"کاراکترها از خط فعلی استفاده کنید." #: tutorial/interpreter.rst:46 -msgid "The interpreter operates somewhat like the Unix shell: when called with standard input connected to a tty device, it reads and executes commands interactively; when called with a file name argument or with a file as standard input, it reads and executes a *script* from that file." +#, fuzzy +msgid "" +"The interpreter operates somewhat like the Unix shell: when called with " +"standard input connected to a tty device, it reads and executes commands " +"interactively; when called with a file name argument or with a file as " +"standard input, it reads and executes a *script* from that file." msgstr "" +"مفسر تا حدودی مانند پوسته یونیکس عمل می کند: هنگامی که با ورودی استاندارد " +"متصل به یک دستگاه tty فراخوانی می شود، دستورات را به صورت تعاملی می خواند و " +"اجرا می کند. هنگامی که با آرگومان نام فایل یا با یک فایل به عنوان ورودی " +"استاندارد فراخوانی می شود، یک *script* را از آن فایل می خواند و اجرا می کند." #: tutorial/interpreter.rst:51 -msgid "A second way of starting the interpreter is ``python -c command [arg] ...``, which executes the statement(s) in *command*, analogous to the shell's :option:`-c` option. Since Python statements often contain spaces or other characters that are special to the shell, it is usually advised to quote *command* in its entirety." +#, fuzzy +msgid "" +"A second way of starting the interpreter is ``python -c command [arg] ...``," +" which executes the statement(s) in *command*, analogous to the shell's " +":option:`-c` option. Since Python statements often contain spaces or other " +"characters that are special to the shell, it is usually advised to quote " +"*command* in its entirety." msgstr "" +"راه دوم برای شروع مفسر ``python -c command [arg] ...`` است که دستور(های) را " +"در *command*، مشابه گزینه :option:`-c` پوسته، اجرا می کند. از آنجایی که " +"عبارات پایتون اغلب حاوی فاصله ها یا کاراکترهای دیگری هستند که مخصوص پوسته " +"هستند، معمولاً توصیه می شود که *command* را به طور کامل نقل قول کنید." #: tutorial/interpreter.rst:57 -msgid "Some Python modules are also useful as scripts. These can be invoked using ``python -m module [arg] ...``, which executes the source file for *module* as if you had spelled out its full name on the command line." +#, fuzzy +msgid "" +"Some Python modules are also useful as scripts. These can be invoked using " +"``python -m module [arg] ...``, which executes the source file for *module* " +"as if you had spelled out its full name on the command line." msgstr "" +"برخی از ماژول های پایتون نیز به عنوان اسکریپت مفید هستند. اینها را می توان " +"با استفاده از ``python -m module [arg] ...`` فراخوانی کرد، که فایل منبع را " +"برای *module* اجرا می کند، گویی که نام کامل آن را در خط فرمان نوشته اید." #: tutorial/interpreter.rst:61 -msgid "When a script file is used, it is sometimes useful to be able to run the script and enter interactive mode afterwards. This can be done by passing :option:`-i` before the script." +#, fuzzy +msgid "" +"When a script file is used, it is sometimes useful to be able to run the " +"script and enter interactive mode afterwards. This can be done by passing " +":option:`-i` before the script." msgstr "" +"وقتی از یک فایل اسکریپت استفاده می شود، گاهی اوقات مفید است که بتوان اسکریپت" +" را اجرا کرد و بعد از آن وارد حالت تعاملی شد. این را می توان با عبور از " +":option:`-i` قبل از اسکریپت انجام داد." #: tutorial/interpreter.rst:65 +#, fuzzy msgid "All command line options are described in :ref:`using-on-general`." msgstr "" +"تمام گزینه های خط فرمان در :ref:`using-on-general` توضیح داده شده است." #: tutorial/interpreter.rst:71 +#, fuzzy msgid "Argument Passing" -msgstr "" +msgstr "گذراندن استدلال" #: tutorial/interpreter.rst:73 -msgid "When known to the interpreter, the script name and additional arguments thereafter are turned into a list of strings and assigned to the ``argv`` variable in the ``sys`` module. You can access this list by executing ``import sys``. The length of the list is at least one; when no script and no arguments are given, ``sys.argv[0]`` is an empty string. When the script name is given as ``'-'`` (meaning standard input), ``sys.argv[0]`` is set to ``'-'``. When :option:`-c` *command* is used, ``sys.argv[0]`` is set to ``'-c'``. When :option:`-m` *module* is used, ``sys.argv[0]`` is set to the full name of the located module. Options found after :option:`-c` *command* or :option:`-m` *module* are not consumed by the Python interpreter's option processing but left in ``sys.argv`` for the command or module to handle." -msgstr "" +#, fuzzy +msgid "" +"When known to the interpreter, the script name and additional arguments " +"thereafter are turned into a list of strings and assigned to the ``argv`` " +"variable in the ``sys`` module. You can access this list by executing " +"``import sys``. The length of the list is at least one; when no script and " +"no arguments are given, ``sys.argv[0]`` is an empty string. When the script" +" name is given as ``'-'`` (meaning standard input), ``sys.argv[0]`` is set " +"to ``'-'``. When :option:`-c` *command* is used, ``sys.argv[0]`` is set to " +"``'-c'``. When :option:`-m` *module* is used, ``sys.argv[0]`` is set to " +"the full name of the located module. Options found after :option:`-c` " +"*command* or :option:`-m` *module* are not consumed by the Python " +"interpreter's option processing but left in ``sys.argv`` for the command or" +" module to handle." +msgstr "" +"وقتی برای مفسر شناخته می شود، نام اسکریپت و آرگومان های اضافی پس از آن به " +"لیستی از رشته ها تبدیل می شود و به متغیر ``argv`` در ماژول ``sys`` اختصاص می" +" یابد. با اجرای ``import sys`` می توانید به این لیست دسترسی پیدا کنید. طول" +" لیست حداقل یک است. وقتی هیچ اسکریپتی و هیچ آرگومانی داده نمی شود، " +"``sys.argv[0]`` یک رشته خالی است. هنگامی که نام اسکریپت به عنوان ``'-'`` " +"(به معنی ورودی استاندارد) داده می شود، ``sys.argv[0]`` روی ``'-'`` تنظیم می " +"شود. وقتی از :option:`-c` *command* استفاده می شود، ``sys.argv[0]`` روی " +"``'-c'`` تنظیم می شود. هنگامی که از :option:`-m` *module* استفاده می شود، " +"``sys.argv[0]`` به نام کامل ماژول واقع شده تنظیم می شود. گزینه‌هایی که پس " +"از :option:`-c` *command* یا :option:`-m` *module* یافت می‌شوند توسط پردازش " +"گزینه مفسر پایتون مصرف نمی‌شوند، اما در ``sys.argv`` برای کنترل فرمان یا " +"ماژول باقی می‌مانند." #: tutorial/interpreter.rst:89 +#, fuzzy msgid "Interactive Mode" -msgstr "" +msgstr "حالت تعاملی" #: tutorial/interpreter.rst:91 -msgid "When commands are read from a tty, the interpreter is said to be in *interactive mode*. In this mode it prompts for the next command with the *primary prompt*, usually three greater-than signs (``>>>``); for continuation lines it prompts with the *secondary prompt*, by default three dots (``...``). The interpreter prints a welcome message stating its version number and a copyright notice before printing the first prompt:" -msgstr "" +#, fuzzy +msgid "" +"When commands are read from a tty, the interpreter is said to be in " +"*interactive mode*. In this mode it prompts for the next command with the " +"*primary prompt*, usually three greater-than signs (``>>>``); for " +"continuation lines it prompts with the *secondary prompt*, by default three " +"dots (``...``). The interpreter prints a welcome message stating its version" +" number and a copyright notice before printing the first prompt:" +msgstr "" +"هنگامی که دستورات از یک tty خوانده می شوند، مفسر در *interactive mode* گفته " +"می شود. در این حالت دستور بعدی را با *primary prompt*، معمولاً سه علامت " +"بزرگتر از (``>>>``) درخواست می کند. برای خطوط ادامه با *secondary prompt*, " +"به طور پیش فرض سه نقطه (``...``) درخواست می کند. مترجم یک پیام خوشامدگویی را" +" چاپ می کند که شماره نسخه و یک اعلامیه حق نسخه برداری را قبل از چاپ اولین " +"درخواست نشان می دهد:" #: tutorial/interpreter.rst:98 -msgid "$ python3.13\n" +#, fuzzy +msgid "" +"$ python3.13\n" "Python 3.13 (default, April 4 2023, 09:25:04)\n" "[GCC 10.2.0] on linux\n" "Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n" ">>>" msgstr "" +"پایتون 3.13 دلار\n" +"Python 3.13 (پیش‌فرض, 4 آوریل 2023, 09:25:04)\n" +"[GCC 10.2.0] در لینوکس\n" +"برای اطلاعات بیشتر، «راهنما»، «حق نشر»، «اعتبارات» یا «مجوز» را تایپ کنید.\n" +">>>" #: tutorial/interpreter.rst:108 -msgid "Continuation lines are needed when entering a multi-line construct. As an example, take a look at this :keyword:`if` statement::" +#, fuzzy +msgid "" +"Continuation lines are needed when entering a multi-line construct. As an " +"example, take a look at this :keyword:`if` statement::" msgstr "" +"هنگام ورود به ساختار چند خطی به خطوط ادامه نیاز است. به عنوان مثال، به این " +"عبارت :keyword:`if` نگاه کنید:" #: tutorial/interpreter.rst:111 -msgid ">>> the_world_is_flat = True\n" +#, fuzzy +msgid "" +">>> the_world_is_flat = True\n" ">>> if the_world_is_flat:\n" "... print(\"Be careful not to fall off!\")\n" "...\n" "Be careful not to fall off!" msgstr "" +">>> the_world_is_flat = درست است\n" +">>> اگر_جهان_مسطح است:\n" +"... چاپ (\"مراقب باشید زمین نخورید!\")\n" +"...\n" +"مراقب باشید زمین نخورید!" #: tutorial/interpreter.rst:118 +#, fuzzy msgid "For more on interactive mode, see :ref:`tut-interac`." msgstr "" +"برای اطلاعات بیشتر در مورد حالت تعاملی، به :ref:`tut-interac` مراجعه کنید." #: tutorial/interpreter.rst:124 +#, fuzzy msgid "The Interpreter and Its Environment" -msgstr "" +msgstr "مترجم و محیط آن" #: tutorial/interpreter.rst:130 +#, fuzzy msgid "Source Code Encoding" -msgstr "" +msgstr "کد منبع کد" #: tutorial/interpreter.rst:132 -msgid "By default, Python source files are treated as encoded in UTF-8. In that encoding, characters of most languages in the world can be used simultaneously in string literals, identifiers and comments --- although the standard library only uses ASCII characters for identifiers, a convention that any portable code should follow. To display all these characters properly, your editor must recognize that the file is UTF-8, and it must use a font that supports all the characters in the file." -msgstr "" +#, fuzzy +msgid "" +"By default, Python source files are treated as encoded in UTF-8. In that " +"encoding, characters of most languages in the world can be used " +"simultaneously in string literals, identifiers and comments --- although the" +" standard library only uses ASCII characters for identifiers, a convention " +"that any portable code should follow. To display all these characters " +"properly, your editor must recognize that the file is UTF-8, and it must use" +" a font that supports all the characters in the file." +msgstr "" +"به‌طور پیش‌فرض، فایل‌های منبع پایتون در UTF-8 کدگذاری شده‌اند. در آن " +"رمزگذاری، کاراکترهای اکثر زبان‌های دنیا می‌توانند به طور همزمان در کلمات " +"رشته‌ای، شناسه‌ها و نظرات استفاده شوند --- اگرچه کتابخانه استاندارد فقط از " +"کاراکترهای ASCII برای شناسه‌ها استفاده می‌کند، قراردادی که هر کد قابل حمل " +"باید از آن پیروی کند. برای نمایش درست همه این کاراکترها، ویرایشگر شما باید " +"تشخیص دهد که فایل UTF-8 است و باید از فونتی استفاده کند که از همه کاراکترهای" +" فایل پشتیبانی کند." #: tutorial/interpreter.rst:140 -msgid "To declare an encoding other than the default one, a special comment line should be added as the *first* line of the file. The syntax is as follows::" +#, fuzzy +msgid "" +"To declare an encoding other than the default one, a special comment line " +"should be added as the *first* line of the file. The syntax is as follows::" msgstr "" +"برای اعلام رمزگذاری غیر از کد پیش‌فرض، باید یک خط نظر ویژه به عنوان خط " +"*first* فایل اضافه شود. نحو به شرح زیر است:" #: tutorial/interpreter.rst:143 +#, fuzzy msgid "# -*- coding: encoding -*-" -msgstr "" +msgstr "# -*- coding: encoding -*-" #: tutorial/interpreter.rst:145 -msgid "where *encoding* is one of the valid :mod:`codecs` supported by Python." +#, fuzzy +msgid "" +"where *encoding* is one of the valid :mod:`codecs` supported by Python." msgstr "" +"که در آن *encoding* یکی از :mod:`codecs` معتبر است که توسط پایتون پشتیبانی " +"می شود." #: tutorial/interpreter.rst:147 -msgid "For example, to declare that Windows-1252 encoding is to be used, the first line of your source code file should be::" +#, fuzzy +msgid "" +"For example, to declare that Windows-1252 encoding is to be used, the first " +"line of your source code file should be::" msgstr "" +"به عنوان مثال، برای اعلام اینکه باید از رمزگذاری Windows-1252 استفاده شود، " +"خط اول فایل کد منبع شما باید به صورت زیر باشد:" #: tutorial/interpreter.rst:150 +#, fuzzy msgid "# -*- coding: cp1252 -*-" -msgstr "" +msgstr "# -*- coding: cp1252 -*-" #: tutorial/interpreter.rst:152 -msgid "One exception to the *first line* rule is when the source code starts with a :ref:`UNIX \"shebang\" line `. In this case, the encoding declaration should be added as the second line of the file. For example::" +#, fuzzy +msgid "" +"One exception to the *first line* rule is when the source code starts with a" +" :ref:`UNIX \"shebang\" line `. In this case, the encoding " +"declaration should be added as the second line of the file. For example::" msgstr "" +"یک استثنا در قاعده *first line* زمانی است که کد منبع با :ref:`UNIX " +"\"shebang\" line ` شروع می شود. در این حالت، اعلان رمزگذاری " +"باید به عنوان خط دوم فایل اضافه شود. به عنوان مثال::" #: tutorial/interpreter.rst:156 -msgid "#!/usr/bin/env python3\n" +#, fuzzy +msgid "" +"#!/usr/bin/env python3\n" "# -*- coding: cp1252 -*-" msgstr "" +"#!/usr/bin/env python3\n" +"# -*- coding: cp1252 -*-" #: tutorial/interpreter.rst:160 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/interpreter.rst:161 -msgid "On Unix, the Python 3.x interpreter is by default not installed with the executable named ``python``, so that it does not conflict with a simultaneously installed Python 2.x executable." +#, fuzzy +msgid "" +"On Unix, the Python 3.x interpreter is by default not installed with the " +"executable named ``python``, so that it does not conflict with a " +"simultaneously installed Python 2.x executable." msgstr "" +"در یونیکس، مفسر Python 3.x به طور پیش‌فرض با فایل اجرایی به نام ``python`` " +"نصب نمی‌شود، بنابراین با یک فایل اجرایی Python 2.x که همزمان نصب شده است، " +"تضاد ندارد." diff --git a/tutorial/introduction.po b/tutorial/introduction.po index da4c7db4..aed17fef 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -17,50 +17,113 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/introduction.rst:5 +#, fuzzy msgid "An Informal Introduction to Python" -msgstr "" +msgstr "معرفی غیر رسمی پایتون" #: tutorial/introduction.rst:7 -msgid "In the following examples, input and output are distinguished by the presence or absence of prompts (:term:`>>>` and :term:`...`): to repeat the example, you must type everything after the prompt, when the prompt appears; lines that do not begin with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command." -msgstr "" +#, fuzzy +msgid "" +"In the following examples, input and output are distinguished by the " +"presence or absence of prompts (:term:`>>>` and :term:`...`): to repeat the " +"example, you must type everything after the prompt, when the prompt appears;" +" lines that do not begin with a prompt are output from the interpreter. Note" +" that a secondary prompt on a line by itself in an example means you must " +"type a blank line; this is used to end a multi-line command." +msgstr "" +"در مثال‌های زیر، ورودی و خروجی با وجود یا عدم وجود اعلان‌ها (:term:`>>>` و " +":term:`...`) متمایز می‌شوند: برای تکرار مثال, باید همه چیز را بعد از دستور " +"تایپ کنید, زمانی که اعلان ظاهر شد. خطوطی که با اعلان شروع نمی شوند از مفسر " +"خروجی می شوند. توجه داشته باشید که یک دستور ثانویه روی یک خط به تنهایی در یک" +" مثال به این معنی است که باید یک خط خالی تایپ کنید. این برای پایان دادن به " +"یک فرمان چند خطی استفاده می شود." #: tutorial/introduction.rst:16 -msgid "You can toggle the display of prompts and output by clicking on ``>>>`` in the upper-right corner of an example box. If you hide the prompts and output for an example, then you can easily copy and paste the input lines into your interpreter." +#, fuzzy +msgid "" +"You can toggle the display of prompts and output by clicking on ``>>>`` in " +"the upper-right corner of an example box. If you hide the prompts and " +"output for an example, then you can easily copy and paste the input lines " +"into your interpreter." msgstr "" +"می توانید با کلیک بر روی ``>>>`` در گوشه سمت راست بالای یک کادر مثال, نمایش " +"اعلان ها و خروجی ها را تغییر دهید. اگر اعلان ها و خروجی ها را برای مثال " +"مخفی کنید, می توانید به راحتی خطوط ورودی را در مترجم خود کپی و جایگذاری " +"کنید." #: tutorial/introduction.rst:23 -msgid "Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, ``#``, and extend to the end of the physical line. A comment may appear at the start of a line or following whitespace or code, but not within a string literal. A hash character within a string literal is just a hash character. Since comments are to clarify code and are not interpreted by Python, they may be omitted when typing in examples." -msgstr "" +#, fuzzy +msgid "" +"Many of the examples in this manual, even those entered at the interactive " +"prompt, include comments. Comments in Python start with the hash character," +" ``#``, and extend to the end of the physical line. A comment may appear at" +" the start of a line or following whitespace or code, but not within a " +"string literal. A hash character within a string literal is just a hash " +"character. Since comments are to clarify code and are not interpreted by " +"Python, they may be omitted when typing in examples." +msgstr "" +"بسیاری از مثال‌های موجود در این راهنما، حتی نمونه‌هایی که در اعلان تعاملی " +"وارد شده‌اند، شامل نظرات هستند. نظرات در پایتون با کاراکتر هش ``#`` شروع می" +" شود و تا انتهای خط فیزیکی گسترش می یابد. یک نظر ممکن است در ابتدای یک خط " +"یا پس از فضای خالی یا کد ظاهر شود، اما نه در یک رشته به معنای واقعی کلمه. " +"یک کاراکتر هش در یک رشته واقعی فقط یک کاراکتر هش است. از آنجایی که کامنت‌ها " +"برای شفاف‌سازی کد هستند و توسط پایتون تفسیر نمی‌شوند، ممکن است هنگام تایپ در" +" مثال‌ها حذف شوند." #: tutorial/introduction.rst:31 +#, fuzzy msgid "Some examples::" -msgstr "" +msgstr "چند نمونه::" #: tutorial/introduction.rst:33 -msgid "# this is the first comment\n" +#, fuzzy +msgid "" +"# this is the first comment\n" "spam = 1 # and this is the second comment\n" " # ... and now a third!\n" "text = \"# This is not a comment because it's inside quotes.\"" msgstr "" +"# this is the first comment\n" +"spam = 1 # and this is the second comment\n" +" # ... and now a third!\n" +"text = \"# This is not a comment because it's inside quotes.\"" #: tutorial/introduction.rst:42 +#, fuzzy msgid "Using Python as a Calculator" -msgstr "" +msgstr "استفاده از پایتون به عنوان ماشین حساب" #: tutorial/introduction.rst:44 -msgid "Let's try some simple Python commands. Start the interpreter and wait for the primary prompt, ``>>>``. (It shouldn't take long.)" +#, fuzzy +msgid "" +"Let's try some simple Python commands. Start the interpreter and wait for " +"the primary prompt, ``>>>``. (It shouldn't take long.)" msgstr "" +"بیایید چند دستور ساده پایتون را امتحان کنیم. مفسر را راه اندازی کنید و " +"منتظر فرمان اولیه، ``>>>`` باشید. (نباید زیاد طول بکشد.)" #: tutorial/introduction.rst:51 +#, fuzzy msgid "Numbers" -msgstr "" +msgstr "اعداد" #: tutorial/introduction.rst:53 -msgid "The interpreter acts as a simple calculator: you can type an expression at it and it will write the value. Expression syntax is straightforward: the operators ``+``, ``-``, ``*`` and ``/`` can be used to perform arithmetic; parentheses (``()``) can be used for grouping. For example::" +#, fuzzy +msgid "" +"The interpreter acts as a simple calculator: you can type an expression at " +"it and it will write the value. Expression syntax is straightforward: the " +"operators ``+``, ``-``, ``*`` and ``/`` can be used to perform arithmetic; " +"parentheses (``()``) can be used for grouping. For example::" msgstr "" +"مفسر به عنوان یک ماشین حساب ساده عمل می کند: می توانید یک عبارت را در آن " +"تایپ کنید و مقدار را می نویسد. نحو بیان ساده است: عملگرهای ``+``، ``-``، " +"``*`` و ``/`` می توانند برای انجام محاسبات استفاده شوند. از پرانتز (``()``) " +"می توان برای گروه بندی استفاده کرد. به عنوان مثال::" #: tutorial/introduction.rst:59 -msgid ">>> 2 + 2\n" +#, fuzzy +msgid "" +">>> 2 + 2\n" "4\n" ">>> 50 - 5*6\n" "20\n" @@ -69,17 +132,41 @@ msgid ">>> 2 + 2\n" ">>> 8 / 5 # division always returns a floating-point number\n" "1.6" msgstr "" +">>> 2 + 2\n" +"4\n" +">>> 50 - 5*6\n" +"20\n" +">>> (50 - 5*6) / 4\n" +"5.0\n" +">>> 8 / 5 # division always returns a floating-point number\n" +"1.6" #: tutorial/introduction.rst:68 -msgid "The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:`float`. We will see more about numeric types later in the tutorial." +#, fuzzy +msgid "" +"The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the " +"ones with a fractional part (e.g. ``5.0``, ``1.6``) have type " +":class:`float`. We will see more about numeric types later in the tutorial." msgstr "" +"اعداد صحیح (مانند ``2``, ``4``, ``20``) دارای نوع :class:`int` هستند، اعدادی" +" که دارای قسمت کسری هستند (مانند ``5.0``, ``1.6``) دارای نوع :class:`float` " +"هستند. در ادامه در آموزش بیشتر در مورد انواع عددی خواهیم دید." #: tutorial/introduction.rst:72 -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 ``%``::" +#, fuzzy +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` و گرفتن نتیجه عدد صحیح می توانید از عملگر ``//`` استفاده کنید. " +"برای محاسبه باقی مانده می توانید از ``%`` استفاده کنید::" #: tutorial/introduction.rst:76 -msgid ">>> 17 / 3 # classic division returns a float\n" +#, fuzzy +msgid "" +">>> 17 / 3 # classic division returns a float\n" "5.666666666666667\n" ">>>\n" ">>> 17 // 3 # floor division discards the fractional part\n" @@ -89,55 +176,114 @@ msgid ">>> 17 / 3 # classic division returns a float\n" ">>> 5 * 3 + 2 # floored quotient * divisor + remainder\n" "17" msgstr "" +">>> 17 / 3 # بخش کلاسیک یک شناور را برمی گرداند\n" +"5.666666666666667\n" +">>>\n" +">>> 17 // 3 # تقسیم طبقه قسمت کسری را دور می اندازد\n" +"5\n" +">>> 17 % 3 # عملگر % باقیمانده تقسیم را برمی گرداند\n" +"2\n" +">>> 5 مقسوم علیه * 3 + 2 # floored quotient * + باقیمانده\n" +"17" #: tutorial/introduction.rst:86 -msgid "With Python, it is possible to use the ``**`` operator to calculate powers [#]_::" +#, fuzzy +msgid "" +"With Python, it is possible to use the ``**`` operator to calculate powers " +"[#]_::" msgstr "" +"با پایتون، می توان از عملگر ``**`` برای محاسبه قدرت ها استفاده کرد [#]_::" #: tutorial/introduction.rst:88 -msgid ">>> 5 ** 2 # 5 squared\n" +#, fuzzy +msgid "" +">>> 5 ** 2 # 5 squared\n" "25\n" ">>> 2 ** 7 # 2 to the power of 7\n" "128" msgstr "" +">>> 5 ** 2 # 5 squared\n" +"25\n" +">>> 2 ** 7 # 2 to the power of 7\n" +"128" #: tutorial/introduction.rst:93 -msgid "The equal sign (``=``) is used to assign a value to a variable. Afterwards, no result is displayed before the next interactive prompt::" +#, fuzzy +msgid "" +"The equal sign (``=``) is used to assign a value to a variable. Afterwards, " +"no result is displayed before the next interactive prompt::" msgstr "" +"علامت مساوی (``=``) برای تخصیص یک مقدار به یک متغیر استفاده می شود. پس از " +"آن، هیچ نتیجه ای قبل از اعلان تعاملی بعدی نمایش داده نمی شود::" #: tutorial/introduction.rst:96 -msgid ">>> width = 20\n" +#, fuzzy +msgid "" +">>> width = 20\n" ">>> height = 5 * 9\n" ">>> width * height\n" "900" msgstr "" +">>> width = 20\n" +">>> height = 5 * 9\n" +">>> width * height\n" +"900" #: tutorial/introduction.rst:101 -msgid "If a variable is not \"defined\" (assigned a value), trying to use it will give you an error::" +#, fuzzy +msgid "" +"If a variable is not \"defined\" (assigned a value), trying to use it will " +"give you an error::" msgstr "" +"اگر متغیری \"تعریف\" نشده باشد (مقدار اختصاص داده شده), تلاش برای استفاده از" +" آن با خطای زیر مواجه می شود::" #: tutorial/introduction.rst:104 -msgid ">>> n # try to access an undefined variable\n" +#, fuzzy +msgid "" +">>> n # try to access an undefined variable\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "NameError: name 'n' is not defined" msgstr "" +">>> n # سعی کنید به یک متغیر تعریف نشده دسترسی پیدا کنید\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"NameError: نام 'n' تعریف نشده است" #: tutorial/introduction.rst:109 -msgid "There is full support for floating point; operators with mixed type operands convert the integer operand to floating point::" +#, fuzzy +msgid "" +"There is full support for floating point; operators with mixed type operands" +" convert the integer operand to floating point::" msgstr "" +"پشتیبانی کامل از ممیز شناور وجود دارد. عملگرهایی با عملوندهای نوع مختلط، " +"عملوند عدد صحیح را به ممیز شناور تبدیل می کنند:" #: tutorial/introduction.rst:112 -msgid ">>> 4 * 3.75 - 1\n" +#, fuzzy +msgid "" +">>> 4 * 3.75 - 1\n" "14.0" msgstr "" +">>> 4 * 3.75 - 1\n" +"14.0" #: tutorial/introduction.rst:115 -msgid "In interactive mode, the last printed expression is assigned to the variable ``_``. This means that when you are using Python as a desk calculator, it is somewhat easier to continue calculations, for example::" +#, fuzzy +msgid "" +"In interactive mode, the last printed expression is assigned to the variable" +" ``_``. This means that when you are using Python as a desk calculator, it " +"is somewhat easier to continue calculations, for example::" msgstr "" +"در حالت تعاملی، آخرین عبارت چاپ شده به متغیر ``_`` اختصاص داده می شود. این " +"بدان معنی است که وقتی از پایتون به عنوان یک ماشین حساب میز استفاده می کنید، " +"ادامه محاسبات تا حدودی آسان تر است، به عنوان مثال:" #: tutorial/introduction.rst:119 -msgid ">>> tax = 12.5 / 100\n" +#, fuzzy +msgid "" +">>> tax = 12.5 / 100\n" ">>> price = 100.50\n" ">>> price * tax\n" "12.5625\n" @@ -146,29 +292,74 @@ msgid ">>> tax = 12.5 / 100\n" ">>> round(_, 2)\n" "113.06" msgstr "" +">>> tax = 12.5 / 100\n" +">>> price = 100.50\n" +">>> price * tax\n" +"12.5625\n" +">>> price + _\n" +"113.0625\n" +">>> round(_, 2)\n" +"113.06" #: tutorial/introduction.rst:128 -msgid "This variable should be treated as read-only by the user. Don't explicitly assign a value to it --- you would create an independent local variable with the same name masking the built-in variable with its magic behavior." +#, fuzzy +msgid "" +"This variable should be treated as read-only by the user. Don't explicitly " +"assign a value to it --- you would create an independent local variable with" +" the same name masking the built-in variable with its magic behavior." msgstr "" +"این متغیر باید توسط کاربر فقط خواندنی باشد. صراحتاً مقداری به آن اختصاص " +"ندهید --- می توانید یک متغیر محلی مستقل با همان نام ایجاد کنید که متغیر " +"داخلی را با رفتار جادویی آن پوشانده است." #: tutorial/introduction.rst:132 -msgid "In addition to :class:`int` and :class:`float`, Python supports other types of numbers, such as :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. Python also has built-in support for :ref:`complex numbers `, and uses the ``j`` or ``J`` suffix to indicate the imaginary part (e.g. ``3+5j``)." -msgstr "" +#, fuzzy +msgid "" +"In addition to :class:`int` and :class:`float`, Python supports other types " +"of numbers, such as :class:`~decimal.Decimal` and " +":class:`~fractions.Fraction`. Python also has built-in support for " +":ref:`complex numbers `, and uses the ``j`` or ``J`` suffix to" +" indicate the imaginary part (e.g. ``3+5j``)." +msgstr "" +"علاوه بر :class:`int` و :class:`float`، پایتون از انواع دیگری از اعداد مانند" +" :class:`~decimal.Decimal` و :class:`~fractions.Fraction` پشتیبانی می کند. " +"پایتون همچنین از :ref:`complex numbers ` پشتیبانی داخلی دارد و" +" از پسوند ``j`` یا ``J`` برای نشان دادن قسمت خیالی (مثلاً ``3+5j``) استفاده " +"می کند." #: tutorial/introduction.rst:142 +#, fuzzy msgid "Text" -msgstr "" +msgstr "متن" #: tutorial/introduction.rst:144 -msgid "Python can manipulate text (represented by type :class:`str`, so-called \"strings\") as well as numbers. This includes characters \"``!``\", words \"``rabbit``\", names \"``Paris``\", sentences \"``Got your back.``\", etc. \"``Yay! :)``\". They can be enclosed in single quotes (``'...'``) or double quotes (``\"...\"``) with the same result [#]_." -msgstr "" +#, fuzzy +msgid "" +"Python can manipulate text (represented by type :class:`str`, so-called " +"\"strings\") as well as numbers. This includes characters \"``!``\", words " +"\"``rabbit``\", names \"``Paris``\", sentences \"``Got your back.``\", etc. " +"\"``Yay! :)``\". They can be enclosed in single quotes (``'...'``) or double" +" quotes (``\"...\"``) with the same result [#]_." +msgstr "" +"پایتون می تواند متن (که با نوع :class:`str` نشان داده می شود, به اصطلاح " +"\"رشته\") و همچنین اعداد را دستکاری کند. این شامل کاراکترهای \"``!``\", " +"کلمات \"``rabbit``\", نام \"``Paris``\", جملات \"``Got your back.``\", و " +"غیره \"``Yay! :)``\" است. آنها را می توان در گیومه های تکی (``'...'``) یا دو" +" گیومه (``\"...\"``) با نتیجه یکسان [#]_ قرار داد." #: tutorial/introduction.rst:157 -msgid "To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. Alternatively, we can use the other type of quotation marks::" +#, fuzzy +msgid "" +"To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. " +"Alternatively, we can use the other type of quotation marks::" msgstr "" +"برای نقل قول، باید از آن فرار کنیم، قبل از آن با ``\\``. همچنین می‌توانیم از" +" نوع دیگر گیومه‌ها استفاده کنیم:" #: tutorial/introduction.rst:160 -msgid ">>> 'doesn\\'t' # use \\' to escape the single quote...\n" +#, fuzzy +msgid "" +">>> 'doesn\\'t' # use \\' to escape the single quote...\n" "\"doesn't\"\n" ">>> \"doesn't\" # ...or use double quotes instead\n" "\"doesn't\"\n" @@ -179,42 +370,101 @@ msgid ">>> 'doesn\\'t' # use \\' to escape the single quote...\n" ">>> '\"Isn\\'t,\" they said.'\n" "'\"Isn\\'t,\" they said.'" msgstr "" +">>> 'doesn\\'t' # use \\' to escape the single quote...\n" +"\"doesn't\"\n" +">>> \"doesn't\" # ...or use double quotes instead\n" +"\"doesn't\"\n" +">>> '\"Yes,\" they said.'\n" +"'\"Yes,\" they said.'\n" +">>> \"\\\"Yes,\\\" they said.\"\n" +"'\"Yes,\" they said.'\n" +">>> '\"Isn\\'t,\" they said.'\n" +"'\"Isn\\'t,\" they said.'" #: tutorial/introduction.rst:171 -msgid "In the Python shell, the string definition and output string can look different. The :func:`print` function produces a more readable output, by omitting the enclosing quotes and by printing escaped and special characters::" +#, fuzzy +msgid "" +"In the Python shell, the string definition and output string can look " +"different. The :func:`print` function produces a more readable output, by " +"omitting the enclosing quotes and by printing escaped and special " +"characters::" msgstr "" +"در پوسته پایتون، تعریف رشته و رشته خروجی می تواند متفاوت به نظر برسد. تابع " +":func:`print` با حذف نقل قول های محصور و با چاپ نویسه های فرار و ویژه خروجی " +"خواناتری تولید می کند:" #: tutorial/introduction.rst:175 -msgid ">>> s = 'First line.\\nSecond line.' # \\n means newline\n" +#, fuzzy +msgid "" +">>> s = 'First line.\\nSecond line.' # \\n means newline\n" ">>> s # without print(), special characters are included in the string\n" "'First line.\\nSecond line.'\n" ">>> print(s) # with print(), special characters are interpreted, so \\n produces new line\n" "First line.\n" "Second line." msgstr "" +">>> s = 'خط اول.\\nخط دوم.' # \\n به معنای خط جدید است\n" +">>> s # بدون print(), کاراکترهای ویژه در رشته گنجانده شده است\n" +"\"خط اول.\\nخط دوم.\"\n" +">>> print(s) # با print(), کاراکترهای ویژه تفسیر می شوند, بنابراین \\n خط جدید تولید می کند\n" +"خط اول\n" +"خط دوم." #: tutorial/introduction.rst:182 -msgid "If you don't want characters prefaced by ``\\`` to be interpreted as special characters, you can use *raw strings* by adding an ``r`` before the first quote::" +#, fuzzy +msgid "" +"If you don't want characters prefaced by ``\\`` to be interpreted as special" +" characters, you can use *raw strings* by adding an ``r`` before the first " +"quote::" msgstr "" +"اگر نمی‌خواهید کاراکترهای پیش‌گفتار ``\\`` به عنوان کاراکترهای خاص تفسیر " +"شوند، می‌توانید از *raw strings* با اضافه کردن یک ``r`` قبل از اولین نقل قول" +" استفاده کنید:" #: tutorial/introduction.rst:186 -msgid ">>> print('C:\\some\\name') # here \\n means newline!\n" +#, fuzzy +msgid "" +">>> print('C:\\some\\name') # here \\n means newline!\n" "C:\\some\n" "ame\n" ">>> print(r'C:\\some\\name') # note the r before the quote\n" "C:\\some\\name" msgstr "" +">>> print('C:\\some\\name') # در اینجا \\n به معنای خط جدید است!\n" +"ج: برخی\n" +"آمی\n" +">>> print(r'C:\\some\\name') # r قبل از نقل قول را یادداشت کنید\n" +"ج:\\some\\name" #: tutorial/introduction.rst:192 -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." +#, fuzzy +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." msgstr "" +"یک جنبه ظریف برای رشته های خام وجود دارد: یک رشته خام ممکن است به تعداد فرد " +"از کاراکترهای ``\\`` ختم نشود. برای اطلاعات بیشتر و راه حل ها به :ref:`the " +"FAQ entry ` مراجعه کنید." #: tutorial/introduction.rst:197 -msgid "String literals can span multiple lines. One way is using triple-quotes: ``\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically included in the string, but it's possible to prevent this by adding a ``\\`` at the end of the line. In the following example, the initial newline is not included::" +#, fuzzy +msgid "" +"String literals can span multiple lines. One way is using triple-quotes: " +"``\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically " +"included in the string, but it's possible to prevent this by adding a ``\\``" +" at the end of the line. In the following example, the initial newline is " +"not included::" msgstr "" +"لفظ رشته می تواند چندین خط را در بر بگیرد. یک راه استفاده از سه گیومه است: " +"``\"\"\"...\"\"\"`` یا ``'''...'''``. انتهای خطوط به طور خودکار در رشته " +"گنجانده می شود، اما می توان با افزودن ``\\`` در انتهای خط از این امر جلوگیری" +" کرد. در مثال زیر، خط جدید اولیه گنجانده نشده است:" #: tutorial/introduction.rst:203 -msgid ">>> print(\"\"\"\\\n" +#, fuzzy +msgid "" +">>> print(\"\"\"\\\n" "... Usage: thingy [OPTIONS]\n" "... -h Display this usage message\n" "... -H hostname Hostname to connect to\n" @@ -225,43 +475,86 @@ msgid ">>> print(\"\"\"\\\n" "\n" ">>>" msgstr "" +">>> چاپ (\"\"\"\\\n" +"... استفاده: چیز [OPTIONS]\n" +"... -h این پیام استفاده را نمایش دهید\n" +"... -H نام میزبان نام میزبان برای اتصال به\n" +"... \"\"\")\n" +"استفاده: چیز [OPTIONS]\n" +" -h این پیام استفاده را نمایش دهید\n" +" -H نام میزبان نام میزبان برای اتصال به\n" +"\n" +">>>" #: tutorial/introduction.rst:214 -msgid "Strings can be concatenated (glued together) with the ``+`` operator, and repeated with ``*``::" +#, fuzzy +msgid "" +"Strings can be concatenated (glued together) with the ``+`` operator, and " +"repeated with ``*``::" msgstr "" +"رشته ها را می توان با عملگر ``+`` متصل کرد (به هم چسباند) و با ``*`` تکرار " +"کرد:" #: tutorial/introduction.rst:217 -msgid ">>> # 3 times 'un', followed by 'ium'\n" +#, fuzzy +msgid "" +">>> # 3 times 'un', followed by 'ium'\n" ">>> 3 * 'un' + 'ium'\n" "'unununium'" msgstr "" +">>> # 3 times 'un', followed by 'ium'\n" +">>> 3 * 'un' + 'ium'\n" +"'unununium'" #: tutorial/introduction.rst:221 -msgid "Two or more *string literals* (i.e. the ones enclosed between quotes) next to each other are automatically concatenated. ::" +#, fuzzy +msgid "" +"Two or more *string literals* (i.e. the ones enclosed between quotes) next " +"to each other are automatically concatenated. ::" msgstr "" +"دو یا چند *string literals* (یعنی آنهایی که بین نقل قول قرار می گیرند) در " +"کنار یکدیگر به طور خودکار به هم متصل می شوند. ::" #: tutorial/introduction.rst:224 -msgid ">>> 'Py' 'thon'\n" +#, fuzzy +msgid "" +">>> 'Py' 'thon'\n" "'Python'" msgstr "" +">>> 'Py' 'thon'\n" +"'Python'" #: tutorial/introduction.rst:227 -msgid "This feature is particularly useful when you want to break long strings::" +#, fuzzy +msgid "" +"This feature is particularly useful when you want to break long strings::" msgstr "" +"این ویژگی به ویژه زمانی مفید است که می خواهید رشته های طولانی را بشکنید:" #: tutorial/introduction.rst:229 -msgid ">>> text = ('Put several strings within parentheses '\n" +#, fuzzy +msgid "" +">>> text = ('Put several strings within parentheses '\n" "... 'to have them joined together.')\n" ">>> text\n" "'Put several strings within parentheses to have them joined together.'" msgstr "" +">>> text = ('Put several strings within parentheses '\n" +"... 'to have them joined together.')\n" +">>> text\n" +"'Put several strings within parentheses to have them joined together.'" #: tutorial/introduction.rst:234 -msgid "This only works with two literals though, not with variables or expressions::" -msgstr "" +#, fuzzy +msgid "" +"This only works with two literals though, not with variables or " +"expressions::" +msgstr "این فقط با دو حرف واقعی کار می کند، نه با متغیرها یا عبارات::" #: tutorial/introduction.rst:236 -msgid ">>> prefix = 'Py'\n" +#, fuzzy +msgid "" +">>> prefix = 'Py'\n" ">>> prefix 'thon' # can't concatenate a variable and a string literal\n" " File \"\", line 1\n" " prefix 'thon'\n" @@ -273,128 +566,267 @@ msgid ">>> prefix = 'Py'\n" " ^^^^^\n" "SyntaxError: invalid syntax" msgstr "" +">>> پیشوند = 'Py'\n" +">>> پیشوند 'thon' # نمی تواند یک متغیر و یک رشته واقعی را به هم الحاق کند\n" +" فایل \"\", خط 1\n" +" پیشوند \"thon\"\n" +" ^^^^^^\n" +"SyntaxError: نحو نامعتبر است\n" +">>> ('un' * 3) 'ium'\n" +" File \"\", line 1\n" +" ('un' * 3) 'ium'\n" +" ^^^^^\n" +"SyntaxError: نحو نامعتبر است" #: tutorial/introduction.rst:248 -msgid "If you want to concatenate variables or a variable and a literal, use ``+``::" +#, fuzzy +msgid "" +"If you want to concatenate variables or a variable and a literal, use " +"``+``::" msgstr "" +"اگر می خواهید متغیرها یا یک متغیر و یک لفظ را به هم متصل کنید، از ``+`` " +"استفاده کنید::" #: tutorial/introduction.rst:250 -msgid ">>> prefix + 'thon'\n" +#, fuzzy +msgid "" +">>> prefix + 'thon'\n" "'Python'" msgstr "" +">>> prefix + 'thon'\n" +"'Python'" #: tutorial/introduction.rst:253 -msgid "Strings can be *indexed* (subscripted), with the first character having index 0. There is no separate character type; a character is simply a string of size one::" +#, fuzzy +msgid "" +"Strings can be *indexed* (subscripted), with the first character having " +"index 0. There is no separate character type; a character is simply a string" +" of size one::" msgstr "" +"رشته ها می توانند *indexed* (مشترک) باشند که اولین کاراکتر دارای اندیس 0 " +"باشد. هیچ نوع کاراکتر جداگانه ای وجود ندارد. یک کاراکتر به سادگی یک رشته با " +"اندازه یک است:" #: tutorial/introduction.rst:257 -msgid ">>> word = 'Python'\n" +#, fuzzy +msgid "" +">>> word = 'Python'\n" ">>> word[0] # character in position 0\n" "'P'\n" ">>> word[5] # character in position 5\n" "'n'" msgstr "" +">>> word = 'Python'\n" +">>> word[0] # character in position 0\n" +"'P'\n" +">>> word[5] # character in position 5\n" +"'n'" #: tutorial/introduction.rst:263 -msgid "Indices may also be negative numbers, to start counting from the right::" -msgstr "" +#, fuzzy +msgid "" +"Indices may also be negative numbers, to start counting from the right::" +msgstr "شاخص ها نیز ممکن است اعداد منفی باشند، برای شروع شمارش از سمت راست:" #: tutorial/introduction.rst:265 -msgid ">>> word[-1] # last character\n" +#, fuzzy +msgid "" +">>> word[-1] # last character\n" "'n'\n" ">>> word[-2] # second-last character\n" "'o'\n" ">>> word[-6]\n" "'P'" msgstr "" +">>> word[-1] # last character\n" +"'n'\n" +">>> word[-2] # second-last character\n" +"'o'\n" +">>> word[-6]\n" +"'P'" #: tutorial/introduction.rst:272 +#, fuzzy msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "" +"توجه داشته باشید که از آنجایی که -0 همان 0 است، شاخص های منفی از -1 شروع می " +"شوند." #: tutorial/introduction.rst:274 -msgid "In addition to indexing, *slicing* is also supported. While indexing is used to obtain individual characters, *slicing* allows you to obtain a substring::" +#, fuzzy +msgid "" +"In addition to indexing, *slicing* is also supported. While indexing is " +"used to obtain individual characters, *slicing* allows you to obtain a " +"substring::" msgstr "" +"علاوه بر نمایه سازی، *slicing* نیز پشتیبانی می شود. در حالی که نمایه سازی " +"برای به دست آوردن کاراکترهای مجزا استفاده می شود، *slicing* به شما امکان می " +"دهد یک زیر رشته به دست آورید:" #: tutorial/introduction.rst:277 -msgid ">>> word[0:2] # characters from position 0 (included) to 2 (excluded)\n" +#, fuzzy +msgid "" +">>> word[0:2] # characters from position 0 (included) to 2 (excluded)\n" "'Py'\n" ">>> word[2:5] # characters from position 2 (included) to 5 (excluded)\n" "'tho'" msgstr "" +">>> word[0:2] # characters from position 0 (included) to 2 (excluded)\n" +"'Py'\n" +">>> word[2:5] # characters from position 2 (included) to 5 (excluded)\n" +"'tho'" #: tutorial/introduction.rst:282 -msgid "Slice indices have useful defaults; an omitted first index defaults to zero, an omitted second index defaults to the size of the string being sliced. ::" +#, fuzzy +msgid "" +"Slice indices have useful defaults; an omitted first index defaults to zero," +" an omitted second index defaults to the size of the string being sliced. ::" msgstr "" +"شاخص های برش دارای پیش فرض های مفیدی هستند. شاخص اول حذف شده به طور پیش فرض " +"صفر است، شاخص دوم حذف شده به طور پیش فرض به اندازه رشته در حال برش است. ::" #: tutorial/introduction.rst:285 -msgid ">>> word[:2] # character from the beginning to position 2 (excluded)\n" +#, fuzzy +msgid "" +">>> word[:2] # character from the beginning to position 2 (excluded)\n" "'Py'\n" ">>> word[4:] # characters from position 4 (included) to the end\n" "'on'\n" ">>> word[-2:] # characters from the second-last (included) to the end\n" "'on'" msgstr "" +">>> word[:2] # character from the beginning to position 2 (excluded)\n" +"'Py'\n" +">>> word[4:] # characters from position 4 (included) to the end\n" +"'on'\n" +">>> word[-2:] # characters from the second-last (included) to the end\n" +"'on'" #: tutorial/introduction.rst:292 -msgid "Note how the start is always included, and the end always excluded. This makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" +#, fuzzy +msgid "" +"Note how the start is always included, and the end always excluded. This " +"makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" msgstr "" +"توجه داشته باشید که چگونه شروع همیشه گنجانده می شود و پایان همیشه حذف می " +"شود. این اطمینان حاصل می کند که ``s[:i] + s[i:]`` همیشه برابر با ``s`` است:" #: tutorial/introduction.rst:295 -msgid ">>> word[:2] + word[2:]\n" +#, fuzzy +msgid "" +">>> word[:2] + word[2:]\n" "'Python'\n" ">>> word[:4] + word[4:]\n" "'Python'" msgstr "" +">>> word[:2] + word[2:]\n" +"'Python'\n" +">>> word[:4] + word[4:]\n" +"'Python'" #: tutorial/introduction.rst:300 -msgid "One way to remember how slices work is to think of the indices as pointing *between* characters, with the left edge of the first character numbered 0. Then the right edge of the last character of a string of *n* characters has index *n*, for example::" +#, fuzzy +msgid "" +"One way to remember how slices work is to think of the indices as pointing " +"*between* characters, with the left edge of the first character numbered 0. " +"Then the right edge of the last character of a string of *n* characters has " +"index *n*, for example::" msgstr "" +"یکی از راه‌های به یاد آوردن نحوه کار برش‌ها این است که شاخص‌ها را به‌عنوان " +"کاراکترهای *between* در نظر بگیرید، با لبه سمت چپ اولین کاراکتر با شماره 0. " +"سپس لبه سمت راست آخرین کاراکتر یک رشته از کاراکترهای *n* دارای شاخص *n* است،" +" برای مثال:" #: tutorial/introduction.rst:305 -msgid " +---+---+---+---+---+---+\n" +#, fuzzy +msgid "" +" +---+---+---+---+---+---+\n" " | P | y | t | h | o | n |\n" " +---+---+---+---+---+---+\n" " 0 1 2 3 4 5 6\n" "-6 -5 -4 -3 -2 -1" msgstr "" +" +---+---+---+---+---+---+\n" +" | P | y | t | h | o | n |\n" +" +---+---+---+---+---+---+\n" +" 0 1 2 3 4 5 6\n" +"-6 -5 -4 -3 -2 -1" #: tutorial/introduction.rst:311 -msgid "The first row of numbers gives the position of the indices 0...6 in the string; the second row gives the corresponding negative indices. The slice from *i* to *j* consists of all characters between the edges labeled *i* and *j*, respectively." +#, fuzzy +msgid "" +"The first row of numbers gives the position of the indices 0...6 in the " +"string; the second row gives the corresponding negative indices. The slice " +"from *i* to *j* consists of all characters between the edges labeled *i* and" +" *j*, respectively." msgstr "" +"ردیف اول اعداد موقعیت شاخص ها را 0...6 در رشته می دهد. ردیف دوم شاخص های " +"منفی مربوطه را نشان می دهد. برش از *i* تا *j* شامل تمام کاراکترهای بین " +"لبه‌های با برچسب *i* و *j* است." #: tutorial/introduction.rst:316 -msgid "For non-negative indices, the length of a slice is the difference of the indices, if both are within bounds. For example, the length of ``word[1:3]`` is 2." +#, fuzzy +msgid "" +"For non-negative indices, the length of a slice is the difference of the " +"indices, if both are within bounds. For example, the length of " +"``word[1:3]`` is 2." msgstr "" +"برای شاخص‌های غیرمنفی، در صورتی که هر دو در محدوده باشند، طول یک برش تفاوت " +"شاخص‌ها است. به عنوان مثال، طول ``word[1:3]`` 2 است." #: tutorial/introduction.rst:320 +#, fuzzy msgid "Attempting to use an index that is too large will result in an error::" -msgstr "" +msgstr "تلاش برای استفاده از شاخصی که خیلی بزرگ است با خطا مواجه می شود::" #: tutorial/introduction.rst:322 -msgid ">>> word[42] # the word only has 6 characters\n" +#, fuzzy +msgid "" +">>> word[42] # the word only has 6 characters\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "IndexError: string index out of range" msgstr "" +">>> word[42] # کلمه فقط 6 کاراکتر دارد\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"IndexError: فهرست رشته خارج از محدوده" #: tutorial/introduction.rst:327 -msgid "However, out of range slice indexes are handled gracefully when used for slicing::" +#, fuzzy +msgid "" +"However, out of range slice indexes are handled gracefully when used for " +"slicing::" msgstr "" +"با این حال، شاخص‌های برش خارج از محدوده زمانی که برای برش استفاده می‌شوند، " +"به خوبی مدیریت می‌شوند:" #: tutorial/introduction.rst:330 -msgid ">>> word[4:42]\n" +#, fuzzy +msgid "" +">>> word[4:42]\n" "'on'\n" ">>> word[42:]\n" "''" msgstr "" +">>> word[4:42]\n" +"'on'\n" +">>> word[42:]\n" +"''" #: tutorial/introduction.rst:335 -msgid "Python strings cannot be changed --- they are :term:`immutable`. Therefore, assigning to an indexed position in the string results in an error::" +#, fuzzy +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` هستند. " +"بنابراین، انتساب به یک موقعیت ایندکس شده در رشته منجر به خطا می شود::" #: tutorial/introduction.rst:338 -msgid ">>> word[0] = 'J'\n" +#, fuzzy +msgid "" +">>> word[0] = 'J'\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: 'str' object does not support item assignment\n" @@ -403,134 +835,246 @@ msgid ">>> word[0] = 'J'\n" " File \"\", line 1, in \n" "TypeError: 'str' object does not support item assignment" msgstr "" +">>> کلمه[0] = 'J'\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: شیء 'str' از انتساب آیتم پشتیبانی نمی کند\n" +">>> word[2:] = 'py'\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +"TypeError: شیء 'str' از انتساب آیتم پشتیبانی نمی کند" #: tutorial/introduction.rst:347 +#, fuzzy msgid "If you need a different string, you should create a new one::" -msgstr "" +msgstr "اگر به رشته دیگری نیاز دارید، باید رشته جدیدی ایجاد کنید:" #: tutorial/introduction.rst:349 -msgid ">>> 'J' + word[1:]\n" +#, fuzzy +msgid "" +">>> 'J' + word[1:]\n" "'Jython'\n" ">>> word[:2] + 'py'\n" "'Pypy'" msgstr "" +">>> 'J' + word[1:]\n" +"'Jython'\n" +">>> word[:2] + 'py'\n" +"'Pypy'" #: tutorial/introduction.rst:354 +#, fuzzy msgid "The built-in function :func:`len` returns the length of a string::" -msgstr "" +msgstr "تابع داخلی :func:`len` طول یک رشته را برمی گرداند:" #: tutorial/introduction.rst:356 -msgid ">>> s = 'supercalifragilisticexpialidocious'\n" +#, fuzzy +msgid "" +">>> s = 'supercalifragilisticexpialidocious'\n" ">>> len(s)\n" "34" msgstr "" +">>> s = 'supercalifragilisticexpialidocious'\n" +">>> len(s)\n" +"34" #: tutorial/introduction.rst:363 +#, fuzzy msgid ":ref:`textseq`" -msgstr "" +msgstr ":ref:`textseq`" #: tutorial/introduction.rst:364 -msgid "Strings are examples of *sequence types*, and support the common operations supported by such types." +#, fuzzy +msgid "" +"Strings are examples of *sequence types*, and support the common operations " +"supported by such types." msgstr "" +"رشته ها نمونه هایی از *sequence types* هستند و از عملیات رایج پشتیبانی شده " +"توسط چنین انواعی پشتیبانی می کنند." #: tutorial/introduction.rst:367 +#, fuzzy msgid ":ref:`string-methods`" -msgstr "" +msgstr ":ref:`string-methods`" #: tutorial/introduction.rst:368 -msgid "Strings support a large number of methods for basic transformations and searching." +#, fuzzy +msgid "" +"Strings support a large number of methods for basic transformations and " +"searching." msgstr "" +"رشته ها از تعداد زیادی روش برای تبدیل های اساسی و جستجو پشتیبانی می کنند." #: tutorial/introduction.rst:371 +#, fuzzy msgid ":ref:`f-strings`" -msgstr "" +msgstr ":ref:`f-strings`" #: tutorial/introduction.rst:372 +#, fuzzy msgid "String literals that have embedded expressions." -msgstr "" +msgstr "لفظ رشته ای که عبارات تعبیه شده دارند." #: tutorial/introduction.rst:374 +#, fuzzy msgid ":ref:`formatstrings`" -msgstr "" +msgstr ":ref:`formatstrings`" #: tutorial/introduction.rst:375 +#, fuzzy msgid "Information about string formatting with :meth:`str.format`." -msgstr "" +msgstr "اطلاعاتی در مورد قالب بندی رشته با :meth:`str.format`." #: tutorial/introduction.rst:377 +#, fuzzy msgid ":ref:`old-string-formatting`" -msgstr "" +msgstr ":ref:`old-string-formatting`" #: tutorial/introduction.rst:378 -msgid "The old formatting operations invoked when strings are the left operand of the ``%`` operator are described in more detail here." +#, fuzzy +msgid "" +"The old formatting operations invoked when strings are the left operand of " +"the ``%`` operator are described in more detail here." msgstr "" +"عملیات قالب‌بندی قدیمی که زمانی که رشته‌ها عملوند سمت چپ عملگر ``%`` هستند " +"فراخوانی می‌شوند در اینجا با جزئیات بیشتری توضیح داده شده‌اند." #: tutorial/introduction.rst:385 +#, fuzzy msgid "Lists" -msgstr "" +msgstr "لیست ها" #: tutorial/introduction.rst:387 -msgid "Python knows a number of *compound* data types, used to group together other values. The most versatile is the *list*, which can be written as a list of comma-separated values (items) between square brackets. Lists might contain items of different types, but usually the items all have the same type. ::" -msgstr "" +#, fuzzy +msgid "" +"Python knows a number of *compound* data types, used to group together other" +" values. The most versatile is the *list*, which can be written as a list " +"of comma-separated values (items) between square brackets. Lists might " +"contain items of different types, but usually the items all have the same " +"type. ::" +msgstr "" +"پایتون تعدادی از انواع داده *compound* را می شناسد که برای گروه بندی مقادیر " +"دیگر استفاده می شود. همه کاره ترین *list* است که می تواند به عنوان لیستی از" +" مقادیر (اقلام) جدا شده با کاما بین پرانتز نوشته شود. فهرست ها ممکن است " +"شامل مواردی از انواع مختلف باشند، اما معمولاً همه موارد دارای یک نوع هستند. " +"::" #: tutorial/introduction.rst:392 -msgid ">>> squares = [1, 4, 9, 16, 25]\n" +#, fuzzy +msgid "" +">>> squares = [1, 4, 9, 16, 25]\n" ">>> squares\n" "[1, 4, 9, 16, 25]" msgstr "" +">>> squares = [1, 4, 9, 16, 25]\n" +">>> squares\n" +"[1, 4, 9, 16, 25]" #: tutorial/introduction.rst:396 -msgid "Like strings (and all other built-in :term:`sequence` types), lists can be indexed and sliced::" +#, fuzzy +msgid "" +"Like strings (and all other built-in :term:`sequence` types), lists can be " +"indexed and sliced::" msgstr "" +"مانند رشته ها (و سایر انواع :term:`sequence` داخلی), لیست ها را می توان " +"ایندکس و برش داد:" #: tutorial/introduction.rst:399 -msgid ">>> squares[0] # indexing returns the item\n" +#, fuzzy +msgid "" +">>> squares[0] # indexing returns the item\n" "1\n" ">>> squares[-1]\n" "25\n" ">>> squares[-3:] # slicing returns a new list\n" "[9, 16, 25]" msgstr "" +">>> squares[0] # indexing returns the item\n" +"1\n" +">>> squares[-1]\n" +"25\n" +">>> squares[-3:] # slicing returns a new list\n" +"[9, 16, 25]" #: tutorial/introduction.rst:406 +#, fuzzy msgid "Lists also support operations like concatenation::" -msgstr "" +msgstr "لیست ها همچنین از عملیات هایی مانند الحاق::" #: tutorial/introduction.rst:408 -msgid ">>> squares + [36, 49, 64, 81, 100]\n" +#, fuzzy +msgid "" +">>> squares + [36, 49, 64, 81, 100]\n" "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" msgstr "" +">>> squares + [36, 49, 64, 81, 100]\n" +"[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" #: tutorial/introduction.rst:411 -msgid "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` type, i.e. it is possible to change their content::" +#, fuzzy +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` " +"هستند، یعنی می توان محتوای آنها را تغییر داد:" #: tutorial/introduction.rst:414 -msgid ">>> cubes = [1, 8, 27, 65, 125] # something's wrong here\n" +#, fuzzy +msgid "" +">>> cubes = [1, 8, 27, 65, 125] # something's wrong here\n" ">>> 4 ** 3 # the cube of 4 is 64, not 65!\n" "64\n" ">>> cubes[3] = 64 # replace the wrong value\n" ">>> cubes\n" "[1, 8, 27, 64, 125]" msgstr "" +">>> cubes = [1, 8, 27, 65, 125] # something's wrong here\n" +">>> 4 ** 3 # the cube of 4 is 64, not 65!\n" +"64\n" +">>> cubes[3] = 64 # replace the wrong value\n" +">>> cubes\n" +"[1, 8, 27, 64, 125]" #: tutorial/introduction.rst:421 -msgid "You can also add new items at the end of the list, by using the :meth:`!list.append` *method* (we will see more about methods later)::" +#, fuzzy +msgid "" +"You can also add new items at the end of the list, by using the " +":meth:`!list.append` *method* (we will see more about methods later)::" msgstr "" +"همچنین می توانید با استفاده از :meth:`!list.append` *method* موارد جدیدی را " +"در انتهای لیست اضافه کنید (در ادامه بیشتر در مورد روش ها خواهیم دید):" #: tutorial/introduction.rst:424 -msgid ">>> cubes.append(216) # add the cube of 6\n" +#, fuzzy +msgid "" +">>> cubes.append(216) # add the cube of 6\n" ">>> cubes.append(7 ** 3) # and the cube of 7\n" ">>> cubes\n" "[1, 8, 27, 64, 125, 216, 343]" msgstr "" +">>> cubes.append(216) # add the cube of 6\n" +">>> cubes.append(7 ** 3) # and the cube of 7\n" +">>> cubes\n" +"[1, 8, 27, 64, 125, 216, 343]" #: tutorial/introduction.rst:429 -msgid "Simple assignment in Python never copies data. When you assign a list to a variable, the variable refers to the *existing list*. Any changes you make to the list through one variable will be seen through all other variables that refer to it.::" +#, fuzzy +msgid "" +"Simple assignment in Python never copies data. When you assign a list to a " +"variable, the variable refers to the *existing list*. Any changes you make " +"to the list through one variable will be seen through all other variables " +"that refer to it.::" msgstr "" +"انتساب ساده در پایتون هرگز داده ها را کپی نمی کند. وقتی لیستی را به یک متغیر" +" اختصاص می دهید، متغیر به *existing list* اشاره می کند. هر تغییری که از طریق" +" یک متغیر در لیست ایجاد کنید، از طریق سایر متغیرهایی که به آن اشاره می کنند،" +" مشاهده می شود.::" #: tutorial/introduction.rst:434 -msgid ">>> rgb = [\"Red\", \"Green\", \"Blue\"]\n" +#, fuzzy +msgid "" +">>> rgb = [\"Red\", \"Green\", \"Blue\"]\n" ">>> rgba = rgb\n" ">>> id(rgb) == id(rgba) # they reference the same object\n" "True\n" @@ -538,26 +1082,55 @@ msgid ">>> rgb = [\"Red\", \"Green\", \"Blue\"]\n" ">>> rgb\n" "[\"Red\", \"Green\", \"Blue\", \"Alph\"]" msgstr "" +">>> rgb = [\"Red\", \"Green\", \"Blue\"]\n" +">>> rgba = rgb\n" +">>> id(rgb) == id(rgba) # they reference the same object\n" +"True\n" +">>> rgba.append(\"Alph\")\n" +">>> rgb\n" +"[\"Red\", \"Green\", \"Blue\", \"Alph\"]" #: tutorial/introduction.rst:442 -msgid "All slice operations return a new list containing the requested elements. This means that the following slice returns a :ref:`shallow copy ` of the list::" +#, fuzzy +msgid "" +"All slice operations return a new list containing the requested elements. " +"This means that the following slice returns a :ref:`shallow copy " +"` of the list::" msgstr "" +"تمام عملیات برش یک لیست جدید حاوی عناصر درخواستی را برمی گرداند. این بدان " +"معنی است که برش زیر یک :ref:`shallow copy ` از لیست را" +" برمی گرداند:" #: tutorial/introduction.rst:446 -msgid ">>> correct_rgba = rgba[:]\n" +#, fuzzy +msgid "" +">>> correct_rgba = rgba[:]\n" ">>> correct_rgba[-1] = \"Alpha\"\n" ">>> correct_rgba\n" "[\"Red\", \"Green\", \"Blue\", \"Alpha\"]\n" ">>> rgba\n" "[\"Red\", \"Green\", \"Blue\", \"Alph\"]" msgstr "" +">>> correct_rgba = rgba[:]\n" +">>> correct_rgba[-1] = \"Alpha\"\n" +">>> correct_rgba\n" +"[\"Red\", \"Green\", \"Blue\", \"Alpha\"]\n" +">>> rgba\n" +"[\"Red\", \"Green\", \"Blue\", \"Alph\"]" #: tutorial/introduction.rst:453 -msgid "Assignment to slices is also possible, and this can even change the size of the list or clear it entirely::" +#, fuzzy +msgid "" +"Assignment to slices is also possible, and this can even change the size of " +"the list or clear it entirely::" msgstr "" +"تخصیص به برش ها نیز امکان پذیر است، و این حتی می تواند اندازه لیست را تغییر " +"دهد یا آن را به طور کامل پاک کند::" #: tutorial/introduction.rst:456 -msgid ">>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" +#, fuzzy +msgid "" +">>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" ">>> letters\n" "['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" ">>> # replace some values\n" @@ -573,23 +1146,51 @@ msgid ">>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" ">>> letters\n" "[]" msgstr "" +">>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" +">>> letters\n" +"['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" +">>> # replace some values\n" +">>> letters[2:5] = ['C', 'D', 'E']\n" +">>> letters\n" +"['a', 'b', 'C', 'D', 'E', 'f', 'g']\n" +">>> # now remove them\n" +">>> letters[2:5] = []\n" +">>> letters\n" +"['a', 'b', 'f', 'g']\n" +">>> # clear the list by replacing all the elements with an empty list\n" +">>> letters[:] = []\n" +">>> letters\n" +"[]" #: tutorial/introduction.rst:472 +#, fuzzy msgid "The built-in function :func:`len` also applies to lists::" -msgstr "" +msgstr "تابع داخلی :func:`len` همچنین برای لیست ها اعمال می شود:" #: tutorial/introduction.rst:474 -msgid ">>> letters = ['a', 'b', 'c', 'd']\n" +#, fuzzy +msgid "" +">>> letters = ['a', 'b', 'c', 'd']\n" ">>> len(letters)\n" "4" msgstr "" +">>> letters = ['a', 'b', 'c', 'd']\n" +">>> len(letters)\n" +"4" #: tutorial/introduction.rst:478 -msgid "It is possible to nest lists (create lists containing other lists), for example::" +#, fuzzy +msgid "" +"It is possible to nest lists (create lists containing other lists), for " +"example::" msgstr "" +"امکان تودرتو کردن لیست ها (ایجاد لیست های حاوی لیست های دیگر) وجود دارد، به " +"عنوان مثال::" #: tutorial/introduction.rst:481 -msgid ">>> a = ['a', 'b', 'c']\n" +#, fuzzy +msgid "" +">>> a = ['a', 'b', 'c']\n" ">>> n = [1, 2, 3]\n" ">>> x = [a, n]\n" ">>> x\n" @@ -599,17 +1200,37 @@ msgid ">>> a = ['a', 'b', 'c']\n" ">>> x[0][1]\n" "'b'" msgstr "" +">>> a = ['a', 'b', 'c']\n" +">>> n = [1, 2, 3]\n" +">>> x = [a, n]\n" +">>> x\n" +"[['a', 'b', 'c'], [1, 2, 3]]\n" +">>> x[0]\n" +"['a', 'b', 'c']\n" +">>> x[0][1]\n" +"'b'" #: tutorial/introduction.rst:494 +#, fuzzy msgid "First Steps Towards Programming" -msgstr "" +msgstr "اولین قدم به سوی برنامه نویسی" #: tutorial/introduction.rst:496 -msgid "Of course, we can use Python for more complicated tasks than adding two and two together. For instance, we can write an initial sub-sequence of the `Fibonacci series `_ as follows::" +#, fuzzy +msgid "" +"Of course, we can use Python for more complicated tasks than adding two and " +"two together. For instance, we can write an initial sub-sequence of the " +"`Fibonacci series `_ as " +"follows::" msgstr "" +"البته ما می‌توانیم از پایتون برای کارهای پیچیده‌تر از جمع کردن دو و دو با هم" +" استفاده کنیم. برای مثال، می‌توانیم زیر دنباله اولیه `Fibonacci series " +"`_ را به صورت زیر بنویسیم:" #: tutorial/introduction.rst:501 -msgid ">>> # Fibonacci series:\n" +#, fuzzy +msgid "" +">>> # Fibonacci series:\n" ">>> # the sum of two elements defines the next\n" ">>> a, b = 0, 1\n" ">>> while a < 10:\n" @@ -624,62 +1245,169 @@ msgid ">>> # Fibonacci series:\n" "5\n" "8" msgstr "" +">>> # Fibonacci series:\n" +">>> # the sum of two elements defines the next\n" +">>> a, b = 0, 1\n" +">>> while a < 10:\n" +"... print(a)\n" +"... a, b = b, a+b\n" +"...\n" +"0\n" +"1\n" +"1\n" +"2\n" +"3\n" +"5\n" +"8" #: tutorial/introduction.rst:516 +#, fuzzy msgid "This example introduces several new features." -msgstr "" +msgstr "این مثال چندین ویژگی جدید را معرفی می کند." #: tutorial/introduction.rst:518 -msgid "The first line contains a *multiple assignment*: the variables ``a`` and ``b`` simultaneously get the new values 0 and 1. On the last line this is used again, demonstrating that the expressions on the right-hand side are all evaluated first before any of the assignments take place. The right-hand side expressions are evaluated from the left to the right." +#, fuzzy +msgid "" +"The first line contains a *multiple assignment*: the variables ``a`` and " +"``b`` simultaneously get the new values 0 and 1. On the last line this is " +"used again, demonstrating that the expressions on the right-hand side are " +"all evaluated first before any of the assignments take place. The right-" +"hand side expressions are evaluated from the left to the right." msgstr "" +"خط اول حاوی یک *multiple assignment* است: متغیرهای ``a`` و ``b`` به طور " +"همزمان مقادیر جدید 0 و 1 را دریافت می کنند. در خط آخر دوباره از این استفاده " +"می شود و نشان می دهد که عبارات سمت راست قبل از انجام هر یک از تخصیص ها ابتدا" +" ارزیابی می شوند. عبارات سمت راست از چپ به راست ارزیابی می شوند." #: tutorial/introduction.rst:524 -msgid "The :keyword:`while` loop executes as long as the condition (here: ``a < 10``) remains true. In Python, like in C, any non-zero integer value is true; zero is false. The condition may also be a string or list value, in fact any sequence; anything with a non-zero length is true, empty sequences are false. The test used in the example is a simple comparison. The standard comparison operators are written the same as in C: ``<`` (less than), ``>`` (greater than), ``==`` (equal to), ``<=`` (less than or equal to), ``>=`` (greater than or equal to) and ``!=`` (not equal to)." -msgstr "" +#, fuzzy +msgid "" +"The :keyword:`while` loop executes as long as the condition (here: ``a < " +"10``) remains true. In Python, like in C, any non-zero integer value is " +"true; zero is false. The condition may also be a string or list value, in " +"fact any sequence; anything with a non-zero length is true, empty sequences " +"are false. The test used in the example is a simple comparison. The " +"standard comparison operators are written the same as in C: ``<`` (less " +"than), ``>`` (greater than), ``==`` (equal to), ``<=`` (less than or equal " +"to), ``>=`` (greater than or equal to) and ``!=`` (not equal to)." +msgstr "" +"حلقه :keyword:`while` تا زمانی اجرا می شود که شرط (در اینجا: ``a < 10``) " +"درست باقی بماند. در پایتون، مانند C، هر عدد صحیح غیر صفر درست است. صفر " +"نادرست است شرط همچنین ممکن است یک مقدار رشته یا لیست، در واقع هر دنباله ای " +"باشد. هر چیزی با طول غیر صفر درست است، دنباله های خالی نادرست هستند. تست " +"استفاده شده در مثال یک مقایسه ساده است. عملگرهای مقایسه استاندارد مانند C " +"نوشته می شوند: ``<`` (کمتر از)، ``>`` (بزرگتر از)، ``==`` (برابر)، ``<=`` " +"(کمتر یا مساوی)، ``>=`` (بزرگتر یا مساوی) و ``!=`` (نه برابر)." #: tutorial/introduction.rst:533 -msgid "The *body* of the loop is *indented*: indentation is Python's way of grouping statements. At the interactive prompt, you have to type a tab or space(s) for each indented line. In practice you will prepare more complicated input for Python with a text editor; all decent text editors have an auto-indent facility. When a compound statement is entered interactively, it must be followed by a blank line to indicate completion (since the parser cannot guess when you have typed the last line). Note that each line within a basic block must be indented by the same amount." -msgstr "" +#, fuzzy +msgid "" +"The *body* of the loop is *indented*: indentation is Python's way of " +"grouping statements. At the interactive prompt, you have to type a tab or " +"space(s) for each indented line. In practice you will prepare more " +"complicated input for Python with a text editor; all decent text editors " +"have an auto-indent facility. When a compound statement is entered " +"interactively, it must be followed by a blank line to indicate completion " +"(since the parser cannot guess when you have typed the last line). Note " +"that each line within a basic block must be indented by the same amount." +msgstr "" +"*body* حلقه *indented* است: تورفتگی روش پایتون برای گروه بندی عبارات است. " +"در اعلان تعاملی، باید یک برگه یا فاصله (ها) را برای هر خط تورفتگی تایپ کنید." +" در عمل با یک ویرایشگر متن ورودی پیچیده تری را برای پایتون آماده خواهید " +"کرد. همه ویرایشگرهای متن مناسب دارای قابلیت تورفتگی خودکار هستند. هنگامی که" +" یک عبارت ترکیبی به صورت تعاملی وارد می شود، باید یک خط خالی برای نشان دادن " +"تکمیل شدن دنبال شود (زیرا تجزیه کننده نمی تواند حدس بزند که آخرین خط را چه " +"زمانی تایپ کرده اید). توجه داشته باشید که هر خط در یک بلوک اصلی باید به " +"همان میزان فرورفته باشد." #: tutorial/introduction.rst:542 -msgid "The :func:`print` function writes the value of the argument(s) it is given. It differs from just writing the expression you want to write (as we did earlier in the calculator examples) in the way it handles multiple arguments, floating-point quantities, and strings. Strings are printed without quotes, and a space is inserted between items, so you can format things nicely, like this::" -msgstr "" +#, fuzzy +msgid "" +"The :func:`print` function writes the value of the argument(s) it is given. " +"It differs from just writing the expression you want to write (as we did " +"earlier in the calculator examples) in the way it handles multiple " +"arguments, floating-point quantities, and strings. Strings are printed " +"without quotes, and a space is inserted between items, so you can format " +"things nicely, like this::" +msgstr "" +"تابع :func:`print` مقدار آرگومان(های) داده شده را می نویسد. با نوشتن عبارتی " +"که می‌خواهید بنویسید (همانطور که قبلاً در مثال‌های ماشین‌حساب انجام دادیم) " +"در نحوه مدیریت چندین آرگومان، کمیت‌های ممیز شناور و رشته‌ها متفاوت است. " +"رشته ها بدون نقل قول چاپ می شوند و یک فاصله بین موارد درج می شود، بنابراین " +"می توانید موارد را به خوبی قالب بندی کنید، مانند:" #: tutorial/introduction.rst:549 -msgid ">>> i = 256*256\n" +#, fuzzy +msgid "" +">>> i = 256*256\n" ">>> print('The value of i is', i)\n" "The value of i is 65536" msgstr "" +">>> i = 256*256\n" +">>> print('مقدار i است', i)\n" +"مقدار i 65536 است" #: tutorial/introduction.rst:553 -msgid "The keyword argument *end* can be used to avoid the newline after the output, or end the output with a different string::" +#, fuzzy +msgid "" +"The keyword argument *end* can be used to avoid the newline after the " +"output, or end the output with a different string::" msgstr "" +"آرگومان کلمه کلیدی *end* را می توان برای اجتناب از خط جدید بعد از خروجی " +"استفاده کرد یا خروجی را با رشته ای متفاوت خاتمه داد:" #: tutorial/introduction.rst:556 -msgid ">>> a, b = 0, 1\n" +#, fuzzy +msgid "" +">>> a, b = 0, 1\n" ">>> while a < 1000:\n" "... print(a, end=',')\n" "... a, b = b, a+b\n" "...\n" "0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987," msgstr "" +">>> a, b = 0, 1\n" +">>> while a < 1000:\n" +"... print(a, end=',')\n" +"... a, b = b, a+b\n" +"...\n" +"0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987," #: tutorial/introduction.rst:565 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/introduction.rst:566 -msgid "Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you can use ``(-3)**2``." +#, fuzzy +msgid "" +"Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted" +" as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you" +" can use ``(-3)**2``." msgstr "" +"از آنجایی که ``**`` اولویت بیشتری نسبت به ``-`` دارد، ``-3**2`` به عنوان " +"``-(3**2)`` تفسیر می شود و بنابراین منجر به ``-9`` می شود. برای جلوگیری از " +"این امر و دریافت ``9``، می توانید از ``(-3)**2`` استفاده کنید." #: tutorial/introduction.rst:570 -msgid "Unlike other languages, special characters such as ``\\n`` have the same meaning with both single (``'...'``) and double (``\"...\"``) quotes. The only difference between the two is that within single quotes you don't need to escape ``\"`` (but you have to escape ``\\'``) and vice versa." +#, fuzzy +msgid "" +"Unlike other languages, special characters such as ``\\n`` have the same " +"meaning with both single (``'...'``) and double (``\"...\"``) quotes. The " +"only difference between the two is that within single quotes you don't need " +"to escape ``\"`` (but you have to escape ``\\'``) and vice versa." msgstr "" +"بر خلاف زبان های دیگر، کاراکترهای ویژه مانند ``\\n`` با هر دو نقل قول تک " +"(``'...'``) و دو (``\"...\"``) معنی یکسانی دارند. تنها تفاوت بین این دو این " +"است که در داخل نقل قول های تک نیازی به فرار از ``\"`` ندارید (اما باید از " +"``\\'`` فرار کنید) و بالعکس." #: tutorial/introduction.rst:21 +#, fuzzy msgid "# (hash)" -msgstr "" +msgstr "# (hash)" #: tutorial/introduction.rst:21 +#, fuzzy msgid "comment" -msgstr "" +msgstr "نظر دادن" diff --git a/tutorial/modules.po b/tutorial/modules.po index d1378f1f..21ce5f21 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -17,23 +17,66 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/modules.rst:5 +#, fuzzy msgid "Modules" -msgstr "" +msgstr "ماژول ها" #: tutorial/modules.rst:7 -msgid "If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Therefore, if you want to write a somewhat longer program, you are better off using a text editor to prepare the input for the interpreter and running it with that file as input instead. This is known as creating a *script*. As your program gets longer, you may want to split it into several files for easier maintenance. You may also want to use a handy function that you've written in several programs without copying its definition into each program." -msgstr "" +#, fuzzy +msgid "" +"If you quit from the Python interpreter and enter it again, the definitions " +"you have made (functions and variables) are lost. Therefore, if you want to " +"write a somewhat longer program, you are better off using a text editor to " +"prepare the input for the interpreter and running it with that file as input" +" instead. This is known as creating a *script*. As your program gets " +"longer, you may want to split it into several files for easier maintenance." +" You may also want to use a handy function that you've written in several " +"programs without copying its definition into each program." +msgstr "" +"اگر از مفسر پایتون خارج شوید و دوباره آن را وارد کنید، تعاریفی که ساخته اید " +"(توابع و متغیرها) از بین می روند. بنابراین، اگر می‌خواهید یک برنامه " +"طولانی‌تر بنویسید، بهتر است از یک ویرایشگر متن برای آماده کردن ورودی برای " +"مفسر استفاده کنید و آن را با آن فایل به‌عنوان ورودی اجرا کنید. این به عنوان" +" ایجاد *script* شناخته می شود. همانطور که برنامه شما طولانی تر می شود، ممکن" +" است بخواهید برای نگهداری آسان تر آن را به چندین فایل تقسیم کنید. همچنین " +"ممکن است بخواهید از یک تابع مفیدی که در چندین برنامه نوشته اید بدون کپی کردن" +" تعریف آن در هر برنامه استفاده کنید." #: tutorial/modules.rst:16 -msgid "To support this, Python has a way to put definitions in a file and use them in a script or in an interactive instance of the interpreter. Such a file is called a *module*; definitions from a module can be *imported* into other modules or into the *main* module (the collection of variables that you have access to in a script executed at the top level and in calculator mode)." -msgstr "" +#, fuzzy +msgid "" +"To support this, Python has a way to put definitions in a file and use them " +"in a script or in an interactive instance of the interpreter. Such a file is" +" called a *module*; definitions from a module can be *imported* into other " +"modules or into the *main* module (the collection of variables that you have" +" access to in a script executed at the top level and in calculator mode)." +msgstr "" +"برای پشتیبانی از این موضوع، پایتون راهی برای قرار دادن تعاریف در یک فایل و " +"استفاده از آنها در یک اسکریپت یا در یک نمونه تعاملی از مفسر دارد. چنین فایلی" +" *module* نامیده می شود. تعاریف یک ماژول می تواند *imported* به ماژول های " +"دیگر یا به ماژول *main* (مجموعه ای از متغیرهایی که در یک اسکریپت اجرا شده در" +" سطح بالا و در حالت ماشین حساب به آنها دسترسی دارید) باشد." #: tutorial/modules.rst:22 -msgid "A module is a file containing Python definitions and statements. The file name is the module name with the suffix :file:`.py` appended. Within a module, the module's name (as a string) is available as the value of the global variable ``__name__``. For instance, use your favorite text editor to create a file called :file:`fibo.py` in the current directory with the following contents::" -msgstr "" +#, fuzzy +msgid "" +"A module is a file containing Python definitions and statements. The file " +"name is the module name with the suffix :file:`.py` appended. Within a " +"module, the module's name (as a string) is available as the value of the " +"global variable ``__name__``. For instance, use your favorite text editor " +"to create a file called :file:`fibo.py` in the current directory with the " +"following contents::" +msgstr "" +"ماژول فایلی است که شامل تعاریف و عبارات پایتون است. نام فایل، نام ماژول با " +"پسوند :file:`.py` است. در یک ماژول، نام ماژول (به عنوان یک رشته) به عنوان " +"مقدار متغیر جهانی ``__name__`` در دسترس است. به عنوان مثال، از ویرایشگر متن" +" مورد علاقه خود برای ایجاد فایلی به نام :file:`fibo.py` در فهرست فعلی با " +"محتوای زیر استفاده کنید:" #: tutorial/modules.rst:28 -msgid "# Fibonacci numbers module\n" +#, fuzzy +msgid "" +"# Fibonacci numbers module\n" "\n" "def fib(n): # write Fibonacci series up to n\n" " a, b = 0, 1\n" @@ -50,236 +93,572 @@ msgid "# Fibonacci numbers module\n" " a, b = b, a+b\n" " return result" msgstr "" +"# Fibonacci numbers module\n" +"\n" +"def fib(n): # write Fibonacci series up to n\n" +" a, b = 0, 1\n" +" while a < n:\n" +" print(a, end=' ')\n" +" a, b = b, a+b\n" +" print()\n" +"\n" +"def fib2(n): # return Fibonacci series up to n\n" +" result = []\n" +" a, b = 0, 1\n" +" while a < n:\n" +" result.append(a)\n" +" a, b = b, a+b\n" +" return result" #: tutorial/modules.rst:45 -msgid "Now enter the Python interpreter and import this module with the following command::" -msgstr "" +#, fuzzy +msgid "" +"Now enter the Python interpreter and import this module with the following " +"command::" +msgstr "حالا مفسر پایتون را وارد کنید و این ماژول را با دستور زیر وارد کنید:" #: tutorial/modules.rst:48 +#, fuzzy msgid ">>> import fibo" -msgstr "" +msgstr ">>> import fibo" #: tutorial/modules.rst:50 -msgid "This does not add the names of the functions defined in ``fibo`` directly to the current :term:`namespace` (see :ref:`tut-scopes` for more details); it only adds the module name ``fibo`` there. Using the module name you can access the functions::" +#, fuzzy +msgid "" +"This does not add the names of the functions defined in ``fibo`` directly " +"to the current :term:`namespace` (see :ref:`tut-scopes` for more details); " +"it only adds the module name ``fibo`` there. Using the module name you can " +"access the functions::" msgstr "" +"این نام توابع تعریف شده در ``fibo`` را مستقیماً به :term:`namespace` فعلی " +"اضافه نمی کند (برای جزئیات بیشتر به :ref:`tut-scopes` مراجعه کنید). فقط نام " +"ماژول ``fibo`` را در آنجا اضافه می کند. با استفاده از نام ماژول می توانید به" +" توابع دسترسی داشته باشید:" #: tutorial/modules.rst:55 -msgid ">>> fibo.fib(1000)\n" +#, fuzzy +msgid "" +">>> fibo.fib(1000)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987\n" ">>> fibo.fib2(100)\n" "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]\n" ">>> fibo.__name__\n" "'fibo'" msgstr "" +">>> fibo.fib(1000)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987\n" +">>> fibo.fib2 (100)\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]\n" +">>> fibo.__name__\n" +"\"فیبو\"" #: tutorial/modules.rst:62 -msgid "If you intend to use a function often you can assign it to a local name::" +#, fuzzy +msgid "" +"If you intend to use a function often you can assign it to a local name::" msgstr "" +"اگر قصد دارید از یک تابع اغلب استفاده کنید، می توانید آن را به یک نام محلی " +"اختصاص دهید:" #: tutorial/modules.rst:64 -msgid ">>> fib = fibo.fib\n" +#, fuzzy +msgid "" +">>> fib = fibo.fib\n" ">>> fib(500)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" msgstr "" +">>> fib = fibo.fib\n" +">>> fib (500)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" #: tutorial/modules.rst:72 +#, fuzzy msgid "More on Modules" -msgstr "" +msgstr "اطلاعات بیشتر در مورد ماژول ها" #: tutorial/modules.rst:74 -msgid "A module can contain executable statements as well as function definitions. These statements are intended to initialize the module. They are executed only the *first* time the module name is encountered in an import statement. [#]_ (They are also run if the file is executed as a script.)" +#, fuzzy +msgid "" +"A module can contain executable statements as well as function definitions. " +"These statements are intended to initialize the module. They are executed " +"only the *first* time the module name is encountered in an import statement." +" [#]_ (They are also run if the file is executed as a script.)" msgstr "" +"یک ماژول می تواند شامل دستورات اجرایی و همچنین تعاریف تابع باشد. این عبارات " +"برای مقداردهی اولیه ماژول در نظر گرفته شده است. آنها فقط زمانی اجرا می شوند " +"که نام ماژول در یک دستور import با نام *first* مواجه می شود. [#]_ (اگر فایل " +"به صورت اسکریپت اجرا شود نیز اجرا می شوند.)" #: tutorial/modules.rst:79 -msgid "Each module has its own private namespace, which is used as the global namespace by all functions defined in the module. Thus, the author of a module can use global variables in the module without worrying about accidental clashes with a user's global variables. On the other hand, if you know what you are doing you can touch a module's global variables with the same notation used to refer to its functions, ``modname.itemname``." -msgstr "" +#, fuzzy +msgid "" +"Each module has its own private namespace, which is used as the global " +"namespace by all functions defined in the module. Thus, the author of a " +"module can use global variables in the module without worrying about " +"accidental clashes with a user's global variables. On the other hand, if you" +" know what you are doing you can touch a module's global variables with the " +"same notation used to refer to its functions, ``modname.itemname``." +msgstr "" +"هر ماژول فضای نام خصوصی خود را دارد که به عنوان فضای نام جهانی توسط تمام " +"توابع تعریف شده در ماژول استفاده می شود. بنابراین، نویسنده یک ماژول می تواند" +" از متغیرهای سراسری در ماژول استفاده کند بدون اینکه نگران برخورد تصادفی با " +"متغیرهای سراسری کاربر باشد. از سوی دیگر، اگر می‌دانید چه کار می‌کنید، " +"می‌توانید متغیرهای سراسری یک ماژول را با همان نمادی که برای اشاره به عملکرد " +"آن، ``modname.itemname`` استفاده می‌شود، لمس کنید." #: tutorial/modules.rst:86 -msgid "Modules can import other modules. It is customary but not required to place all :keyword:`import` statements at the beginning of a module (or script, for that matter). The imported module names, if placed at the top level of a module (outside any functions or classes), are added to the module's global namespace." +#, fuzzy +msgid "" +"Modules can import other modules. It is customary but not required to place" +" all :keyword:`import` statements at the beginning of a module (or script, " +"for that matter). The imported module names, if placed at the top level of " +"a module (outside any functions or classes), are added to the module's " +"global namespace." msgstr "" +"ماژول ها می توانند ماژول های دیگر را وارد کنند. قرار دادن تمام عبارات " +":keyword:`import` در ابتدای یک ماژول (یا اسکریپت) مرسوم است، اما لازم نیست." +" نام‌های ماژول وارد شده، اگر در سطح بالای یک ماژول (خارج از هر توابع یا " +"کلاس) قرار گیرند، به فضای نام جهانی ماژول اضافه می‌شوند." #: tutorial/modules.rst:91 -msgid "There is a variant of the :keyword:`import` statement that imports names from a module directly into the importing module's namespace. For example::" +#, fuzzy +msgid "" +"There is a variant of the :keyword:`import` statement that imports names " +"from a module directly into the importing module's namespace. For example::" msgstr "" +"گونه‌ای از عبارت :keyword:`import` وجود دارد که نام‌ها را از یک ماژول " +"مستقیماً به فضای نام ماژول واردکننده وارد می‌کند. به عنوان مثال::" #: tutorial/modules.rst:94 -msgid ">>> from fibo import fib, fib2\n" +#, fuzzy +msgid "" +">>> from fibo import fib, fib2\n" ">>> fib(500)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" msgstr "" +">>> از fibo import fib, fib2\n" +">>> fib (500)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" #: tutorial/modules.rst:98 -msgid "This does not introduce the module name from which the imports are taken in the local namespace (so in the example, ``fibo`` is not defined)." +#, fuzzy +msgid "" +"This does not introduce the module name from which the imports are taken in " +"the local namespace (so in the example, ``fibo`` is not defined)." msgstr "" +"این نام ماژول را که واردات از آن در فضای نام محلی گرفته شده است معرفی نمی " +"کند (بنابراین در مثال, ``fibo`` تعریف نشده است)." #: tutorial/modules.rst:101 +#, fuzzy msgid "There is even a variant to import all names that a module defines::" msgstr "" +"حتی یک نوع برای وارد کردن همه نام هایی که یک ماژول تعریف می کند وجود دارد:" #: tutorial/modules.rst:103 -msgid ">>> from fibo import *\n" +#, fuzzy +msgid "" +">>> from fibo import *\n" ">>> fib(500)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" msgstr "" +">>> از واردات فیبو *\n" +">>> fib (500)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" #: tutorial/modules.rst:107 -msgid "This imports all names except those beginning with an underscore (``_``). In most cases Python programmers do not use this facility since it introduces an unknown set of names into the interpreter, possibly hiding some things you have already defined." +#, fuzzy +msgid "" +"This imports all names except those beginning with an underscore (``_``). In" +" most cases Python programmers do not use this facility since it introduces " +"an unknown set of names into the interpreter, possibly hiding some things " +"you have already defined." msgstr "" +"این همه نام‌ها را وارد می‌کند، به جز نام‌هایی که با زیرخط (``_``) شروع " +"می‌شوند. در بیشتر موارد برنامه نویسان پایتون از این امکان استفاده نمی کنند " +"زیرا مجموعه ای ناشناخته از نام ها را در مفسر معرفی می کند و احتمالاً برخی از" +" مواردی را که قبلاً تعریف کرده اید پنهان می کند." #: tutorial/modules.rst:112 -msgid "Note that in general the practice of importing ``*`` from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions." +#, fuzzy +msgid "" +"Note that in general the practice of importing ``*`` from a module or " +"package is frowned upon, since it often causes poorly readable code. " +"However, it is okay to use it to save typing in interactive sessions." msgstr "" +"توجه داشته باشید که به طور کلی عمل وارد کردن ``*`` از یک ماژول یا بسته مورد " +"انتقاد قرار می گیرد، زیرا اغلب باعث کدهای ناخوانا می شود. با این حال، " +"استفاده از آن برای ذخیره تایپ در جلسات تعاملی اشکالی ندارد." #: tutorial/modules.rst:116 -msgid "If the module name is followed by :keyword:`!as`, then the name following :keyword:`!as` is bound directly to the imported module." +#, fuzzy +msgid "" +"If the module name is followed by :keyword:`!as`, then the name following " +":keyword:`!as` is bound directly to the imported module." msgstr "" +"اگر نام ماژول با :keyword:`!as` دنبال شود، نام زیر :keyword:`!as` مستقیماً " +"به ماژول وارد شده متصل می شود." #: tutorial/modules.rst:121 -msgid ">>> import fibo as fib\n" +#, fuzzy +msgid "" +">>> import fibo as fib\n" ">>> fib.fib(500)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" msgstr "" +">>> فیبو را به عنوان فیب وارد کنید\n" +">>> fib.fib(500)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" #: tutorial/modules.rst:125 -msgid "This is effectively importing the module in the same way that ``import fibo`` will do, with the only difference of it being available as ``fib``." +#, fuzzy +msgid "" +"This is effectively importing the module in the same way that ``import " +"fibo`` will do, with the only difference of it being available as ``fib``." msgstr "" +"این عملاً ماژول را به همان روشی که ``import fibo`` انجام می دهد وارد می کند،" +" با تنها تفاوت آن در دسترس بودن به عنوان ``fib``." #: tutorial/modules.rst:128 -msgid "It can also be used when utilising :keyword:`from` with similar effects::" +#, fuzzy +msgid "" +"It can also be used when utilising :keyword:`from` with similar effects::" msgstr "" +"همچنین می توان از آن در هنگام استفاده از :keyword:`from` با اثرات مشابه " +"استفاده کرد:" #: tutorial/modules.rst:130 -msgid ">>> from fibo import fib as fibonacci\n" +#, fuzzy +msgid "" +">>> from fibo import fib as fibonacci\n" ">>> fibonacci(500)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" msgstr "" +">>> از fibo import fib به عنوان فیبوناچی\n" +">>> فیبوناچی (500)\n" +"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377" #: tutorial/modules.rst:137 -msgid "For efficiency reasons, each module is only imported once per interpreter session. Therefore, if you change your modules, you must restart the interpreter -- or, if it's just one module you want to test interactively, use :func:`importlib.reload`, e.g. ``import importlib; importlib.reload(modulename)``." -msgstr "" +#, fuzzy +msgid "" +"For efficiency reasons, each module is only imported once per interpreter " +"session. Therefore, if you change your modules, you must restart the " +"interpreter -- or, if it's just one module you want to test interactively, " +"use :func:`importlib.reload`, e.g. ``import importlib; " +"importlib.reload(modulename)``." +msgstr "" +"به دلایل کارایی، هر ماژول فقط یک بار در هر جلسه مترجم وارد می شود. " +"بنابراین، اگر ماژول‌های خود را تغییر می‌دهید، باید مفسر را مجدداً راه‌اندازی" +" کنید - یا اگر فقط یک ماژول است که می‌خواهید به صورت تعاملی آزمایش کنید، از " +":func:`importlib.reload` استفاده کنید، به عنوان مثال. ``import importlib; " +"importlib.reload(modulename)``." #: tutorial/modules.rst:147 +#, fuzzy msgid "Executing modules as scripts" -msgstr "" +msgstr "اجرای ماژول ها به صورت اسکریپت" #: tutorial/modules.rst:149 +#, fuzzy msgid "When you run a Python module with ::" -msgstr "" +msgstr "وقتی ماژول پایتون را با ::" #: tutorial/modules.rst:151 +#, fuzzy msgid "python fibo.py " -msgstr "" +msgstr "python fibo.py " #: tutorial/modules.rst:153 -msgid "the code in the module will be executed, just as if you imported it, but with the ``__name__`` set to ``\"__main__\"``. That means that by adding this code at the end of your module::" +#, fuzzy +msgid "" +"the code in the module will be executed, just as if you imported it, but " +"with the ``__name__`` set to ``\"__main__\"``. That means that by adding " +"this code at the end of your module::" msgstr "" +"کد موجود در ماژول اجرا می شود، درست مثل اینکه شما آن را وارد کرده اید، اما " +"با ``__name__`` روی ``\"__main__\"`` تنظیم شده است. یعنی با اضافه کردن این " +"کد در انتهای ماژول:" #: tutorial/modules.rst:157 -msgid "if __name__ == \"__main__\":\n" +#, fuzzy +msgid "" +"if __name__ == \"__main__\":\n" " import sys\n" " fib(int(sys.argv[1]))" msgstr "" +"if __name__ == \"__main__\":\n" +" import sys\n" +" fib(int(sys.argv[1]))" #: tutorial/modules.rst:161 -msgid "you can make the file usable as a script as well as an importable module, because the code that parses the command line only runs if the module is executed as the \"main\" file:" +#, fuzzy +msgid "" +"you can make the file usable as a script as well as an importable module, " +"because the code that parses the command line only runs if the module is " +"executed as the \"main\" file:" msgstr "" +"شما می توانید فایل را به عنوان یک اسکریپت و همچنین به عنوان یک ماژول قابل " +"واردات قابل استفاده کنید، زیرا کدی که خط فرمان را تجزیه می کند تنها در صورتی" +" اجرا می شود که ماژول به عنوان فایل \"اصلی\" اجرا شود:" #: tutorial/modules.rst:165 -msgid "$ python fibo.py 50\n" +#, fuzzy +msgid "" +"$ python fibo.py 50\n" "0 1 1 2 3 5 8 13 21 34" msgstr "" +"$ python fibo.py 50\n" +"0 1 1 2 3 5 8 13 21 34" #: tutorial/modules.rst:170 +#, fuzzy msgid "If the module is imported, the code is not run::" -msgstr "" +msgstr "اگر ماژول وارد شود، کد اجرا نمی شود::" #: tutorial/modules.rst:172 -msgid ">>> import fibo\n" +#, fuzzy +msgid "" +">>> import fibo\n" ">>>" msgstr "" +">>> واردات فیبو\n" +">>>" #: tutorial/modules.rst:175 -msgid "This is often used either to provide a convenient user interface to a module, or for testing purposes (running the module as a script executes a test suite)." +#, fuzzy +msgid "" +"This is often used either to provide a convenient user interface to a " +"module, or for testing purposes (running the module as a script executes a " +"test suite)." msgstr "" +"این اغلب برای ارائه یک رابط کاربری مناسب به یک ماژول یا برای اهداف آزمایشی " +"استفاده می شود (اجرای ماژول به عنوان یک اسکریپت یک مجموعه آزمایشی را اجرا می" +" کند)." #: tutorial/modules.rst:182 +#, fuzzy msgid "The Module Search Path" -msgstr "" +msgstr "مسیر جستجوی ماژول" #: tutorial/modules.rst:186 -msgid "When a module named :mod:`!spam` is imported, the interpreter first searches for a built-in module with that name. These module names are listed in :data:`sys.builtin_module_names`. If not found, it then searches for a file named :file:`spam.py` in a list of directories given by the variable :data:`sys.path`. :data:`sys.path` is initialized from these locations:" -msgstr "" +#, fuzzy +msgid "" +"When a module named :mod:`!spam` is imported, the interpreter first searches" +" for a built-in module with that name. These module names are listed in " +":data:`sys.builtin_module_names`. If not found, it then searches for a file " +"named :file:`spam.py` in a list of directories given by the variable " +":data:`sys.path`. :data:`sys.path` is initialized from these locations:" +msgstr "" +"هنگامی که یک ماژول به نام :mod:`!spam` وارد می شود، مفسر ابتدا ماژول داخلی " +"با آن نام را جستجو می کند. نام این ماژول ها در " +":data:`sys.builtin_module_names` ذکر شده است. اگر پیدا نشد، سپس فایلی به نام" +" :file:`spam.py` را در فهرستی از دایرکتوری های ارائه شده توسط متغیر " +":data:`sys.path` جستجو می کند. :data:`sys.path` از این مکان ها مقداردهی " +"اولیه می شود:" #: tutorial/modules.rst:192 -msgid "The directory containing the input script (or the current directory when no file is specified)." +#, fuzzy +msgid "" +"The directory containing the input script (or the current directory when no " +"file is specified)." msgstr "" +"دایرکتوری حاوی اسکریپت ورودی (یا دایرکتوری فعلی وقتی هیچ فایلی مشخص نشده " +"است)." #: tutorial/modules.rst:194 -msgid ":envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the shell variable :envvar:`PATH`)." +#, fuzzy +msgid "" +":envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the" +" shell variable :envvar:`PATH`)." msgstr "" +":envvar:`PYTHONPATH` (لیستی از نام دایرکتوری ها, با سینتکس مشابه با متغیر " +"پوسته :envvar:`PATH`)." #: tutorial/modules.rst:196 -msgid "The installation-dependent default (by convention including a ``site-packages`` directory, handled by the :mod:`site` module)." +#, fuzzy +msgid "" +"The installation-dependent default (by convention including a ``site-" +"packages`` directory, handled by the :mod:`site` module)." msgstr "" +"پیش‌فرض وابسته به نصب (طبق قرارداد شامل دایرکتوری ``site-packages`` که توسط " +"ماژول :mod:`site` مدیریت می‌شود)." #: tutorial/modules.rst:199 +#, fuzzy msgid "More details are at :ref:`sys-path-init`." -msgstr "" +msgstr "جزئیات بیشتر در :ref:`sys-path-init` است." #: tutorial/modules.rst:202 -msgid "On file systems which support symlinks, the directory containing the input script is calculated after the symlink is followed. In other words the directory containing the symlink is **not** added to the module search path." +#, fuzzy +msgid "" +"On file systems which support symlinks, the directory containing the input " +"script is calculated after the symlink is followed. In other words the " +"directory containing the symlink is **not** added to the module search path." msgstr "" +"در سیستم های فایلی که از symlink ها پشتیبانی می کنند، دایرکتوری حاوی اسکریپت" +" ورودی پس از دنبال کردن سیم پیوند محاسبه می شود. به عبارت دیگر دایرکتوری " +"حاوی سیم پیوند **not** به مسیر جستجوی ماژول اضافه شده است." #: tutorial/modules.rst:206 -msgid "After initialization, Python programs can modify :data:`sys.path`. The directory containing the script being run is placed at the beginning of the search path, ahead of the standard library path. This means that scripts in that directory will be loaded instead of modules of the same name in the library directory. This is an error unless the replacement is intended. See section :ref:`tut-standardmodules` for more information." -msgstr "" +#, fuzzy +msgid "" +"After initialization, Python programs can modify :data:`sys.path`. The " +"directory containing the script being run is placed at the beginning of the " +"search path, ahead of the standard library path. This means that scripts in " +"that directory will be loaded instead of modules of the same name in the " +"library directory. This is an error unless the replacement is intended. See" +" section :ref:`tut-standardmodules` for more information." +msgstr "" +"پس از مقداردهی اولیه، برنامه های پایتون می توانند :data:`sys.path` را تغییر " +"دهند. دایرکتوری حاوی اسکریپت در حال اجرا در ابتدای مسیر جستجو، جلوتر از " +"مسیر استاندارد کتابخانه قرار می گیرد. این بدان معنی است که اسکریپت های موجود" +" در آن دایرکتوری به جای ماژول هایی با همان نام در فهرست کتابخانه بارگذاری می" +" شوند. این یک خطا است مگر اینکه جایگزینی در نظر گرفته شده باشد. برای " +"اطلاعات بیشتر به بخش :ref:`tut-standardmodules` مراجعه کنید." #: tutorial/modules.rst:219 +#, fuzzy msgid "\"Compiled\" Python files" -msgstr "" +msgstr "فایل های پایتون \"کامپایل شده\"." #: tutorial/modules.rst:221 -msgid "To speed up loading modules, Python caches the compiled version of each module in the ``__pycache__`` directory under the name :file:`module.{version}.pyc`, where the version encodes the format of the compiled file; it generally contains the Python version number. For example, in CPython release 3.3 the compiled version of spam.py would be cached as ``__pycache__/spam.cpython-33.pyc``. This naming convention allows compiled modules from different releases and different versions of Python to coexist." -msgstr "" +#, fuzzy +msgid "" +"To speed up loading modules, Python caches the compiled version of each " +"module in the ``__pycache__`` directory under the name " +":file:`module.{version}.pyc`, where the version encodes the format of the " +"compiled file; it generally contains the Python version number. For " +"example, in CPython release 3.3 the compiled version of spam.py would be " +"cached as ``__pycache__/spam.cpython-33.pyc``. This naming convention " +"allows compiled modules from different releases and different versions of " +"Python to coexist." +msgstr "" +"برای سرعت بخشیدن به بارگذاری ماژول ها، پایتون نسخه کامپایل شده هر ماژول را " +"در فهرست ``__pycache__`` تحت نام :file:`module.{version}.pyc` ذخیره می کند، " +"جایی که نسخه فرمت فایل کامپایل شده را کد می کند. به طور کلی شامل شماره نسخه " +"پایتون است. به عنوان مثال، در نسخه 3.3 CPython، نسخه کامپایل شده spam.py به" +" عنوان ``__pycache__/spam.cpython-33.pyc`` ذخیره می شود. این قرارداد " +"نام‌گذاری به ماژول‌های کامپایل‌شده از نسخه‌های مختلف و نسخه‌های مختلف پایتون" +" اجازه می‌دهد که همزیستی کنند." #: tutorial/modules.rst:229 -msgid "Python checks the modification date of the source against the compiled version to see if it's out of date and needs to be recompiled. This is a completely automatic process. Also, the compiled modules are platform-independent, so the same library can be shared among systems with different architectures." +#, fuzzy +msgid "" +"Python checks the modification date of the source against the compiled " +"version to see if it's out of date and needs to be recompiled. This is a " +"completely automatic process. Also, the compiled modules are platform-" +"independent, so the same library can be shared among systems with different " +"architectures." msgstr "" +"پایتون تاریخ اصلاح منبع را در برابر نسخه کامپایل شده بررسی می کند تا ببیند " +"قدیمی است و نیاز به کامپایل مجدد دارد یا خیر. این یک فرآیند کاملاً خودکار " +"است. همچنین، ماژول های کامپایل شده مستقل از پلتفرم هستند، بنابراین می توان " +"یک کتابخانه را بین سیستم هایی با معماری های مختلف به اشتراک گذاشت." #: tutorial/modules.rst:234 -msgid "Python does not check the cache in two circumstances. First, it always recompiles and does not store the result for the module that's loaded directly from the command line. Second, it does not check the cache if there is no source module. To support a non-source (compiled only) distribution, the compiled module must be in the source directory, and there must not be a source module." -msgstr "" +#, fuzzy +msgid "" +"Python does not check the cache in two circumstances. First, it always " +"recompiles and does not store the result for the module that's loaded " +"directly from the command line. Second, it does not check the cache if " +"there is no source module. To support a non-source (compiled only) " +"distribution, the compiled module must be in the source directory, and there" +" must not be a source module." +msgstr "" +"پایتون در دو حالت کش را بررسی نمی کند. اول، همیشه دوباره کامپایل می شود و " +"نتیجه را برای ماژولی که مستقیماً از خط فرمان بارگذاری می شود ذخیره نمی کند." +" دوم اینکه اگر ماژول منبع وجود نداشته باشد، کش را بررسی نمی کند. برای " +"پشتیبانی از توزیع غیر منبع (فقط کامپایل شده), ماژول کامپایل شده باید در " +"دایرکتوری منبع باشد و ماژول منبع نباید وجود داشته باشد." #: tutorial/modules.rst:241 +#, fuzzy msgid "Some tips for experts:" -msgstr "" +msgstr "چند نکته برای کارشناسان:" #: tutorial/modules.rst:243 -msgid "You can use the :option:`-O` or :option:`-OO` switches on the Python command to reduce the size of a compiled module. The ``-O`` switch removes assert statements, the ``-OO`` switch removes both assert statements and __doc__ strings. Since some programs may rely on having these available, you should only use this option if you know what you're doing. \"Optimized\" modules have an ``opt-`` tag and are usually smaller. Future releases may change the effects of optimization." -msgstr "" +#, fuzzy +msgid "" +"You can use the :option:`-O` or :option:`-OO` switches on the Python command" +" to reduce the size of a compiled module. The ``-O`` switch removes assert " +"statements, the ``-OO`` switch removes both assert statements and __doc__ " +"strings. Since some programs may rely on having these available, you should" +" only use this option if you know what you're doing. \"Optimized\" modules " +"have an ``opt-`` tag and are usually smaller. Future releases may change " +"the effects of optimization." +msgstr "" +"شما می توانید از سوئیچ های :option:`-O` یا :option:`-OO` در دستور پایتون " +"برای کاهش اندازه یک ماژول کامپایل شده استفاده کنید. سوئیچ ``-O`` عبارات " +"عنوان را حذف می کند، سوئیچ ``-OO`` هر دو دستورات و رشته های __doc__ را حذف " +"می کند. از آنجایی که برخی از برنامه ها ممکن است به در دسترس بودن اینها متکی" +" باشند، فقط در صورتی باید از این گزینه استفاده کنید که بدانید چه کاری انجام " +"می دهید. ماژول های \"بهینه\" دارای یک برچسب ``opt-`` هستند و معمولا کوچکتر " +"هستند. نسخه های آینده ممکن است اثرات بهینه سازی را تغییر دهند." #: tutorial/modules.rst:251 -msgid "A program doesn't run any faster when it is read from a ``.pyc`` file than when it is read from a ``.py`` file; the only thing that's faster about ``.pyc`` files is the speed with which they are loaded." +#, fuzzy +msgid "" +"A program doesn't run any faster when it is read from a ``.pyc`` file than " +"when it is read from a ``.py`` file; the only thing that's faster about " +"``.pyc`` files is the speed with which they are loaded." msgstr "" +"وقتی یک برنامه از یک فایل ``.pyc`` خوانده می شود سریعتر از زمانی که از یک " +"فایل ``.py`` خوانده می شود، اجرا نمی شود. تنها چیزی که در مورد فایل های " +"``.pyc`` سریعتر است، سرعت بارگذاری آنها است." #: tutorial/modules.rst:255 -msgid "The module :mod:`compileall` can create .pyc files for all modules in a directory." +#, fuzzy +msgid "" +"The module :mod:`compileall` can create .pyc files for all modules in a " +"directory." msgstr "" +"ماژول :mod:`compileall` می تواند فایل های .pyc را برای همه ماژول های یک " +"دایرکتوری ایجاد کند." #: tutorial/modules.rst:258 -msgid "There is more detail on this process, including a flow chart of the decisions, in :pep:`3147`." +#, fuzzy +msgid "" +"There is more detail on this process, including a flow chart of the " +"decisions, in :pep:`3147`." msgstr "" +"جزئیات بیشتری در مورد این فرآیند، از جمله نمودار جریان تصمیمات، در " +":pep:`3147` وجود دارد." #: tutorial/modules.rst:265 +#, fuzzy msgid "Standard Modules" -msgstr "" +msgstr "ماژول های استاندارد" #: tutorial/modules.rst:269 -msgid "Python comes with a library of standard modules, described in a separate document, the Python Library Reference (\"Library Reference\" hereafter). Some modules are built into the interpreter; these provide access to operations that are not part of the core of the language but are nevertheless built in, either for efficiency or to provide access to operating system primitives such as system calls. The set of such modules is a configuration option which also depends on the underlying platform. For example, the :mod:`winreg` module is only provided on Windows systems. One particular module deserves some attention: :mod:`sys`, which is built into every Python interpreter. The variables ``sys.ps1`` and ``sys.ps2`` define the strings used as primary and secondary prompts::" -msgstr "" +#, fuzzy +msgid "" +"Python comes with a library of standard modules, described in a separate " +"document, the Python Library Reference (\"Library Reference\" hereafter). " +"Some modules are built into the interpreter; these provide access to " +"operations that are not part of the core of the language but are " +"nevertheless built in, either for efficiency or to provide access to " +"operating system primitives such as system calls. The set of such modules " +"is a configuration option which also depends on the underlying platform. " +"For example, the :mod:`winreg` module is only provided on Windows systems. " +"One particular module deserves some attention: :mod:`sys`, which is built " +"into every Python interpreter. The variables ``sys.ps1`` and ``sys.ps2`` " +"define the strings used as primary and secondary prompts::" +msgstr "" +"پایتون با کتابخانه ای از ماژول های استاندارد ارائه می شود که در یک سند " +"جداگانه به نام مرجع کتابخانه پایتون (از این به بعد \"مرجع کتابخانه\" توضیح " +"داده شده است. برخی از ماژول ها در مفسر تعبیه شده اند. اینها دسترسی به " +"عملیاتی را فراهم می کنند که بخشی از هسته زبان نیستند، اما با این وجود، برای " +"کارایی یا برای دسترسی به سیستم عامل های اولیه مانند فراخوانی سیستم، ساخته " +"شده اند. مجموعه ای از این ماژول ها یک گزینه پیکربندی است که به پلت فرم " +"زیرین نیز بستگی دارد. به عنوان مثال، ماژول :mod:`winreg` فقط در سیستم های " +"ویندوز ارائه می شود. یک ماژول خاص سزاوار توجه است: :mod:`sys` که در هر مفسر " +"پایتون تعبیه شده است. متغیرهای ``sys.ps1`` و ``sys.ps2`` رشته های مورد " +"استفاده را به عنوان دستورهای اولیه و ثانویه تعریف می کنند:" #: tutorial/modules.rst:281 -msgid ">>> import sys\n" +#, fuzzy +msgid "" +">>> import sys\n" ">>> sys.ps1\n" "'>>> '\n" ">>> sys.ps2\n" @@ -289,30 +668,65 @@ msgid ">>> import sys\n" "Yuck!\n" "C>" msgstr "" +">>> سیستم را وارد کنید\n" +">>> sys.ps1\n" +"'>>>'\n" +">>> sys.ps2\n" +"'...'\n" +">>> sys.ps1 = 'C> '\n" +"C> print ('Yuck!')\n" +"آخه!\n" +"C>" #: tutorial/modules.rst:292 -msgid "These two variables are only defined if the interpreter is in interactive mode." -msgstr "" +#, fuzzy +msgid "" +"These two variables are only defined if the interpreter is in interactive " +"mode." +msgstr "این دو متغیر تنها در صورتی تعریف می شوند که مفسر در حالت تعاملی باشد." #: tutorial/modules.rst:294 -msgid "The variable ``sys.path`` is a list of strings that determines the interpreter's search path for modules. It is initialized to a default path taken from the environment variable :envvar:`PYTHONPATH`, or from a built-in default if :envvar:`PYTHONPATH` is not set. You can modify it using standard list operations::" -msgstr "" +#, fuzzy +msgid "" +"The variable ``sys.path`` is a list of strings that determines the " +"interpreter's search path for modules. It is initialized to a default path " +"taken from the environment variable :envvar:`PYTHONPATH`, or from a built-in" +" default if :envvar:`PYTHONPATH` is not set. You can modify it using " +"standard list operations::" +msgstr "" +"متغیر ``sys.path`` لیستی از رشته ها است که مسیر جستجوی مفسر برای ماژول ها را" +" تعیین می کند. این به یک مسیر پیش فرض گرفته شده از متغیر محیطی " +":envvar:`PYTHONPATH`، یا از یک پیش فرض داخلی اگر :envvar:`PYTHONPATH` تنظیم " +"نشده باشد، مقداردهی اولیه می شود. شما می توانید آن را با استفاده از عملیات " +"لیست استاندارد تغییر دهید:" #: tutorial/modules.rst:300 -msgid ">>> import sys\n" +#, fuzzy +msgid "" +">>> import sys\n" ">>> sys.path.append('/ufs/guido/lib/python')" msgstr "" +">>> import sys\n" +">>> sys.path.append('/ufs/guido/lib/python')" #: tutorial/modules.rst:307 +#, fuzzy msgid "The :func:`dir` Function" -msgstr "" +msgstr "عملکرد :func:`dir`" #: tutorial/modules.rst:309 -msgid "The built-in function :func:`dir` is used to find out which names a module defines. It returns a sorted list of strings::" +#, fuzzy +msgid "" +"The built-in function :func:`dir` is used to find out which names a module " +"defines. It returns a sorted list of strings::" msgstr "" +"تابع داخلی :func:`dir` برای پیدا کردن نام هایی که یک ماژول تعریف می کند " +"استفاده می شود. لیست مرتب شده ای از رشته ها را برمی گرداند::" #: tutorial/modules.rst:312 -msgid ">>> import fibo, sys\n" +#, fuzzy +msgid "" +">>> import fibo, sys\n" ">>> dir(fibo)\n" "['__name__', 'fib', 'fib2']\n" ">>> dir(sys) \n" @@ -338,29 +752,77 @@ msgid ">>> import fibo, sys\n" " 'stdin', 'stdout', 'thread_info', 'unraisablehook', 'version', 'version_info',\n" " 'warnoptions']" msgstr "" +">>> import fibo, sys\n" +">>> dir(fibo)\n" +"['__name__', 'fib', 'fib2']\n" +">>> dir(sys) \n" +"['__breakpointhook__', '__displayhook__', '__doc__', '__excepthook__',\n" +" '__interactivehook__', '__loader__', '__name__', '__package__', '__spec__',\n" +" '__stderr__', '__stdin__', '__stdout__', '__unraisablehook__',\n" +" '_clear_type_cache', '_current_frames', '_debugmallocstats', '_framework',\n" +" '_getframe', '_git', '_home', '_xoptions', 'abiflags', 'addaudithook',\n" +" 'api_version', 'argv', 'audit', 'base_exec_prefix', 'base_prefix',\n" +" 'breakpointhook', 'builtin_module_names', 'byteorder', 'call_tracing',\n" +" 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_info',\n" +" 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info',\n" +" 'float_repr_style', 'get_asyncgen_hooks', 'get_coroutine_origin_tracking_depth',\n" +" 'getallocatedblocks', 'getdefaultencoding', 'getdlopenflags',\n" +" 'getfilesystemencodeerrors', 'getfilesystemencoding', 'getprofile',\n" +" 'getrecursionlimit', 'getrefcount', 'getsizeof', 'getswitchinterval',\n" +" 'gettrace', 'hash_info', 'hexversion', 'implementation', 'int_info',\n" +" 'intern', 'is_finalizing', 'last_traceback', 'last_type', 'last_value',\n" +" 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks',\n" +" 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'pycache_prefix',\n" +" 'set_asyncgen_hooks', 'set_coroutine_origin_tracking_depth', 'setdlopenflags',\n" +" 'setprofile', 'setrecursionlimit', 'setswitchinterval', 'settrace', 'stderr',\n" +" 'stdin', 'stdout', 'thread_info', 'unraisablehook', 'version', 'version_info',\n" +" 'warnoptions']" #: tutorial/modules.rst:338 -msgid "Without arguments, :func:`dir` lists the names you have defined currently::" +#, fuzzy +msgid "" +"Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" +"بدون آرگومان، :func:`dir` نام هایی را که در حال حاضر تعریف کرده اید فهرست می" +" کند:" #: tutorial/modules.rst:340 -msgid ">>> a = [1, 2, 3, 4, 5]\n" +#, fuzzy +msgid "" +">>> a = [1, 2, 3, 4, 5]\n" ">>> import fibo\n" ">>> fib = fibo.fib\n" ">>> dir()\n" "['__builtins__', '__name__', 'a', 'fib', 'fibo', 'sys']" msgstr "" +">>> a = [1, 2, 3, 4, 5]\n" +">>> import fibo\n" +">>> fib = fibo.fib\n" +">>> dir()\n" +"['__builtins__', '__name__', 'a', 'fib', 'fibo', 'sys']" #: tutorial/modules.rst:346 -msgid "Note that it lists all types of names: variables, modules, functions, etc." +#, fuzzy +msgid "" +"Note that it lists all types of names: variables, modules, functions, etc." msgstr "" +"توجه داشته باشید که همه انواع نام ها را فهرست می کند: متغیرها، ماژول ها، " +"توابع و غیره." #: tutorial/modules.rst:350 -msgid ":func:`dir` does not list the names of built-in functions and variables. If you want a list of those, they are defined in the standard module :mod:`builtins`::" +#, fuzzy +msgid "" +":func:`dir` does not list the names of built-in functions and variables. If" +" you want a list of those, they are defined in the standard module " +":mod:`builtins`::" msgstr "" +":func:`dir` نام توابع و متغیرهای داخلی را فهرست نمی کند. اگر لیستی از آن ها" +" را می خواهید، در ماژول استاندارد :mod:`builtins` تعریف شده اند:" #: tutorial/modules.rst:354 -msgid ">>> import builtins\n" +#, fuzzy +msgid "" +">>> import builtins\n" ">>> dir(builtins) \n" "['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',\n" " 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning',\n" @@ -392,21 +854,92 @@ msgid ">>> import builtins\n" " 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars',\n" " 'zip']" msgstr "" +">>> import builtins\n" +">>> dir(builtins) \n" +"['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',\n" +" 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning',\n" +" 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError',\n" +" 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning',\n" +" 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False',\n" +" 'FileExistsError', 'FileNotFoundError', 'FloatingPointError',\n" +" 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError',\n" +" 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError',\n" +" 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError',\n" +" 'MemoryError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented',\n" +" 'NotImplementedError', 'OSError', 'OverflowError',\n" +" 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError',\n" +" 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning',\n" +" 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError',\n" +" 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError',\n" +" 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError',\n" +" 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning',\n" +" 'ValueError', 'Warning', 'ZeroDivisionError', '_', '__build_class__',\n" +" '__debug__', '__doc__', '__import__', '__name__', '__package__', 'abs',\n" +" 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable',\n" +" 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits',\n" +" 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit',\n" +" 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr',\n" +" 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass',\n" +" 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview',\n" +" 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property',\n" +" 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',\n" +" 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars',\n" +" 'zip']" #: tutorial/modules.rst:389 +#, fuzzy msgid "Packages" -msgstr "" +msgstr "بسته ها" #: tutorial/modules.rst:391 -msgid "Packages are a way of structuring Python's module namespace by using \"dotted module names\". For example, the module name :mod:`!A.B` designates a submodule named ``B`` in a package named ``A``. Just like the use of modules saves the authors of different modules from having to worry about each other's global variable names, the use of dotted module names saves the authors of multi-module packages like NumPy or Pillow from having to worry about each other's module names." -msgstr "" +#, fuzzy +msgid "" +"Packages are a way of structuring Python's module namespace by using " +"\"dotted module names\". For example, the module name :mod:`!A.B` " +"designates a submodule named ``B`` in a package named ``A``. Just like the " +"use of modules saves the authors of different modules from having to worry " +"about each other's global variable names, the use of dotted module names " +"saves the authors of multi-module packages like NumPy or Pillow from having " +"to worry about each other's module names." +msgstr "" +"بسته‌ها روشی برای ساختاردهی فضای نام ماژول پایتون با استفاده از «نام‌های " +"ماژول نقطه‌دار» هستند. به عنوان مثال، نام ماژول :mod:`!A.B` یک زیر ماژول به" +" نام ``B`` را در بسته ای به نام ``A`` تعیین می کند. درست همانطور که استفاده" +" از ماژول ها باعث می شود نویسندگان ماژول های مختلف نگران نام متغیرهای جهانی " +"یکدیگر نباشند، استفاده از نام ماژول های نقطه دار باعث می شود نویسندگان بسته " +"های چند ماژول مانند NumPy یا Pillow نگران نام ماژول های یکدیگر نباشند." #: tutorial/modules.rst:399 -msgid "Suppose you want to design a collection of modules (a \"package\") for the uniform handling of sound files and sound data. There are many different sound file formats (usually recognized by their extension, for example: :file:`.wav`, :file:`.aiff`, :file:`.au`), so you may need to create and maintain a growing collection of modules for the conversion between the various file formats. There are also many different operations you might want to perform on sound data (such as mixing, adding echo, applying an equalizer function, creating an artificial stereo effect), so in addition you will be writing a never-ending stream of modules to perform these operations. Here's a possible structure for your package (expressed in terms of a hierarchical filesystem):" -msgstr "" +#, fuzzy +msgid "" +"Suppose you want to design a collection of modules (a \"package\") for the " +"uniform handling of sound files and sound data. There are many different " +"sound file formats (usually recognized by their extension, for example: " +":file:`.wav`, :file:`.aiff`, :file:`.au`), so you may need to create and " +"maintain a growing collection of modules for the conversion between the " +"various file formats. There are also many different operations you might " +"want to perform on sound data (such as mixing, adding echo, applying an " +"equalizer function, creating an artificial stereo effect), so in addition " +"you will be writing a never-ending stream of modules to perform these " +"operations. Here's a possible structure for your package (expressed in " +"terms of a hierarchical filesystem):" +msgstr "" +"فرض کنید می خواهید مجموعه ای از ماژول ها (یک \"بسته\") برای مدیریت یکنواخت " +"فایل های صوتی و داده های صوتی طراحی کنید. فرمت‌های فایل صوتی بسیار زیادی " +"وجود دارد (معمولاً با پسوند آنها شناخته می‌شوند, به عنوان مثال: " +":file:`.wav`, :file:`.aiff`, :file:`.au`), بنابراین ممکن است نیاز به ایجاد و" +" نگهداری مجموعه‌ای از ماژول‌ها برای تبدیل بین فرمت‌های مختلف فایل داشته " +"باشید. همچنین بسیاری از عملیات‌های مختلفی وجود دارد که ممکن است بخواهید روی " +"داده‌های صدا انجام دهید (مانند میکس کردن, افزودن اکو, اعمال یک عملکرد " +"اکولایزر, ایجاد یک افکت استریو مصنوعی), بنابراین علاوه بر این، شما یک جریان " +"بی‌پایان از ماژول‌ها را برای انجام این عملیات می‌نویسید. در اینجا یک ساختار" +" ممکن برای بسته شما وجود دارد (که در قالب یک فایل سیستم سلسله مراتبی بیان می" +" شود):" #: tutorial/modules.rst:410 -msgid "sound/ Top-level package\n" +#, fuzzy +msgid "" +"sound/ Top-level package\n" " __init__.py Initialize the sound package\n" " formats/ Subpackage for file format conversions\n" " __init__.py\n" @@ -430,97 +963,246 @@ msgid "sound/ Top-level package\n" " karaoke.py\n" " ..." msgstr "" +"صدا/ بسته سطح بالا\n" +" __init__.py بسته صدا را راه اندازی کنید\n" +" فرمت ها/ بسته فرعی برای تبدیل فرمت فایل\n" +" __init__.py\n" +" wavread.py\n" +" wavwrite.py\n" +" aiffread.py\n" +" aiffwrite.py\n" +" auread.py\n" +" auwrite.py\n" +" ...\n" +" جلوه ها/ بسته فرعی برای جلوه های صوتی\n" +" __init__.py\n" +" echo.py\n" +" surround.py\n" +" reverse.py\n" +" ...\n" +" فیلترها/ بسته فرعی برای فیلترها\n" +" __init__.py\n" +" اکولایزر.py\n" +" vocoder.py\n" +" karaoke.py\n" +" ..." #: tutorial/modules.rst:436 -msgid "When importing the package, Python searches through the directories on ``sys.path`` looking for the package subdirectory." +#, fuzzy +msgid "" +"When importing the package, Python searches through the directories on " +"``sys.path`` looking for the package subdirectory." msgstr "" +"هنگام وارد کردن بسته، پایتون از طریق دایرکتوری های موجود در ``sys.path`` به " +"دنبال زیر شاخه بسته می گردد." #: tutorial/modules.rst:439 -msgid "The :file:`__init__.py` files are required to make Python treat directories containing the file as packages (unless using a :term:`namespace package`, a relatively advanced feature). This prevents directories with a common name, such as ``string``, from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, :file:`__init__.py` can just be an empty file, but it can also execute initialization code for the package or set the ``__all__`` variable, described later." -msgstr "" +#, fuzzy +msgid "" +"The :file:`__init__.py` files are required to make Python treat directories " +"containing the file as packages (unless using a :term:`namespace package`, a" +" relatively advanced feature). This prevents directories with a common name," +" such as ``string``, from unintentionally hiding valid modules that occur " +"later on the module search path. In the simplest case, :file:`__init__.py` " +"can just be an empty file, but it can also execute initialization code for " +"the package or set the ``__all__`` variable, described later." +msgstr "" +"فایل‌های :file:`__init__.py` مورد نیاز هستند تا پایتون دایرکتوری‌های حاوی " +"فایل را به‌عنوان بسته‌ها در نظر بگیرد (مگر اینکه از :term:`namespace " +"package` که یک ویژگی نسبتاً پیشرفته است استفاده کنید). این امر از پوشاندن " +"ناخواسته ماژول‌های معتبری که بعداً در مسیر جستجوی ماژول رخ می‌دهند، " +"دایرکتوری‌هایی با نام مشترک، مانند ``string``، جلوگیری می‌کند. در ساده‌ترین " +"حالت، :file:`__init__.py` فقط می‌تواند یک فایل خالی باشد، اما همچنین " +"می‌تواند کد اولیه را برای بسته اجرا کند یا متغیر ``__all__`` را که بعدا " +"توضیح داده شد، تنظیم کند." #: tutorial/modules.rst:447 -msgid "Users of the package can import individual modules from the package, for example::" +#, fuzzy +msgid "" +"Users of the package can import individual modules from the package, for " +"example::" msgstr "" +"کاربران بسته می توانند ماژول های جداگانه را از بسته وارد کنند، به عنوان " +"مثال:" #: tutorial/modules.rst:450 +#, fuzzy msgid "import sound.effects.echo" -msgstr "" +msgstr "import sound.effects.echo" #: tutorial/modules.rst:452 -msgid "This loads the submodule :mod:`!sound.effects.echo`. It must be referenced with its full name. ::" +#, fuzzy +msgid "" +"This loads the submodule :mod:`!sound.effects.echo`. It must be referenced " +"with its full name. ::" msgstr "" +"این زیر ماژول :mod:`!sound.effects.echo` را بارگیری می کند. باید با نام " +"کامل آن ارجاع داده شود. ::" #: tutorial/modules.rst:455 +#, fuzzy msgid "sound.effects.echo.echofilter(input, output, delay=0.7, atten=4)" -msgstr "" +msgstr "sound.effects.echo.echofilter(input, output, delay=0.7, atten=4)" #: tutorial/modules.rst:457 +#, fuzzy msgid "An alternative way of importing the submodule is::" -msgstr "" +msgstr "یک راه جایگزین برای وارد کردن زیر ماژول این است:" #: tutorial/modules.rst:459 +#, fuzzy msgid "from sound.effects import echo" -msgstr "" +msgstr "from sound.effects import echo" #: tutorial/modules.rst:461 -msgid "This also loads the submodule :mod:`!echo`, and makes it available without its package prefix, so it can be used as follows::" +#, fuzzy +msgid "" +"This also loads the submodule :mod:`!echo`, and makes it available without " +"its package prefix, so it can be used as follows::" msgstr "" +"این همچنین زیر ماژول :mod:`!echo` را بارگیری می کند و آن را بدون پیشوند بسته" +" در دسترس قرار می دهد، بنابراین می توان از آن به صورت زیر استفاده کرد:" #: tutorial/modules.rst:464 +#, fuzzy msgid "echo.echofilter(input, output, delay=0.7, atten=4)" -msgstr "" +msgstr "echo.echofilter(input, output, delay=0.7, atten=4)" #: tutorial/modules.rst:466 -msgid "Yet another variation is to import the desired function or variable directly::" -msgstr "" +#, fuzzy +msgid "" +"Yet another variation is to import the desired function or variable " +"directly::" +msgstr "یک تغییر دیگر این است که تابع یا متغیر مورد نظر را مستقیما وارد کنید:" #: tutorial/modules.rst:468 +#, fuzzy msgid "from sound.effects.echo import echofilter" -msgstr "" +msgstr "from sound.effects.echo import echofilter" #: tutorial/modules.rst:470 -msgid "Again, this loads the submodule :mod:`!echo`, but this makes its function :func:`!echofilter` directly available::" +#, fuzzy +msgid "" +"Again, this loads the submodule :mod:`!echo`, but this makes its function " +":func:`!echofilter` directly available::" msgstr "" +"مجدداً، این زیر ماژول :mod:`!echo` را بارگیری می کند، اما عملکرد آن " +":func:`!echofilter` را مستقیماً در دسترس قرار می دهد:" #: tutorial/modules.rst:473 +#, fuzzy msgid "echofilter(input, output, delay=0.7, atten=4)" -msgstr "" +msgstr "echofilter(input, output, delay=0.7, atten=4)" #: tutorial/modules.rst:475 -msgid "Note that when using ``from package import item``, the item can be either a submodule (or subpackage) of the package, or some other name defined in the package, like a function, class or variable. The ``import`` statement first tests whether the item is defined in the package; if not, it assumes it is a module and attempts to load it. If it fails to find it, an :exc:`ImportError` exception is raised." -msgstr "" +#, fuzzy +msgid "" +"Note that when using ``from package import item``, the item can be either a " +"submodule (or subpackage) of the package, or some other name defined in the" +" package, like a function, class or variable. The ``import`` statement " +"first tests whether the item is defined in the package; if not, it assumes " +"it is a module and attempts to load it. If it fails to find it, an " +":exc:`ImportError` exception is raised." +msgstr "" +"توجه داشته باشید که هنگام استفاده از ``from package import item``، آیتم می " +"تواند یک زیر ماژول (یا بسته فرعی) بسته باشد یا نام دیگری که در بسته تعریف " +"شده است، مانند یک تابع، کلاس یا متغیر. دستور ``import`` ابتدا تست می کند که" +" آیا آیتم در بسته تعریف شده است یا خیر. اگر نه، فرض می کند که یک ماژول است و" +" سعی می کند آن را بارگذاری کند. اگر نتواند آن را پیدا کند، یک استثنا " +":exc:`ImportError` ایجاد می شود." #: tutorial/modules.rst:482 -msgid "Contrarily, when using syntax like ``import item.subitem.subsubitem``, each item except for the last must be a package; the last item can be a module or a package but can't be a class or function or variable defined in the previous item." +#, fuzzy +msgid "" +"Contrarily, when using syntax like ``import item.subitem.subsubitem``, each " +"item except for the last must be a package; the last item can be a module or" +" a package but can't be a class or function or variable defined in the " +"previous item." msgstr "" +"برعکس، هنگام استفاده از سینتکس مانند ``import item.subitem.subsubitem``، هر " +"مورد به جز مورد آخر باید یک بسته باشد. آخرین مورد می تواند یک ماژول یا یک " +"بسته باشد اما نمی تواند یک کلاس یا تابع یا متغیر تعریف شده در مورد قبلی " +"باشد." #: tutorial/modules.rst:491 +#, fuzzy msgid "Importing \\* From a Package" -msgstr "" +msgstr "وارد کردن \\* از یک بسته" #: tutorial/modules.rst:495 -msgid "Now what happens when the user writes ``from sound.effects import *``? Ideally, one would hope that this somehow goes out to the filesystem, finds which submodules are present in the package, and imports them all. This could take a long time and importing sub-modules might have unwanted side-effects that should only happen when the sub-module is explicitly imported." -msgstr "" +#, fuzzy +msgid "" +"Now what happens when the user writes ``from sound.effects import *``? " +"Ideally, one would hope that this somehow goes out to the filesystem, finds " +"which submodules are present in the package, and imports them all. This " +"could take a long time and importing sub-modules might have unwanted side-" +"effects that should only happen when the sub-module is explicitly imported." +msgstr "" +"حالا وقتی کاربر ``from sound.effects import *`` را می نویسد چه اتفاقی می " +"افتد؟ در حالت ایده‌آل، می‌توان امیدوار بود که این به نحوی به سیستم فایل " +"برود، زیر ماژول‌های موجود در بسته را بیابد و همه آنها را وارد کند. این ممکن" +" است زمان زیادی طول بکشد و وارد کردن ماژول‌های فرعی ممکن است عوارض جانبی " +"ناخواسته‌ای داشته باشد که فقط زمانی اتفاق می‌افتد که ماژول فرعی به صراحت " +"وارد شده باشد." #: tutorial/modules.rst:501 -msgid "The only solution is for the package author to provide an explicit index of the package. The :keyword:`import` statement uses the following convention: if a package's :file:`__init__.py` code defines a list named ``__all__``, it is taken to be the list of module names that should be imported when ``from package import *`` is encountered. It is up to the package author to keep this list up-to-date when a new version of the package is released. Package authors may also decide not to support it, if they don't see a use for importing \\* from their package. For example, the file :file:`sound/effects/__init__.py` could contain the following code::" -msgstr "" +#, fuzzy +msgid "" +"The only solution is for the package author to provide an explicit index of " +"the package. The :keyword:`import` statement uses the following convention:" +" if a package's :file:`__init__.py` code defines a list named ``__all__``, " +"it is taken to be the list of module names that should be imported when " +"``from package import *`` is encountered. It is up to the package author to" +" keep this list up-to-date when a new version of the package is released. " +"Package authors may also decide not to support it, if they don't see a use " +"for importing \\* from their package. For example, the file " +":file:`sound/effects/__init__.py` could contain the following code::" +msgstr "" +"تنها راه حل این است که نویسنده بسته یک نمایه صریح از بسته ارائه دهد. دستور " +":keyword:`import` از قرارداد زیر استفاده می کند: اگر کد :file:`__init__.py` " +"بسته، لیستی به نام ``__all__`` را تعریف کند، به عنوان لیستی از نام ماژول ها " +"در نظر گرفته می شود که باید در هنگام مواجهه با ``from package import *`` " +"وارد شوند. این بر عهده نویسنده بسته است که این لیست را هنگام انتشار نسخه " +"جدید بسته به روز نگه دارد. نویسندگان بسته همچنین ممکن است تصمیم بگیرند که " +"از آن پشتیبانی نکنند، در صورتی که استفاده ای برای وارد کردن \\* از بسته خود " +"نمی بینند. به عنوان مثال، فایل :file:`sound/effects/__init__.py` می تواند " +"حاوی کد زیر باشد:" #: tutorial/modules.rst:511 +#, fuzzy msgid "__all__ = [\"echo\", \"surround\", \"reverse\"]" -msgstr "" +msgstr "__all__ = [\"echo\", \"surround\", \"reverse\"]" #: tutorial/modules.rst:513 -msgid "This would mean that ``from sound.effects import *`` would import the three named submodules of the :mod:`!sound.effects` package." +#, fuzzy +msgid "" +"This would mean that ``from sound.effects import *`` would import the three " +"named submodules of the :mod:`!sound.effects` package." msgstr "" +"این بدان معنی است که ``from sound.effects import *`` سه زیر ماژول نامگذاری " +"شده بسته :mod:`!sound.effects` را وارد می کند." #: tutorial/modules.rst:516 -msgid "Be aware that submodules might become shadowed by locally defined names. For example, if you added a ``reverse`` function to the :file:`sound/effects/__init__.py` file, the ``from sound.effects import *`` would only import the two submodules ``echo`` and ``surround``, but *not* the ``reverse`` submodule, because it is shadowed by the locally defined ``reverse`` function::" -msgstr "" +#, fuzzy +msgid "" +"Be aware that submodules might become shadowed by locally defined names. For" +" example, if you added a ``reverse`` function to the " +":file:`sound/effects/__init__.py` file, the ``from sound.effects import *`` " +"would only import the two submodules ``echo`` and ``surround``, but *not* " +"the ``reverse`` submodule, because it is shadowed by the locally defined " +"``reverse`` function::" +msgstr "" +"توجه داشته باشید که زیر ماژول‌ها ممکن است با نام‌هایی که به صورت محلی تعریف " +"شده‌اند، تحت‌سایه شوند. به عنوان مثال، اگر یک تابع ``reverse`` را به فایل " +":file:`sound/effects/__init__.py` اضافه کنید، ``from sound.effects import " +"*`` فقط دو زیرماژول ``echo`` و ``surround`` را وارد می کند، اما *not* " +"زیرماژول ``reverse`` را وارد می کند، زیرا توسط تابع ``reverse`` که به صورت " +"محلی تعریف شده سایه می اندازد:" #: tutorial/modules.rst:523 -msgid "__all__ = [\n" +#, fuzzy +msgid "" +"__all__ = [\n" " \"echo\", # refers to the 'echo.py' file\n" " \"surround\", # refers to the 'surround.py' file\n" " \"reverse\", # !!! refers to the 'reverse' function now !!!\n" @@ -529,93 +1211,213 @@ msgid "__all__ = [\n" "def reverse(msg: str): # <-- this name shadows the 'reverse.py' submodule\n" " return msg[::-1] # in the case of a 'from sound.effects import *'" msgstr "" +"__all__ = [\n" +" \"echo\", # refers to the 'echo.py' file\n" +" \"surround\", # refers to the 'surround.py' file\n" +" \"reverse\", # !!! refers to the 'reverse' function now !!!\n" +"]\n" +"\n" +"def reverse(msg: str): # <-- this name shadows the 'reverse.py' submodule\n" +" return msg[::-1] # in the case of a 'from sound.effects import *'" #: tutorial/modules.rst:532 -msgid "If ``__all__`` is not defined, the statement ``from sound.effects import *`` does *not* import all submodules from the package :mod:`!sound.effects` into the current namespace; it only ensures that the package :mod:`!sound.effects` has been imported (possibly running any initialization code in :file:`__init__.py`) and then imports whatever names are defined in the package. This includes any names defined (and submodules explicitly loaded) by :file:`__init__.py`. It also includes any submodules of the package that were explicitly loaded by previous :keyword:`import` statements. Consider this code::" -msgstr "" +#, fuzzy +msgid "" +"If ``__all__`` is not defined, the statement ``from sound.effects import *``" +" does *not* import all submodules from the package :mod:`!sound.effects` " +"into the current namespace; it only ensures that the package " +":mod:`!sound.effects` has been imported (possibly running any initialization" +" code in :file:`__init__.py`) and then imports whatever names are defined in" +" the package. This includes any names defined (and submodules explicitly " +"loaded) by :file:`__init__.py`. It also includes any submodules of the " +"package that were explicitly loaded by previous :keyword:`import` " +"statements. Consider this code::" +msgstr "" +"اگر ``__all__`` تعریف نشده باشد، عبارت ``from sound.effects import *`` *not*" +" همه زیر ماژول ها را از بسته :mod:`!sound.effects` به فضای نام فعلی وارد می " +"کند. این فقط تضمین می کند که بسته :mod:`!sound.effects` وارد شده است " +"(احتمالاً هر کد اولیه را در :file:`__init__.py` اجرا می کند) و سپس هر نامی " +"را که در بسته تعریف شده است وارد می کند. این شامل هر نامی است که توسط " +":file:`__init__.py` تعریف شده است (و زیر ماژول هایی که به صراحت بارگذاری شده" +" اند). همچنین شامل هر زیر ماژول بسته است که به صراحت توسط عبارات قبلی " +":keyword:`import` بارگذاری شده است. این کد را در نظر بگیرید::" #: tutorial/modules.rst:541 -msgid "import sound.effects.echo\n" +#, fuzzy +msgid "" +"import sound.effects.echo\n" "import sound.effects.surround\n" "from sound.effects import *" msgstr "" +"import sound.effects.echo\n" +"import sound.effects.surround\n" +"from sound.effects import *" #: tutorial/modules.rst:545 -msgid "In this example, the :mod:`!echo` and :mod:`!surround` modules are imported in the current namespace because they are defined in the :mod:`!sound.effects` package when the ``from...import`` statement is executed. (This also works when ``__all__`` is defined.)" +#, fuzzy +msgid "" +"In this example, the :mod:`!echo` and :mod:`!surround` modules are imported " +"in the current namespace because they are defined in the " +":mod:`!sound.effects` package when the ``from...import`` statement is " +"executed. (This also works when ``__all__`` is defined.)" msgstr "" +"در این مثال، ماژول‌های :mod:`!echo` و :mod:`!surround` در فضای نام فعلی وارد" +" می‌شوند زیرا در بسته :mod:`!sound.effects` هنگام اجرای دستور " +"``from...import`` تعریف شده‌اند. (هنگامی که ``__all__`` تعریف شده باشد این " +"کار نیز کار می کند.)" #: tutorial/modules.rst:550 -msgid "Although certain modules are designed to export only names that follow certain patterns when you use ``import *``, it is still considered bad practice in production code." +#, fuzzy +msgid "" +"Although certain modules are designed to export only names that follow " +"certain patterns when you use ``import *``, it is still considered bad " +"practice in production code." msgstr "" +"اگرچه ماژول‌های خاصی برای صادرات فقط نام‌هایی طراحی شده‌اند که در هنگام " +"استفاده از ``import *`` از الگوهای خاصی پیروی می‌کنند، اما همچنان در کد " +"تولید بد عمل می‌شود." #: tutorial/modules.rst:554 -msgid "Remember, there is nothing wrong with using ``from package import specific_submodule``! In fact, this is the recommended notation unless the importing module needs to use submodules with the same name from different packages." +#, fuzzy +msgid "" +"Remember, there is nothing wrong with using ``from package import " +"specific_submodule``! In fact, this is the recommended notation unless the " +"importing module needs to use submodules with the same name from different " +"packages." msgstr "" +"به یاد داشته باشید، استفاده از ``from package import specific_submodule`` " +"اشکالی ندارد! در واقع، این نماد توصیه شده است، مگر اینکه ماژول واردکننده " +"نیاز به استفاده از ماژول های فرعی با همان نام از بسته های مختلف داشته باشد." #: tutorial/modules.rst:563 +#, fuzzy msgid "Intra-package References" -msgstr "" +msgstr "مراجع درون بسته" #: tutorial/modules.rst:565 -msgid "When packages are structured into subpackages (as with the :mod:`!sound` package in the example), you can use absolute imports to refer to submodules of siblings packages. For example, if the module :mod:`!sound.filters.vocoder` needs to use the :mod:`!echo` module in the :mod:`!sound.effects` package, it can use ``from sound.effects import echo``." -msgstr "" +#, fuzzy +msgid "" +"When packages are structured into subpackages (as with the :mod:`!sound` " +"package in the example), you can use absolute imports to refer to submodules" +" of siblings packages. For example, if the module " +":mod:`!sound.filters.vocoder` needs to use the :mod:`!echo` module in the " +":mod:`!sound.effects` package, it can use ``from sound.effects import " +"echo``." +msgstr "" +"هنگامی که بسته‌ها در بسته‌های فرعی ساختار می‌شوند (مانند بسته :mod:`!sound` " +"در مثال), می‌توانید از import absolute برای ارجاع به زیر ماژول‌های بسته‌های " +"خواهر و برادر استفاده کنید. به عنوان مثال، اگر ماژول " +":mod:`!sound.filters.vocoder` نیاز به استفاده از ماژول :mod:`!echo` در بسته " +":mod:`!sound.effects` داشته باشد، می تواند از ``from sound.effects import " +"echo`` استفاده کند." #: tutorial/modules.rst:571 -msgid "You can also write relative imports, with the ``from module import name`` form of import statement. These imports use leading dots to indicate the current and parent packages involved in the relative import. From the :mod:`!surround` module for example, you might use::" +#, fuzzy +msgid "" +"You can also write relative imports, with the ``from module import name`` " +"form of import statement. These imports use leading dots to indicate the " +"current and parent packages involved in the relative import. From the " +":mod:`!surround` module for example, you might use::" msgstr "" +"شما همچنین می توانید واردات نسبی را با فرم بیانیه واردات ``from module " +"import name`` بنویسید. این واردات از نقاط پیشرو برای نشان دادن بسته های " +"فعلی و والد درگیر در واردات نسبی استفاده می کند. برای مثال از ماژول " +":mod:`!surround`، ممکن است از:" #: tutorial/modules.rst:576 -msgid "from . import echo\n" +#, fuzzy +msgid "" +"from . import echo\n" "from .. import formats\n" "from ..filters import equalizer" msgstr "" +"from . import echo\n" +"from .. import formats\n" +"from ..filters import equalizer" #: tutorial/modules.rst:580 -msgid "Note that relative imports are based on the name of the current module. Since the name of the main module is always ``\"__main__\"``, modules intended for use as the main module of a Python application must always use absolute imports." +#, fuzzy +msgid "" +"Note that relative imports are based on the name of the current module. " +"Since the name of the main module is always ``\"__main__\"``, modules " +"intended for use as the main module of a Python application must always use " +"absolute imports." msgstr "" +"توجه داشته باشید که واردات نسبی بر اساس نام ماژول فعلی است. از آنجایی که " +"نام ماژول اصلی همیشه ``\"__main__\"`` است، ماژول هایی که برای استفاده به " +"عنوان ماژول اصلی برنامه پایتون در نظر گرفته شده اند باید همیشه از واردات " +"مطلق استفاده کنند." #: tutorial/modules.rst:586 +#, fuzzy msgid "Packages in Multiple Directories" -msgstr "" +msgstr "بسته‌ها در فهرست‌های چندگانه" #: tutorial/modules.rst:588 -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 "" +#, fuzzy +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` بسته اولیه قبل از اجرای کد موجود در آن فایل است. این " +"متغیر قابل تغییر است. انجام این کار بر جستجوهای آینده برای ماژول ها و بسته " +"های فرعی موجود در بسته تأثیر می گذارد." #: tutorial/modules.rst:595 -msgid "While this feature is not often needed, it can be used to extend the set of modules found in a package." +#, fuzzy +msgid "" +"While this feature is not often needed, it can be used to extend the set of " +"modules found in a package." msgstr "" +"در حالی که این ویژگی اغلب مورد نیاز نیست، می توان از آن برای گسترش مجموعه " +"ماژول های موجود در یک بسته استفاده کرد." #: tutorial/modules.rst:600 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/modules.rst:601 -msgid "In fact function definitions are also 'statements' that are 'executed'; the execution of a module-level function definition adds the function name to the module's global namespace." +#, fuzzy +msgid "" +"In fact function definitions are also 'statements' that are 'executed'; the " +"execution of a module-level function definition adds the function name to " +"the module's global namespace." msgstr "" +"در واقع تعاریف تابع نیز «گزاره‌هایی» هستند که «اجرا می‌شوند». اجرای یک تعریف" +" تابع در سطح ماژول، نام تابع را به فضای نام جهانی ماژول اضافه می کند." -#: tutorial/modules.rst:184 -#: tutorial/modules.rst:267 -#: tutorial/modules.rst:348 +#: tutorial/modules.rst:184 tutorial/modules.rst:267 tutorial/modules.rst:348 +#, fuzzy msgid "module" -msgstr "" +msgstr "ماژول" #: tutorial/modules.rst:184 +#, fuzzy msgid "search" -msgstr "" +msgstr "جستجو کنید" #: tutorial/modules.rst:184 +#, fuzzy msgid "path" -msgstr "" +msgstr "مسیر" #: tutorial/modules.rst:267 +#, fuzzy msgid "sys" -msgstr "" +msgstr "سیستم" #: tutorial/modules.rst:348 +#, fuzzy msgid "builtins" -msgstr "" +msgstr "سازه ها" #: tutorial/modules.rst:493 +#, fuzzy msgid "__all__" -msgstr "" +msgstr "__all__" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 79a08e83..80bca82c 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -17,96 +17,179 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/stdlib.rst:5 +#, fuzzy msgid "Brief Tour of the Standard Library" -msgstr "" +msgstr "گشت مختصری از کتابخانه استاندارد" #: tutorial/stdlib.rst:11 +#, fuzzy msgid "Operating System Interface" -msgstr "" +msgstr "رابط سیستم عامل" #: tutorial/stdlib.rst:13 -msgid "The :mod:`os` module provides dozens of functions for interacting with the operating system::" +#, fuzzy +msgid "" +"The :mod:`os` module provides dozens of functions for interacting with the " +"operating system::" msgstr "" +"ماژول :mod:`os` ده ها عملکرد را برای تعامل با سیستم عامل ارائه می دهد:" #: tutorial/stdlib.rst:16 -msgid ">>> import os\n" +#, fuzzy +msgid "" +">>> import os\n" ">>> os.getcwd() # Return the current working directory\n" "'C:\\\\Python313'\n" ">>> os.chdir('/server/accesslogs') # Change current working directory\n" ">>> os.system('mkdir today') # Run the command mkdir in the system shell\n" "0" msgstr "" +">>> import os\n" +">>> os.getcwd() # Return the current working directory\n" +"'C:\\\\Python313'\n" +">>> os.chdir('/server/accesslogs') # Change current working directory\n" +">>> os.system('mkdir today') # Run the command mkdir in the system shell\n" +"0" #: tutorial/stdlib.rst:23 -msgid "Be sure to use the ``import os`` style instead of ``from os import *``. This will keep :func:`os.open` from shadowing the built-in :func:`open` function which operates much differently." +#, fuzzy +msgid "" +"Be sure to use the ``import os`` style instead of ``from os import *``. " +"This will keep :func:`os.open` from shadowing the built-in :func:`open` " +"function which operates much differently." msgstr "" +"حتما از سبک ``import os`` به جای ``from os import *`` استفاده کنید. این امر" +" باعث می‌شود که :func:`os.open` روی عملکرد داخلی :func:`open` که بسیار " +"متفاوت عمل می‌کند سایه نزند." #: tutorial/stdlib.rst:29 -msgid "The built-in :func:`dir` and :func:`help` functions are useful as interactive aids for working with large modules like :mod:`os`::" +#, fuzzy +msgid "" +"The built-in :func:`dir` and :func:`help` functions are useful as " +"interactive aids for working with large modules like :mod:`os`::" msgstr "" +"توابع داخلی :func:`dir` و :func:`help` به عنوان کمک های تعاملی برای کار با " +"ماژول های بزرگ مانند :mod:`os` مفید هستند:" #: tutorial/stdlib.rst:32 -msgid ">>> import os\n" +#, fuzzy +msgid "" +">>> import os\n" ">>> dir(os)\n" "\n" ">>> help(os)\n" "" msgstr "" +">>> import OS\n" +">>> کارگردان\n" +"<لیستی از تمام توابع ماژول را برمی گرداند>\n" +">>> کمک(ها)\n" +"<صفحه دستی گسترده ای را که از رشته های اسناد ماژول ایجاد شده است برمی گرداند>" #: tutorial/stdlib.rst:38 -msgid "For daily file and directory management tasks, the :mod:`shutil` module provides a higher level interface that is easier to use::" +#, fuzzy +msgid "" +"For daily file and directory management tasks, the :mod:`shutil` module " +"provides a higher level interface that is easier to use::" msgstr "" +"برای کارهای روزانه مدیریت فایل و دایرکتوری، ماژول :mod:`shutil` رابط سطح " +"بالاتری را ارائه می دهد که استفاده از آن آسان تر است:" #: tutorial/stdlib.rst:41 -msgid ">>> import shutil\n" +#, fuzzy +msgid "" +">>> import shutil\n" ">>> shutil.copyfile('data.db', 'archive.db')\n" "'archive.db'\n" ">>> shutil.move('/build/executables', 'installdir')\n" "'installdir'" msgstr "" +">>> import shutil\n" +">>> shutil.copyfile('data.db', 'archive.db')\n" +"'archive.db'\n" +">>> shutil.move('/build/executables', 'installdir')\n" +"'installdir'" #: tutorial/stdlib.rst:51 +#, fuzzy msgid "File Wildcards" -msgstr "" +msgstr "فایل‌های عجایب" #: tutorial/stdlib.rst:53 -msgid "The :mod:`glob` module provides a function for making file lists from directory wildcard searches::" +#, fuzzy +msgid "" +"The :mod:`glob` module provides a function for making file lists from " +"directory wildcard searches::" msgstr "" +"ماژول :mod:`glob` عملکردی را برای ایجاد لیست فایل ها از جستجوهای عام " +"دایرکتوری ارائه می دهد:" #: tutorial/stdlib.rst:56 -msgid ">>> import glob\n" +#, fuzzy +msgid "" +">>> import glob\n" ">>> glob.glob('*.py')\n" "['primes.py', 'random.py', 'quote.py']" msgstr "" +">>> import glob\n" +">>> glob.glob('*.py')\n" +"['primes.py', 'random.py', 'quote.py']" #: tutorial/stdlib.rst:64 +#, fuzzy msgid "Command Line Arguments" -msgstr "" +msgstr "آرگومان های خط فرمان" #: tutorial/stdlib.rst:66 -msgid "Common utility scripts often need to process command line arguments. These arguments are stored in the :mod:`sys` module's *argv* attribute as a list. For instance, let's take the following :file:`demo.py` file::" +#, fuzzy +msgid "" +"Common utility scripts often need to process command line arguments. These " +"arguments are stored in the :mod:`sys` module's *argv* attribute as a list." +" For instance, let's take the following :file:`demo.py` file::" msgstr "" +"اسکریپت های کاربردی رایج اغلب نیاز به پردازش آرگومان های خط فرمان دارند. این" +" آرگومان ها در ویژگی *argv* ماژول :mod:`sys` به عنوان یک لیست ذخیره می شوند." +" به عنوان مثال، اجازه دهید فایل :file:`demo.py` زیر را در نظر بگیریم:" #: tutorial/stdlib.rst:70 -msgid "# File demo.py\n" +#, fuzzy +msgid "" +"# File demo.py\n" "import sys\n" "print(sys.argv)" msgstr "" +"# File demo.py\n" +"import sys\n" +"print(sys.argv)" #: tutorial/stdlib.rst:74 -msgid "Here is the output from running ``python demo.py one two three`` at the command line::" +#, fuzzy +msgid "" +"Here is the output from running ``python demo.py one two three`` at the " +"command line::" msgstr "" +"در اینجا خروجی اجرای ``python demo.py one two three`` در خط فرمان است:" #: tutorial/stdlib.rst:77 +#, fuzzy msgid "['demo.py', 'one', 'two', 'three']" -msgstr "" +msgstr "['demo.py', 'one', 'two', 'three']" #: tutorial/stdlib.rst:79 -msgid "The :mod:`argparse` module provides a more sophisticated mechanism to process command line arguments. The following script extracts one or more filenames and an optional number of lines to be displayed::" +#, fuzzy +msgid "" +"The :mod:`argparse` module provides a more sophisticated mechanism to " +"process command line arguments. The following script extracts one or more " +"filenames and an optional number of lines to be displayed::" msgstr "" +"ماژول :mod:`argparse` مکانیزم پیچیده تری برای پردازش آرگومان های خط فرمان " +"فراهم می کند. اسکریپت زیر یک یا چند نام فایل و تعداد اختیاری خطوط را برای " +"نمایش استخراج می کند:" #: tutorial/stdlib.rst:83 -msgid "import argparse\n" +#, fuzzy +msgid "" +"import argparse\n" "\n" "parser = argparse.ArgumentParser(\n" " prog='top',\n" @@ -116,75 +199,145 @@ msgid "import argparse\n" "args = parser.parse_args()\n" "print(args)" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(\n" +" prog='top',\n" +" description='Show top lines from each file')\n" +"parser.add_argument('filenames', nargs='+')\n" +"parser.add_argument('-l', '--lines', type=int, default=10)\n" +"args = parser.parse_args()\n" +"print(args)" #: tutorial/stdlib.rst:93 -msgid "When run at the command line with ``python top.py --lines=5 alpha.txt beta.txt``, the script sets ``args.lines`` to ``5`` and ``args.filenames`` to ``['alpha.txt', 'beta.txt']``." +#, fuzzy +msgid "" +"When run at the command line with ``python top.py --lines=5 alpha.txt " +"beta.txt``, the script sets ``args.lines`` to ``5`` and ``args.filenames`` " +"to ``['alpha.txt', 'beta.txt']``." msgstr "" +"هنگامی که در خط فرمان با ``python top.py --lines=5 alpha.txt beta.txt`` اجرا" +" می شود، اسکریپت ``args.lines`` را به ``5`` و ``args.filenames`` را به " +"``['alpha.txt', 'beta.txt']`` تنظیم می کند." #: tutorial/stdlib.rst:101 +#, fuzzy msgid "Error Output Redirection and Program Termination" -msgstr "" +msgstr "خطا در تغییر مسیر خروجی و خاتمه برنامه" #: tutorial/stdlib.rst:103 -msgid "The :mod:`sys` module also has attributes for *stdin*, *stdout*, and *stderr*. The latter is useful for emitting warnings and error messages to make them visible even when *stdout* has been redirected::" +#, fuzzy +msgid "" +"The :mod:`sys` module also has attributes for *stdin*, *stdout*, and " +"*stderr*. The latter is useful for emitting warnings and error messages to " +"make them visible even when *stdout* has been redirected::" msgstr "" +"ماژول :mod:`sys` همچنین دارای ویژگی هایی برای *stdin*، *stdout* و *stderr* " +"است. مورد دوم برای ارسال اخطارها و پیام های خطا مفید است تا آنها را حتی " +"زمانی که *stdout* هدایت شده است قابل مشاهده کند:" #: tutorial/stdlib.rst:107 -msgid ">>> sys.stderr.write('Warning, log file not found starting a new one\\n')\n" +#, fuzzy +msgid "" +">>> sys.stderr.write('Warning, log file not found starting a new one\\n')\n" "Warning, log file not found starting a new one" msgstr "" +">>> sys.stderr.write('هشدار, فایل لاگ پیدا نشد و یک فایل جدید شروع می شود\\n')\n" +"اخطار، فایل log با شروع یک فایل جدید پیدا نشد" #: tutorial/stdlib.rst:110 +#, fuzzy msgid "The most direct way to terminate a script is to use ``sys.exit()``." msgstr "" +"مستقیم ترین راه برای پایان دادن به یک اسکریپت استفاده از ``sys.exit()`` است." #: tutorial/stdlib.rst:116 +#, fuzzy msgid "String Pattern Matching" -msgstr "" +msgstr "تطبیق الگوی رشته" #: tutorial/stdlib.rst:118 -msgid "The :mod:`re` module provides regular expression tools for advanced string processing. For complex matching and manipulation, regular expressions offer succinct, optimized solutions::" +#, fuzzy +msgid "" +"The :mod:`re` module provides regular expression tools for advanced string " +"processing. For complex matching and manipulation, regular expressions offer" +" succinct, optimized solutions::" msgstr "" +"ماژول :mod:`re` ابزارهای بیان منظم را برای پردازش رشته های پیشرفته فراهم می " +"کند. برای تطبیق و دستکاری پیچیده، عبارات منظم راه حل های مختصر و بهینه ارائه" +" می دهند:" #: tutorial/stdlib.rst:122 -msgid ">>> import re\n" +#, fuzzy +msgid "" +">>> import re\n" ">>> re.findall(r'\\bf[a-z]*', 'which foot or hand fell fastest')\n" "['foot', 'fell', 'fastest']\n" ">>> re.sub(r'(\\b[a-z]+) \\1', r'\\1', 'cat in the the hat')\n" "'cat in the hat'" msgstr "" +">>> import re\n" +">>> re.findall(r'\\bf[a-z]*', 'which foot or hand fell fastest')\n" +"['foot', 'fell', 'fastest']\n" +">>> re.sub(r'(\\b[a-z]+) \\1', r'\\1', 'cat in the the hat')\n" +"'cat in the hat'" #: tutorial/stdlib.rst:128 -msgid "When only simple capabilities are needed, string methods are preferred because they are easier to read and debug::" +#, fuzzy +msgid "" +"When only simple capabilities are needed, string methods are preferred " +"because they are easier to read and debug::" msgstr "" +"هنگامی که فقط به قابلیت های ساده نیاز است، روش های رشته ای ترجیح داده می " +"شوند زیرا خواندن و اشکال زدایی آنها آسان تر است::" #: tutorial/stdlib.rst:131 -msgid ">>> 'tea for too'.replace('too', 'two')\n" +#, fuzzy +msgid "" +">>> 'tea for too'.replace('too', 'two')\n" "'tea for two'" msgstr "" +">>> 'tea for too'.replace('too', 'two')\n" +"'tea for two'" #: tutorial/stdlib.rst:138 +#, fuzzy msgid "Mathematics" -msgstr "" +msgstr "ریاضیات" #: tutorial/stdlib.rst:140 -msgid "The :mod:`math` module gives access to the underlying C library functions for floating-point math::" +#, fuzzy +msgid "" +"The :mod:`math` module gives access to the underlying C library functions " +"for floating-point math::" msgstr "" +"ماژول :mod:`math` به توابع کتابخانه زیرین C برای ریاضیات ممیز شناور دسترسی " +"می دهد:" #: tutorial/stdlib.rst:143 -msgid ">>> import math\n" +#, fuzzy +msgid "" +">>> import math\n" ">>> math.cos(math.pi / 4)\n" "0.70710678118654757\n" ">>> math.log(1024, 2)\n" "10.0" msgstr "" +">>> import math\n" +">>> math.cos(math.pi / 4)\n" +"0.70710678118654757\n" +">>> math.log(1024, 2)\n" +"10.0" #: tutorial/stdlib.rst:149 +#, fuzzy msgid "The :mod:`random` module provides tools for making random selections::" -msgstr "" +msgstr "ماژول :mod:`random` ابزارهایی را برای انتخاب تصادفی فراهم می کند:" #: tutorial/stdlib.rst:151 -msgid ">>> import random\n" +#, fuzzy +msgid "" +">>> import random\n" ">>> random.choice(['apple', 'pear', 'banana'])\n" "'apple'\n" ">>> random.sample(range(100), 10) # sampling without replacement\n" @@ -194,13 +347,29 @@ msgid ">>> import random\n" ">>> random.randrange(6) # random integer chosen from range(6)\n" "4" msgstr "" +">>> import random\n" +">>> random.choice(['apple', 'pear', 'banana'])\n" +"'apple'\n" +">>> random.sample(range(100), 10) # sampling without replacement\n" +"[30, 83, 16, 4, 8, 81, 41, 50, 18, 33]\n" +">>> random.random() # random float from the interval [0.0, 1.0)\n" +"0.17970987693706186\n" +">>> random.randrange(6) # random integer chosen from range(6)\n" +"4" #: tutorial/stdlib.rst:161 -msgid "The :mod:`statistics` module calculates basic statistical properties (the mean, median, variance, etc.) of numeric data::" +#, fuzzy +msgid "" +"The :mod:`statistics` module calculates basic statistical properties (the " +"mean, median, variance, etc.) of numeric data::" msgstr "" +"ماژول :mod:`statistics` ویژگی های آماری پایه (میانگین, میانه, واریانس و " +"غیره) داده های عددی را محاسبه می کند:" #: tutorial/stdlib.rst:164 -msgid ">>> import statistics\n" +#, fuzzy +msgid "" +">>> import statistics\n" ">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" ">>> statistics.mean(data)\n" "1.6071428571428572\n" @@ -209,21 +378,44 @@ msgid ">>> import statistics\n" ">>> statistics.variance(data)\n" "1.3720238095238095" msgstr "" +">>> import statistics\n" +">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" +">>> statistics.mean(data)\n" +"1.6071428571428572\n" +">>> statistics.median(data)\n" +"1.25\n" +">>> statistics.variance(data)\n" +"1.3720238095238095" #: tutorial/stdlib.rst:173 -msgid "The SciPy project has many other modules for numerical computations." +#, fuzzy +msgid "" +"The SciPy project has many other modules for numerical " +"computations." msgstr "" +"پروژه SciPy دارای بسیاری از ماژول های دیگر برای محاسبات " +"عددی است." #: tutorial/stdlib.rst:179 +#, fuzzy msgid "Internet Access" -msgstr "" +msgstr "دسترسی به اینترنت" #: tutorial/stdlib.rst:181 -msgid "There are a number of modules for accessing the internet and processing internet protocols. Two of the simplest are :mod:`urllib.request` for retrieving data from URLs and :mod:`smtplib` for sending mail::" +#, fuzzy +msgid "" +"There are a number of modules for accessing the internet and processing " +"internet protocols. Two of the simplest are :mod:`urllib.request` for " +"retrieving data from URLs and :mod:`smtplib` for sending mail::" msgstr "" +"تعدادی ماژول برای دسترسی به اینترنت و پردازش پروتکل های اینترنتی وجود دارد. " +"دو مورد از ساده ترین آنها :mod:`urllib.request` برای بازیابی داده ها از URL " +"ها و :mod:`smtplib` برای ارسال نامه هستند:" #: tutorial/stdlib.rst:185 -msgid ">>> from urllib.request import urlopen\n" +#, fuzzy +msgid "" +">>> from urllib.request import urlopen\n" ">>> with urlopen('http://worldtimeapi.org/api/timezone/etc/UTC.txt') as response:\n" "... for line in response:\n" "... line = line.decode() # Convert bytes to a str\n" @@ -242,21 +434,57 @@ msgid ">>> from urllib.request import urlopen\n" "... \"\"\")\n" ">>> server.quit()" msgstr "" +">>> از urllib.request import urlopen\n" +">>> با urlopen('http://worldtimeapi.org/api/timezone/etc/UTC.txt') به عنوان پاسخ:\n" +"... برای خط در پاسخ:\n" +"... line = line.decode() # تبدیل بایت ها به str\n" +"... if line.startswith('datetime'):\n" +"... print(line.rstrip()) # حذف آخرین خط جدید\n" +"...\n" +"تاریخ: 2022-01-01T01:36:47.689215+00:00\n" +"\n" +">>> وارد کردن smtplib\n" +">>> سرور = smtplib.SMTP('localhost')\n" +">>> server.sendmail('soothsayer@example.org', 'jcaesar@example.org',\n" +"... \"\"\"به: jcaesar@example.org\n" +"... از: soothsayer@example.org\n" +"...\n" +"... مراقب ایدهای ماه مارس باشید.\n" +"... \"\"\")\n" +">>> server.quit()" #: tutorial/stdlib.rst:204 -msgid "(Note that the second example needs a mailserver running on localhost.)" +#, fuzzy +msgid "" +"(Note that the second example needs a mailserver running on localhost.)" msgstr "" +"(توجه داشته باشید که مثال دوم نیاز به یک میل سرور دارد که روی لوکال هاست " +"اجرا می شود.)" #: tutorial/stdlib.rst:210 +#, fuzzy msgid "Dates and Times" -msgstr "" +msgstr "Dates and Times" #: tutorial/stdlib.rst:212 -msgid "The :mod:`datetime` module supplies classes for manipulating dates and times in both simple and complex ways. While date and time arithmetic is supported, the focus of the implementation is on efficient member extraction for output formatting and manipulation. The module also supports objects that are timezone aware. ::" -msgstr "" +#, fuzzy +msgid "" +"The :mod:`datetime` module supplies classes for manipulating dates and times" +" in both simple and complex ways. While date and time arithmetic is " +"supported, the focus of the implementation is on efficient member extraction" +" for output formatting and manipulation. The module also supports objects " +"that are timezone aware. ::" +msgstr "" +"ماژول :mod:`datetime` کلاس هایی را برای دستکاری تاریخ ها و زمان ها به دو روش" +" ساده و پیچیده فراهم می کند. در حالی که محاسبات تاریخ و زمان پشتیبانی می " +"شود، تمرکز پیاده سازی بر استخراج کارآمد اعضا برای قالب بندی و دستکاری خروجی " +"است. این ماژول همچنین از اشیایی که از منطقه زمانی آگاه هستند پشتیبانی می " +"کند. ::" #: tutorial/stdlib.rst:218 -msgid ">>> # dates are easily constructed and formatted\n" +#, fuzzy +msgid "" +">>> # dates are easily constructed and formatted\n" ">>> from datetime import date\n" ">>> now = date.today()\n" ">>> now\n" @@ -270,17 +498,40 @@ msgid ">>> # dates are easily constructed and formatted\n" ">>> age.days\n" "14368" msgstr "" +">>> # dates are easily constructed and formatted\n" +">>> from datetime import date\n" +">>> now = date.today()\n" +">>> now\n" +"datetime.date(2003, 12, 2)\n" +">>> now.strftime(\"%m-%d-%y. %d %b %Y is a %A on the %d day of %B.\")\n" +"'12-02-03. 02 Dec 2003 is a Tuesday on the 02 day of December.'\n" +"\n" +">>> # dates support calendar arithmetic\n" +">>> birthday = date(1964, 7, 31)\n" +">>> age = now - birthday\n" +">>> age.days\n" +"14368" #: tutorial/stdlib.rst:236 +#, fuzzy msgid "Data Compression" -msgstr "" +msgstr "فشرده سازی داده ها" #: tutorial/stdlib.rst:238 -msgid "Common data archiving and compression formats are directly supported by modules including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, :mod:`zipfile` and :mod:`tarfile`. ::" +#, fuzzy +msgid "" +"Common data archiving and compression formats are directly supported by " +"modules including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, " +":mod:`zipfile` and :mod:`tarfile`. ::" msgstr "" +"فرمت‌های رایج بایگانی و فشرده‌سازی داده‌ها مستقیماً توسط ماژول‌هایی از جمله:" +" :mod:`zlib`، :mod:`gzip`، :mod:`bz2`، :mod:`lzma`، :mod:`zipfile` و " +":mod:`tarfile` پشتیبانی می‌شوند. ::" #: tutorial/stdlib.rst:242 -msgid ">>> import zlib\n" +#, fuzzy +msgid "" +">>> import zlib\n" ">>> s = b'witch which has which witches wrist watch'\n" ">>> len(s)\n" "41\n" @@ -292,45 +543,106 @@ msgid ">>> import zlib\n" ">>> zlib.crc32(s)\n" "226805979" msgstr "" +">>> import zlib\n" +">>> s = b'witch which has which witches wrist watch'\n" +">>> len(s)\n" +"41\n" +">>> t = zlib.compress(s)\n" +">>> len(t)\n" +"37\n" +">>> zlib.decompress(t)\n" +"b'witch which has which witches wrist watch'\n" +">>> zlib.crc32(s)\n" +"226805979" #: tutorial/stdlib.rst:258 +#, fuzzy msgid "Performance Measurement" -msgstr "" +msgstr "اندازه گیری عملکرد" #: tutorial/stdlib.rst:260 -msgid "Some Python users develop a deep interest in knowing the relative performance of different approaches to the same problem. Python provides a measurement tool that answers those questions immediately." +#, fuzzy +msgid "" +"Some Python users develop a deep interest in knowing the relative " +"performance of different approaches to the same problem. Python provides a " +"measurement tool that answers those questions immediately." msgstr "" +"برخی از کاربران پایتون علاقه عمیقی به دانستن عملکرد نسبی رویکردهای مختلف " +"برای یک مشکل دارند. پایتون یک ابزار اندازه گیری ارائه می دهد که بلافاصله به " +"این سوالات پاسخ می دهد." #: tutorial/stdlib.rst:264 -msgid "For example, it may be tempting to use the tuple packing and unpacking feature instead of the traditional approach to swapping arguments. The :mod:`timeit` module quickly demonstrates a modest performance advantage::" +#, fuzzy +msgid "" +"For example, it may be tempting to use the tuple packing and unpacking " +"feature instead of the traditional approach to swapping arguments. The " +":mod:`timeit` module quickly demonstrates a modest performance advantage::" msgstr "" +"به عنوان مثال، ممکن است استفاده از ویژگی بسته بندی و باز کردن بسته بندی به " +"جای رویکرد سنتی برای تعویض آرگومان ها وسوسه انگیز باشد. ماژول :mod:`timeit` " +"به سرعت یک مزیت عملکرد متوسط ​​را نشان می دهد:" #: tutorial/stdlib.rst:268 -msgid ">>> from timeit import Timer\n" +#, fuzzy +msgid "" +">>> from timeit import Timer\n" ">>> Timer('t=a; a=b; b=t', 'a=1; b=2').timeit()\n" "0.57535828626024577\n" ">>> Timer('a,b = b,a', 'a=1; b=2').timeit()\n" "0.54962537085770791" msgstr "" +">>> from timeit import Timer\n" +">>> Timer('t=a; a=b; b=t', 'a=1; b=2').timeit()\n" +"0.57535828626024577\n" +">>> Timer('a,b = b,a', 'a=1; b=2').timeit()\n" +"0.54962537085770791" #: tutorial/stdlib.rst:274 -msgid "In contrast to :mod:`timeit`'s fine level of granularity, the :mod:`profile` and :mod:`pstats` modules provide tools for identifying time critical sections in larger blocks of code." +#, fuzzy +msgid "" +"In contrast to :mod:`timeit`'s fine level of granularity, the :mod:`profile`" +" and :mod:`pstats` modules provide tools for identifying time critical " +"sections in larger blocks of code." msgstr "" +"برخلاف سطح دقیق دانه‌بندی :mod:`timeit`، ماژول‌های :mod:`profile` و " +":mod:`pstats` ابزارهایی را برای شناسایی بخش‌های حساس زمانی در بلوک‌های " +"بزرگ‌تر کد ارائه می‌کنند." #: tutorial/stdlib.rst:282 +#, fuzzy msgid "Quality Control" -msgstr "" +msgstr "کنترل کیفیت" #: tutorial/stdlib.rst:284 -msgid "One approach for developing high quality software is to write tests for each function as it is developed and to run those tests frequently during the development process." +#, fuzzy +msgid "" +"One approach for developing high quality software is to write tests for each" +" function as it is developed and to run those tests frequently during the " +"development process." msgstr "" +"یکی از روش‌های توسعه نرم‌افزار با کیفیت بالا، نوشتن تست‌ها برای هر عملکرد در" +" حین توسعه و اجرای مکرر آن تست‌ها در طول فرآیند توسعه است." #: tutorial/stdlib.rst:288 -msgid "The :mod:`doctest` module provides a tool for scanning a module and validating tests embedded in a program's docstrings. Test construction is as simple as cutting-and-pasting a typical call along with its results into the docstring. This improves the documentation by providing the user with an example and it allows the doctest module to make sure the code remains true to the documentation::" -msgstr "" +#, fuzzy +msgid "" +"The :mod:`doctest` module provides a tool for scanning a module and " +"validating tests embedded in a program's docstrings. Test construction is " +"as simple as cutting-and-pasting a typical call along with its results into " +"the docstring. This improves the documentation by providing the user with an" +" example and it allows the doctest module to make sure the code remains true" +" to the documentation::" +msgstr "" +"ماژول :mod:`doctest` ابزاری را برای اسکن یک ماژول و اعتبارسنجی تست‌های " +"تعبیه‌شده در رشته‌های اسناد برنامه فراهم می‌کند. ساخت تست به سادگی برش و " +"چسباندن یک تماس معمولی همراه با نتایج آن در رشته مستندسازی است. این با ارائه" +" یک مثال به کاربر، مستندات را بهبود می‌بخشد و به ماژول doctest اجازه می‌دهد " +"تا مطمئن شود که کد به مستندات صادق است::" #: tutorial/stdlib.rst:295 -msgid "def average(values):\n" +#, fuzzy +msgid "" +"def average(values):\n" " \"\"\"Computes the arithmetic mean of a list of numbers.\n" "\n" " >>> print(average([20, 30, 70]))\n" @@ -341,13 +653,31 @@ msgid "def average(values):\n" "import doctest\n" "doctest.testmod() # automatically validate the embedded tests" msgstr "" +"def average(values):\n" +" \"\"\"Computes the arithmetic mean of a list of numbers.\n" +"\n" +" >>> print(average([20, 30, 70]))\n" +" 40.0\n" +" \"\"\"\n" +" return sum(values) / len(values)\n" +"\n" +"import doctest\n" +"doctest.testmod() # automatically validate the embedded tests" #: tutorial/stdlib.rst:306 -msgid "The :mod:`unittest` module is not as effortless as the :mod:`doctest` module, but it allows a more comprehensive set of tests to be maintained in a separate file::" +#, fuzzy +msgid "" +"The :mod:`unittest` module is not as effortless as the :mod:`doctest` " +"module, but it allows a more comprehensive set of tests to be maintained in " +"a separate file::" msgstr "" +"ماژول :mod:`unittest` به آسانی ماژول :mod:`doctest` نیست، اما اجازه می دهد " +"مجموعه جامع تری از تست ها در یک فایل جداگانه نگهداری شود:" #: tutorial/stdlib.rst:310 -msgid "import unittest\n" +#, fuzzy +msgid "" +"import unittest\n" "\n" "class TestStatisticalFunctions(unittest.TestCase):\n" "\n" @@ -361,39 +691,107 @@ msgid "import unittest\n" "\n" "unittest.main() # Calling from the command line invokes all tests" msgstr "" +"import unittest\n" +"\n" +"class TestStatisticalFunctions(unittest.TestCase):\n" +"\n" +" def test_average(self):\n" +" self.assertEqual(average([20, 30, 70]), 40.0)\n" +" self.assertEqual(round(average([1, 5, 7]), 1), 4.3)\n" +" with self.assertRaises(ZeroDivisionError):\n" +" average([])\n" +" with self.assertRaises(TypeError):\n" +" average(20, 30, 70)\n" +"\n" +"unittest.main() # Calling from the command line invokes all tests" #: tutorial/stdlib.rst:328 +#, fuzzy msgid "Batteries Included" -msgstr "" +msgstr "باتری های گنجانده شده است" #: tutorial/stdlib.rst:330 -msgid "Python has a \"batteries included\" philosophy. This is best seen through the sophisticated and robust capabilities of its larger packages. For example:" +#, fuzzy +msgid "" +"Python has a \"batteries included\" philosophy. This is best seen through " +"the sophisticated and robust capabilities of its larger packages. For " +"example:" msgstr "" +"پایتون یک فلسفه \"شامل باتری\" دارد. این به خوبی از طریق قابلیت های پیچیده " +"و قوی بسته های بزرگتر آن قابل مشاهده است. به عنوان مثال:" #: tutorial/stdlib.rst:333 -msgid "The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementing remote procedure calls into an almost trivial task. Despite the modules' names, no direct knowledge or handling of XML is needed." +#, fuzzy +msgid "" +"The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementing " +"remote procedure calls into an almost trivial task. Despite the modules' " +"names, no direct knowledge or handling of XML is needed." msgstr "" +"ماژول‌های :mod:`xmlrpc.client` و :mod:`xmlrpc.server` اجرای فراخوانی‌های " +"رویه از راه دور را به یک کار تقریباً بی‌اهمیت تبدیل می‌کنند. با وجود نام " +"ماژول ها، هیچ دانش یا مدیریت مستقیم XML مورد نیاز نیست." #: tutorial/stdlib.rst:337 -msgid "The :mod:`email` package is a library for managing email messages, including MIME and other :rfc:`2822`-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 "" +#, fuzzy +msgid "" +"The :mod:`email` package is a library for managing email messages, including" +" MIME and other :rfc:`2822`-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:`2822` است. برخلاف :mod:`smtplib` و " +":mod:`poplib` که در واقع پیام‌ها را ارسال و دریافت می‌کنند، بسته ایمیل دارای" +" یک مجموعه ابزار کامل برای ساخت یا رمزگشایی ساختارهای پیام پیچیده (از جمله " +"پیوست‌ها) و برای اجرای کدگذاری اینترنتی و پروتکل‌های هدر است." #: tutorial/stdlib.rst:344 -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 "" +#, fuzzy +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` از خواندن و نوشتن مستقیم فایل ها با فرمت مقدار جدا " +"شده با کاما پشتیبانی می کند که معمولاً توسط پایگاه های داده و صفحات گسترده " +"پشتیبانی می شود. پردازش XML توسط بسته های :mod:`xml.etree.ElementTree`، " +":mod:`xml.dom` و :mod:`xml.sax` پشتیبانی می شود. این ماژول‌ها و بسته‌ها با " +"هم تبادل داده‌ها را بین برنامه‌های پایتون و ابزارهای دیگر بسیار ساده " +"می‌کنند." #: tutorial/stdlib.rst:353 -msgid "The :mod:`sqlite3` module is a wrapper for the SQLite database library, providing a persistent database that can be updated and accessed using slightly nonstandard SQL syntax." +#, fuzzy +msgid "" +"The :mod:`sqlite3` module is a wrapper for the SQLite database library, " +"providing a persistent database that can be updated and accessed using " +"slightly nonstandard SQL syntax." msgstr "" +"ماژول :mod:`sqlite3` پوششی برای کتابخانه پایگاه داده SQLite است که یک پایگاه" +" داده پایدار را ارائه می دهد که می تواند با استفاده از نحو کمی غیر استاندارد" +" SQL به روز شود و به آن دسترسی داشت." #: tutorial/stdlib.rst:357 -msgid "Internationalization is supported by a number of modules including :mod:`gettext`, :mod:`locale`, and the :mod:`codecs` package." +#, fuzzy +msgid "" +"Internationalization is supported by a number of modules including " +":mod:`gettext`, :mod:`locale`, and the :mod:`codecs` package." msgstr "" +"بین المللی سازی توسط تعدادی ماژول از جمله :mod:`gettext`، :mod:`locale` و " +"بسته :mod:`codecs` پشتیبانی می شود." #: tutorial/stdlib.rst:27 +#, fuzzy msgid "built-in function" -msgstr "" +msgstr "عملکرد داخلی" #: tutorial/stdlib.rst:27 +#, fuzzy msgid "help" -msgstr "" +msgstr "کمک کند" diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index 33ce2ab9..cefa704e 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -17,33 +17,62 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/stdlib2.rst:5 +#, fuzzy msgid "Brief Tour of the Standard Library --- Part II" -msgstr "" +msgstr "گشت مختصری از کتابخانه استاندارد --- قسمت دوم" #: tutorial/stdlib2.rst:7 -msgid "This second tour covers more advanced modules that support professional programming needs. These modules rarely occur in small scripts." +#, fuzzy +msgid "" +"This second tour covers more advanced modules that support professional " +"programming needs. These modules rarely occur in small scripts." msgstr "" +"این تور دوم ماژول های پیشرفته تری را پوشش می دهد که نیازهای برنامه نویسی " +"حرفه ای را پشتیبانی می کند. این ماژول ها به ندرت در اسکریپت های کوچک وجود " +"دارند." #: tutorial/stdlib2.rst:14 +#, fuzzy msgid "Output Formatting" -msgstr "" +msgstr "قالب بندی خروجی" #: tutorial/stdlib2.rst:16 -msgid "The :mod:`reprlib` module provides a version of :func:`repr` customized for abbreviated displays of large or deeply nested containers::" +#, fuzzy +msgid "" +"The :mod:`reprlib` module provides a version of :func:`repr` customized for " +"abbreviated displays of large or deeply nested containers::" msgstr "" +"ماژول :mod:`reprlib` نسخه ای از :func:`repr` را ارائه می دهد که برای نمایش " +"های مختصر ظروف بزرگ یا عمیق تو در تو سفارشی شده است:" #: tutorial/stdlib2.rst:19 -msgid ">>> import reprlib\n" +#, fuzzy +msgid "" +">>> import reprlib\n" ">>> reprlib.repr(set('supercalifragilisticexpialidocious'))\n" "\"{'a', 'c', 'd', 'e', 'f', 'g', ...}\"" msgstr "" +">>> import reprlib\n" +">>> reprlib.repr(set('supercalifragilisticexpialidocious'))\n" +"\"{'a', 'c', 'd', 'e', 'f', 'g', ...}\"" #: tutorial/stdlib2.rst:23 -msgid "The :mod:`pprint` module offers more sophisticated control over printing both built-in and user defined objects in a way that is readable by the interpreter. When the result is longer than one line, the \"pretty printer\" adds line breaks and indentation to more clearly reveal data structure::" +#, fuzzy +msgid "" +"The :mod:`pprint` module offers more sophisticated control over printing " +"both built-in and user defined objects in a way that is readable by the " +"interpreter. When the result is longer than one line, the \"pretty printer\"" +" adds line breaks and indentation to more clearly reveal data structure::" msgstr "" +"ماژول :mod:`pprint` کنترل پیچیده تری را بر روی چاپ اشیاء داخلی و تعریف شده " +"توسط کاربر به روشی قابل خواندن توسط مفسر ارائه می دهد. هنگامی که نتیجه " +"طولانی‌تر از یک خط باشد، «چاپگر زیبا» شکستگی‌ها و تورفتگی‌های خط را اضافه " +"می‌کند تا ساختار داده را به وضوح نشان دهد:" #: tutorial/stdlib2.rst:28 -msgid ">>> import pprint\n" +#, fuzzy +msgid "" +">>> import pprint\n" ">>> t = [[[['black', 'cyan'], 'white', ['green', 'red']], [['magenta',\n" "... 'yellow'], 'blue']]]\n" "...\n" @@ -54,13 +83,30 @@ msgid ">>> import pprint\n" " [['magenta', 'yellow'],\n" " 'blue']]]" msgstr "" +">>> import pprint\n" +">>> t = [[[['black', 'cyan'], 'white', ['green', 'red']], [['magenta',\n" +"... 'yellow'], 'blue']]]\n" +"...\n" +">>> pprint.pprint(t, width=30)\n" +"[[[['black', 'cyan'],\n" +" 'white',\n" +" ['green', 'red']],\n" +" [['magenta', 'yellow'],\n" +" 'blue']]]" #: tutorial/stdlib2.rst:39 -msgid "The :mod:`textwrap` module formats paragraphs of text to fit a given screen width::" +#, fuzzy +msgid "" +"The :mod:`textwrap` module formats paragraphs of text to fit a given screen " +"width::" msgstr "" +"ماژول :mod:`textwrap` پاراگراف های متن را به گونه ای قالب بندی می کند که عرض" +" صفحه نمایش داده شود:" #: tutorial/stdlib2.rst:42 -msgid ">>> import textwrap\n" +#, fuzzy +msgid "" +">>> import textwrap\n" ">>> doc = \"\"\"The wrap() method is just like fill() except that it returns\n" "... a list of strings instead of one big string with newlines to separate\n" "... the wrapped lines.\"\"\"\n" @@ -71,13 +117,32 @@ msgid ">>> import textwrap\n" "instead of one big string with newlines\n" "to separate the wrapped lines." msgstr "" +">>> وارد کردن textwrap\n" +">>> doc = \"\"\"متد wrap () درست مانند fill() است با این تفاوت که برمی گردد\n" +"... لیستی از رشته ها به جای یک رشته بزرگ با خطوط جدید برای جدا کردن\n" +"... خطوط پیچیده.\"\"\"\n" +"...\n" +">>> print(textwrap.fill(doc, width=40))\n" +"متد wrap() درست مانند fill() است.\n" +"به جز اینکه لیستی از رشته ها را برمی گرداند\n" +"به جای یک رشته بزرگ با خطوط جدید\n" +"برای جدا کردن خطوط پیچیده شده" #: tutorial/stdlib2.rst:53 -msgid "The :mod:`locale` module accesses a database of culture specific data formats. The grouping attribute of locale's format function provides a direct way of formatting numbers with group separators::" +#, fuzzy +msgid "" +"The :mod:`locale` module accesses a database of culture specific data " +"formats. The grouping attribute of locale's format function provides a " +"direct way of formatting numbers with group separators::" msgstr "" +"ماژول :mod:`locale` به پایگاه داده ای از فرمت های داده خاص فرهنگ دسترسی " +"دارد. ویژگی گروه‌بندی تابع قالب محلی یک روش مستقیم برای قالب‌بندی اعداد با " +"جداکننده‌های گروه ارائه می‌کند:" #: tutorial/stdlib2.rst:57 -msgid ">>> import locale\n" +#, fuzzy +msgid "" +">>> import locale\n" ">>> locale.setlocale(locale.LC_ALL, 'English_United States.1252')\n" "'English_United States.1252'\n" ">>> conv = locale.localeconv() # get a mapping of conventions\n" @@ -88,32 +153,81 @@ msgid ">>> import locale\n" "... conv['frac_digits'], x), grouping=True)\n" "'$1,234,567.80'" msgstr "" +">>> import locale\n" +">>> locale.setlocale(locale.LC_ALL, 'English_United States.1252')\n" +"'English_United States.1252'\n" +">>> conv = locale.localeconv() # get a mapping of conventions\n" +">>> x = 1234567.8\n" +">>> locale.format_string(\"%d\", x, grouping=True)\n" +"'1,234,567'\n" +">>> locale.format_string(\"%s%.*f\", (conv['currency_symbol'],\n" +"... conv['frac_digits'], x), grouping=True)\n" +"'$1,234,567.80'" #: tutorial/stdlib2.rst:72 +#, fuzzy msgid "Templating" -msgstr "" +msgstr "الگوسازی" #: tutorial/stdlib2.rst:74 -msgid "The :mod:`string` module includes a versatile :class:`~string.Template` class with a simplified syntax suitable for editing by end-users. This allows users to customize their applications without having to alter the application." +#, fuzzy +msgid "" +"The :mod:`string` module includes a versatile :class:`~string.Template` " +"class with a simplified syntax suitable for editing by end-users. This " +"allows users to customize their applications without having to alter the " +"application." msgstr "" +"ماژول :mod:`string` شامل یک کلاس همه کاره :class:`~string.Template` با یک " +"نحو ساده شده است که برای ویرایش توسط کاربران نهایی مناسب است. این به " +"کاربران اجازه می دهد تا برنامه های خود را بدون نیاز به تغییر برنامه شخصی " +"سازی کنند." #: tutorial/stdlib2.rst:78 -msgid "The format uses placeholder names formed by ``$`` with valid Python identifiers (alphanumeric characters and underscores). Surrounding the placeholder with braces allows it to be followed by more alphanumeric letters with no intervening spaces. Writing ``$$`` creates a single escaped ``$``::" +#, fuzzy +msgid "" +"The format uses placeholder names formed by ``$`` with valid Python " +"identifiers (alphanumeric characters and underscores). Surrounding the " +"placeholder with braces allows it to be followed by more alphanumeric " +"letters with no intervening spaces. Writing ``$$`` creates a single escaped" +" ``$``::" msgstr "" +"این فرمت از نام‌های مکان‌نما استفاده می‌کند که توسط ``$`` با شناسه‌های معتبر" +" پایتون (کاراکترهای الفبایی و زیرخط) تشکیل شده‌اند. احاطه کردن مکان نگهدار " +"با پرانتز به آن اجازه می دهد تا با حروف الفبایی عددی بیشتری بدون فاصله میانی" +" دنبال شود. نوشتن ``$$`` یک ``$`` واحد ایجاد می کند::" #: tutorial/stdlib2.rst:83 -msgid ">>> from string import Template\n" +#, fuzzy +msgid "" +">>> from string import Template\n" ">>> t = Template('${village}folk send $$10 to $cause.')\n" ">>> t.substitute(village='Nottingham', cause='the ditch fund')\n" "'Nottinghamfolk send $10 to the ditch fund.'" msgstr "" +">>> from string import Template\n" +">>> t = Template('${village}folk send $$10 to $cause.')\n" +">>> t.substitute(village='Nottingham', cause='the ditch fund')\n" +"'Nottinghamfolk send $10 to the ditch fund.'" #: tutorial/stdlib2.rst:88 -msgid "The :meth:`~string.Template.substitute` method raises a :exc:`KeyError` when a placeholder is not supplied in a dictionary or a keyword argument. For mail-merge style applications, user supplied data may be incomplete and the :meth:`~string.Template.safe_substitute` method may be more appropriate --- it will leave placeholders unchanged if data is missing::" -msgstr "" +#, fuzzy +msgid "" +"The :meth:`~string.Template.substitute` method raises a :exc:`KeyError` when" +" a placeholder is not supplied in a dictionary or a keyword argument. For " +"mail-merge style applications, user supplied data may be incomplete and the " +":meth:`~string.Template.safe_substitute` method may be more appropriate --- " +"it will leave placeholders unchanged if data is missing::" +msgstr "" +"روش :meth:`~string.Template.substitute` یک :exc:`KeyError` را زمانی افزایش " +"می دهد که یک مکان نگهدار در فرهنگ لغت یا آرگومان کلمه کلیدی ارائه نشده باشد." +" برای برنامه‌های سبک ادغام ایمیل، داده‌های ارائه‌شده توسط کاربر ممکن است " +"ناقص باشد و روش :meth:`~string.Template.safe_substitute` ممکن است مناسب‌تر " +"باشد --- اگر داده‌ها از دست رفته باشد، متغیرهایی را بدون تغییر می‌گذارد:" #: tutorial/stdlib2.rst:94 -msgid ">>> t = Template('Return the $item to $owner.')\n" +#, fuzzy +msgid "" +">>> t = Template('Return the $item to $owner.')\n" ">>> d = dict(item='unladen swallow')\n" ">>> t.substitute(d)\n" "Traceback (most recent call last):\n" @@ -122,13 +236,32 @@ msgid ">>> t = Template('Return the $item to $owner.')\n" ">>> t.safe_substitute(d)\n" "'Return the unladen swallow to $owner.'" msgstr "" +">>> t = Template('item $ را به $owner برگردانید.')\n" +">>> d = دیکت (آیتم='پرستو بدون بار')\n" +">>> t.substitute(d)\n" +"ردیابی (آخرین تماس اخیر):\n" +" ...\n" +"خطای کلیدی: \"مالک\"\n" +">>> t.safe_substitute(d)\n" +"'پرستو بدون بار را به $owner برگردانید.'" #: tutorial/stdlib2.rst:103 -msgid "Template subclasses can specify a custom delimiter. For example, a batch renaming utility for a photo browser may elect to use percent signs for placeholders such as the current date, image sequence number, or file format::" +#, fuzzy +msgid "" +"Template subclasses can specify a custom delimiter. For example, a batch " +"renaming utility for a photo browser may elect to use percent signs for " +"placeholders such as the current date, image sequence number, or file " +"format::" msgstr "" +"زیر کلاس های الگو می توانند یک جداکننده سفارشی را مشخص کنند. به عنوان مثال،" +" یک ابزار تغییر نام دسته‌ای برای مرورگر عکس ممکن است انتخاب کند که از " +"نشانه‌های درصد برای متغیرهایی مانند تاریخ فعلی، شماره توالی تصویر یا قالب " +"فایل استفاده کند:" #: tutorial/stdlib2.rst:107 -msgid ">>> import time, os.path\n" +#, fuzzy +msgid "" +">>> import time, os.path\n" ">>> photofiles = ['img_1074.jpg', 'img_1076.jpg', 'img_1077.jpg']\n" ">>> class BatchRename(Template):\n" "... delimiter = '%'\n" @@ -147,21 +280,63 @@ msgid ">>> import time, os.path\n" "img_1076.jpg --> Ashley_1.jpg\n" "img_1077.jpg --> Ashley_2.jpg" msgstr "" +">>> زمان واردات, os.path\n" +">>> فایلهای عکس = ['img_1074.jpg', 'img_1076.jpg', 'img_1077.jpg']\n" +">>> کلاس BatchRename (الگو):\n" +"... جداکننده = '%'\n" +"...\n" +">>> fmt = ورودی ('سبک تغییر نام را وارد کنید (%d-date %n-seqnum %f-format): ')\n" +"سبک تغییر نام را وارد کنید (%d-date %n-seqnum %f-format): Ashley_%n%f\n" +"\n" +">>> t = BatchRename(fmt)\n" +">>> date = time.strftime('%d%b%y')\n" +">>> برای i, نام فایل در enumerate(photofiles):\n" +"... base, ext = os.path.splitext(نام فایل)\n" +"... newname = t.substitute(d=date, n=i, f=ext)\n" +"... print('{0} --> {1}'.format(نام فایل, نام جدید))\n" +"\n" +"img_1074.jpg --> Ashley_0.jpg\n" +"img_1076.jpg --> Ashley_1.jpg\n" +"img_1077.jpg --> Ashley_2.jpg" #: tutorial/stdlib2.rst:126 -msgid "Another application for templating is separating program logic from the details of multiple output formats. This makes it possible to substitute custom templates for XML files, plain text reports, and HTML web reports." +#, fuzzy +msgid "" +"Another application for templating is separating program logic from the " +"details of multiple output formats. This makes it possible to substitute " +"custom templates for XML files, plain text reports, and HTML web reports." msgstr "" +"یکی دیگر از کاربردهای قالب بندی، جداسازی منطق برنامه از جزئیات فرمت های " +"خروجی متعدد است. این امکان جایگزینی قالب های سفارشی را برای فایل های XML، " +"گزارش های متنی ساده و گزارش های وب HTML فراهم می کند." #: tutorial/stdlib2.rst:134 +#, fuzzy msgid "Working with Binary Data Record Layouts" -msgstr "" +msgstr "کار با طرح بندی های ضبط داده های باینری" #: tutorial/stdlib2.rst:136 -msgid "The :mod:`struct` module provides :func:`~struct.pack` and :func:`~struct.unpack` functions for working with variable length binary record formats. The following example shows how to loop through header information in a ZIP file without using the :mod:`zipfile` module. Pack codes ``\"H\"`` and ``\"I\"`` represent two and four byte unsigned numbers respectively. The ``\"<\"`` indicates that they are standard size and in little-endian byte order::" -msgstr "" +#, fuzzy +msgid "" +"The :mod:`struct` module provides :func:`~struct.pack` and " +":func:`~struct.unpack` functions for working with variable length binary " +"record formats. The following example shows how to loop through header " +"information in a ZIP file without using the :mod:`zipfile` module. Pack " +"codes ``\"H\"`` and ``\"I\"`` represent two and four byte unsigned numbers " +"respectively. The ``\"<\"`` indicates that they are standard size and in " +"little-endian byte order::" +msgstr "" +"ماژول :mod:`struct` توابع :func:`~struct.pack` و :func:`~struct.unpack` را " +"برای کار با فرمت های رکورد باینری با طول متغیر فراهم می کند. مثال زیر نشان " +"می دهد که چگونه می توان اطلاعات هدر را در یک فایل ZIP بدون استفاده از ماژول " +":mod:`zipfile` حلقه کرد. کدهای بسته ``\"H\"`` و ``\"I\"`` به ترتیب اعداد " +"بدون علامت دو و چهار بایتی را نشان می دهند. ``\"<\"`` نشان می دهد که آنها " +"اندازه استاندارد و به ترتیب بایت اندک اند:" #: tutorial/stdlib2.rst:144 -msgid "import struct\n" +#, fuzzy +msgid "" +"import struct\n" "\n" "with open('myfile.zip', 'rb') as f:\n" " data = f.read()\n" @@ -180,21 +355,57 @@ msgid "import struct\n" "\n" " start += extra_size + comp_size # skip to the next header" msgstr "" +"import struct\n" +"\n" +"with open('myfile.zip', 'rb') as f:\n" +" data = f.read()\n" +"\n" +"start = 0\n" +"for i in range(3): # show the first 3 file headers\n" +" start += 14\n" +" fields = struct.unpack('>> import weakref, gc\n" +#, fuzzy +msgid "" +">>> import weakref, gc\n" ">>> class A:\n" "... def __init__(self, value):\n" "... self.value = value\n" @@ -295,42 +618,109 @@ msgid ">>> import weakref, gc\n" " o = self.data[key]()\n" "KeyError: 'primary'" msgstr "" +">>> واردات ضعیف, gc\n" +">>> کلاس A:\n" +"... def __init__(خود, ارزش):\n" +"... خود. ارزش = ارزش\n" +"... def __repr__(self):\n" +"... بازگشت str(self.value)\n" +"...\n" +">>> a = A(10) # یک مرجع ایجاد کنید\n" +">>> d = ضعیف.WeakValueDictionary()\n" +">>> d['primary'] = یک # مرجع ایجاد نمی کند\n" +">>> d['primary'] # اگر شی هنوز زنده است واکشی کنید\n" +"10\n" +">>> یک # مرجع را حذف کنید\n" +">>> gc.collect() # مجموعه زباله را فوراً اجرا کنید\n" +"0\n" +">>> d['primary'] # ورودی به طور خودکار حذف شد\n" +"ردیابی (آخرین تماس اخیر):\n" +" فایل \"\", خط 1، در \n" +" d['primary'] # ورودی به طور خودکار حذف شد\n" +" فایل \"C:/python313/lib/weakref.py\", خط 46، در __getitem__\n" +" o = self.data[key]()\n" +"خطای کلیدی: \"اصلی\"" #: tutorial/stdlib2.rst:290 +#, fuzzy msgid "Tools for Working with Lists" -msgstr "" +msgstr "ابزارهای کار با لیست ها" #: tutorial/stdlib2.rst:292 -msgid "Many data structure needs can be met with the built-in list type. However, sometimes there is a need for alternative implementations with different performance trade-offs." +#, fuzzy +msgid "" +"Many data structure needs can be met with the built-in list type. However, " +"sometimes there is a need for alternative implementations with different " +"performance trade-offs." msgstr "" +"بسیاری از نیازهای ساختار داده را می توان با نوع لیست داخلی برآورده کرد. با " +"این حال، گاهی اوقات نیاز به پیاده سازی های جایگزین با مبادلات عملکرد متفاوت " +"وجود دارد." #: tutorial/stdlib2.rst:296 -msgid "The :mod:`array` module provides an :class:`~array.array` object that is like a list that stores only homogeneous data and stores it more compactly. The following example shows an array of numbers stored as two byte unsigned binary numbers (typecode ``\"H\"``) rather than the usual 16 bytes per entry for regular lists of Python int objects::" -msgstr "" +#, fuzzy +msgid "" +"The :mod:`array` module provides an :class:`~array.array` object that is " +"like a list that stores only homogeneous data and stores it more compactly." +" The following example shows an array of numbers stored as two byte " +"unsigned binary numbers (typecode ``\"H\"``) rather than the usual 16 bytes " +"per entry for regular lists of Python int objects::" +msgstr "" +"ماژول :mod:`array` یک شی :class:`~array.array` را ارائه می دهد که مانند " +"لیستی است که فقط داده های همگن را ذخیره می کند و آن را فشرده تر ذخیره می " +"کند. مثال زیر آرایه‌ای از اعداد را نشان می‌دهد که به‌عنوان اعداد باینری " +"بدون علامت دو بایتی (نوع کد ``\"H\"``) به جای 16 بایت معمول در هر ورودی برای" +" لیست‌های معمولی اشیاء int پایتون ذخیره می‌شوند:" #: tutorial/stdlib2.rst:302 -msgid ">>> from array import array\n" +#, fuzzy +msgid "" +">>> from array import array\n" ">>> a = array('H', [4000, 10, 700, 22222])\n" ">>> sum(a)\n" "26932\n" ">>> a[1:3]\n" "array('H', [10, 700])" msgstr "" +">>> from array import array\n" +">>> a = array('H', [4000, 10, 700, 22222])\n" +">>> sum(a)\n" +"26932\n" +">>> a[1:3]\n" +"array('H', [10, 700])" #: tutorial/stdlib2.rst:309 -msgid "The :mod:`collections` module provides a :class:`~collections.deque` object that is like a list with faster appends and pops from the left side but slower lookups in the middle. These objects are well suited for implementing queues and breadth first tree searches::" +#, fuzzy +msgid "" +"The :mod:`collections` module provides a :class:`~collections.deque` object " +"that is like a list with faster appends and pops from the left side but " +"slower lookups in the middle. These objects are well suited for implementing" +" queues and breadth first tree searches::" msgstr "" +"ماژول :mod:`collections` یک شی :class:`~collections.deque` را ارائه می دهد " +"که مانند لیستی است با ضمائم سریعتر و از سمت چپ ظاهر می شود اما جستجوهای " +"کندتر در وسط است. این اشیا برای اجرای صف ها و جستجوهای درختی وسعت مناسب " +"هستند::" #: tutorial/stdlib2.rst:314 -msgid ">>> from collections import deque\n" +#, fuzzy +msgid "" +">>> from collections import deque\n" ">>> d = deque([\"task1\", \"task2\", \"task3\"])\n" ">>> d.append(\"task4\")\n" ">>> print(\"Handling\", d.popleft())\n" "Handling task1" msgstr "" +">>> از مجموعه ها واردات deque\n" +">>> d = deque([\"task1\", \"task2\", \"task3\"])\n" +">>> d.append(\"task4\")\n" +">>> print(\"Handling\", d.popleft())\n" +"رسیدگی به کار 1" #: tutorial/stdlib2.rst:322 -msgid "unsearched = deque([starting_node])\n" +#, fuzzy +msgid "" +"unsearched = deque([starting_node])\n" "def breadth_first_search(unsearched):\n" " node = unsearched.popleft()\n" " for m in gen_moves(node):\n" @@ -338,82 +728,171 @@ msgid "unsearched = deque([starting_node])\n" " return m\n" " unsearched.append(m)" msgstr "" +"unsearched = deque([starting_node])\n" +"def breadth_first_search(unsearched):\n" +" node = unsearched.popleft()\n" +" for m in gen_moves(node):\n" +" if is_goal(m):\n" +" return m\n" +" unsearched.append(m)" #: tutorial/stdlib2.rst:330 -msgid "In addition to alternative list implementations, the library also offers other tools such as the :mod:`bisect` module with functions for manipulating sorted lists::" +#, fuzzy +msgid "" +"In addition to alternative list implementations, the library also offers " +"other tools such as the :mod:`bisect` module with functions for manipulating" +" sorted lists::" msgstr "" +"علاوه بر پیاده سازی لیست جایگزین، کتابخانه ابزارهای دیگری مانند ماژول " +":mod:`bisect` را با توابعی برای دستکاری لیست های مرتب شده نیز ارائه می دهد:" #: tutorial/stdlib2.rst:334 -msgid ">>> import bisect\n" +#, fuzzy +msgid "" +">>> import bisect\n" ">>> scores = [(100, 'perl'), (200, 'tcl'), (400, 'lua'), (500, 'python')]\n" ">>> bisect.insort(scores, (300, 'ruby'))\n" ">>> scores\n" "[(100, 'perl'), (200, 'tcl'), (300, 'ruby'), (400, 'lua'), (500, 'python')]" msgstr "" +">>> import bisect\n" +">>> scores = [(100, 'perl'), (200, 'tcl'), (400, 'lua'), (500, 'python')]\n" +">>> bisect.insort(scores, (300, 'ruby'))\n" +">>> scores\n" +"[(100, 'perl'), (200, 'tcl'), (300, 'ruby'), (400, 'lua'), (500, 'python')]" #: tutorial/stdlib2.rst:340 -msgid "The :mod:`heapq` module provides functions for implementing heaps based on regular lists. The lowest valued entry is always kept at position zero. This is useful for applications which repeatedly access the smallest element but do not want to run a full list sort::" +#, fuzzy +msgid "" +"The :mod:`heapq` module provides functions for implementing heaps based on " +"regular lists. The lowest valued entry is always kept at position zero. " +"This is useful for applications which repeatedly access the smallest element" +" but do not want to run a full list sort::" msgstr "" +"ماژول :mod:`heapq` عملکردهایی را برای پیاده سازی پشته ها بر اساس لیست های " +"معمولی ارائه می دهد. کمترین مقدار ورودی همیشه در موقعیت صفر نگه داشته می " +"شود. این برای برنامه هایی مفید است که به طور مکرر به کوچکترین عنصر دسترسی " +"دارند اما نمی خواهند مرتب سازی لیست کامل را اجرا کنند::" #: tutorial/stdlib2.rst:345 -msgid ">>> from heapq import heapify, heappop, heappush\n" +#, fuzzy +msgid "" +">>> from heapq import heapify, heappop, heappush\n" ">>> data = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0]\n" ">>> heapify(data) # rearrange the list into heap order\n" ">>> heappush(data, -5) # add a new entry\n" ">>> [heappop(data) for i in range(3)] # fetch the three smallest entries\n" "[-5, 0, 1]" msgstr "" +">>> from heapq import heapify, heappop, heappush\n" +">>> data = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0]\n" +">>> heapify(data) # rearrange the list into heap order\n" +">>> heappush(data, -5) # add a new entry\n" +">>> [heappop(data) for i in range(3)] # fetch the three smallest entries\n" +"[-5, 0, 1]" #: tutorial/stdlib2.rst:356 +#, fuzzy msgid "Decimal Floating-Point Arithmetic" -msgstr "" +msgstr "محاسبه اعشاری ممیز شناور" #: tutorial/stdlib2.rst:358 -msgid "The :mod:`decimal` module offers a :class:`~decimal.Decimal` datatype for decimal floating-point arithmetic. Compared to the built-in :class:`float` implementation of binary floating point, the class is especially helpful for" +#, fuzzy +msgid "" +"The :mod:`decimal` module offers a :class:`~decimal.Decimal` datatype for " +"decimal floating-point arithmetic. Compared to the built-in :class:`float` " +"implementation of binary floating point, the class is especially helpful for" msgstr "" +"ماژول :mod:`decimal` نوع داده :class:`~decimal.Decimal` را برای محاسبات " +"اعشاری ممیز شناور ارائه می دهد. در مقایسه با اجرای داخلی :class:`float` " +"نقطه شناور باینری، این کلاس به ویژه برای" #: tutorial/stdlib2.rst:362 -msgid "financial applications and other uses which require exact decimal representation," -msgstr "" +#, fuzzy +msgid "" +"financial applications and other uses which require exact decimal " +"representation," +msgstr "کاربردهای مالی و سایر کاربردهایی که نیاز به نمایش اعشاری دقیق دارند،" #: tutorial/stdlib2.rst:364 +#, fuzzy msgid "control over precision," -msgstr "" +msgstr "کنترل بر دقت،" #: tutorial/stdlib2.rst:365 +#, fuzzy msgid "control over rounding to meet legal or regulatory requirements," -msgstr "" +msgstr "کنترل بر گرد کردن برای برآوردن الزامات قانونی یا نظارتی،" #: tutorial/stdlib2.rst:366 +#, fuzzy msgid "tracking of significant decimal places, or" -msgstr "" +msgstr "ردیابی ارقام اعشاری قابل توجه یا" #: tutorial/stdlib2.rst:367 -msgid "applications where the user expects the results to match calculations done by hand." +#, fuzzy +msgid "" +"applications where the user expects the results to match calculations done " +"by hand." msgstr "" +"برنامه هایی که کاربر انتظار دارد نتایج با محاسبات انجام شده با دست مطابقت " +"داشته باشد." #: tutorial/stdlib2.rst:370 -msgid "For example, calculating a 5% tax on a 70 cent phone charge gives different results in decimal floating point and binary floating point. The difference becomes significant if the results are rounded to the nearest cent::" +#, fuzzy +msgid "" +"For example, calculating a 5% tax on a 70 cent phone charge gives different " +"results in decimal floating point and binary floating point. The difference " +"becomes significant if the results are rounded to the nearest cent::" msgstr "" +"برای مثال، محاسبه مالیات 5 درصدی بر روی شارژ تلفن 70 سنت، نتایج متفاوتی در " +"ممیز شناور اعشاری و ممیز شناور باینری به دست می‌دهد. اگر نتایج به نزدیکترین " +"سنت گرد شوند، تفاوت قابل توجه می شود:" #: tutorial/stdlib2.rst:374 -msgid ">>> from decimal import *\n" +#, fuzzy +msgid "" +">>> from decimal import *\n" ">>> round(Decimal('0.70') * Decimal('1.05'), 2)\n" "Decimal('0.74')\n" ">>> round(.70 * 1.05, 2)\n" "0.73" msgstr "" +">>> from decimal import *\n" +">>> round(Decimal('0.70') * Decimal('1.05'), 2)\n" +"Decimal('0.74')\n" +">>> round(.70 * 1.05, 2)\n" +"0.73" #: tutorial/stdlib2.rst:380 -msgid "The :class:`~decimal.Decimal` result keeps a trailing zero, automatically inferring four place significance from multiplicands with two place significance. Decimal reproduces mathematics as done by hand and avoids issues that can arise when binary floating point cannot exactly represent decimal quantities." -msgstr "" +#, fuzzy +msgid "" +"The :class:`~decimal.Decimal` result keeps a trailing zero, automatically " +"inferring four place significance from multiplicands with two place " +"significance. Decimal reproduces mathematics as done by hand and avoids " +"issues that can arise when binary floating point cannot exactly represent " +"decimal quantities." +msgstr "" +"نتیجه :class:`~decimal.Decimal` یک صفر انتهایی را نگه می‌دارد و به طور " +"خودکار اهمیت چهار مکان را از ضرب‌کننده‌ها با اهمیت دو مکان استنتاج می‌کند. " +"اعشاری ریاضیات را همانطور که با دست انجام می شود بازتولید می کند و از مسائلی" +" که ممکن است زمانی که ممیز شناور باینری نمی تواند دقیقاً کمیت های اعشاری را " +"نشان دهد به وجود بیاید جلوگیری می کند." #: tutorial/stdlib2.rst:386 -msgid "Exact representation enables the :class:`~decimal.Decimal` class to perform modulo calculations and equality tests that are unsuitable for binary floating point::" +#, fuzzy +msgid "" +"Exact representation enables the :class:`~decimal.Decimal` class to perform " +"modulo calculations and equality tests that are unsuitable for binary " +"floating point::" msgstr "" +"نمایش دقیق کلاس :class:`~decimal.Decimal` را قادر می سازد تا محاسبات مدول و " +"تست های برابری را انجام دهد که برای ممیز شناور باینری نامناسب هستند:" #: tutorial/stdlib2.rst:390 -msgid ">>> Decimal('1.00') % Decimal('.10')\n" +#, fuzzy +msgid "" +">>> Decimal('1.00') % Decimal('.10')\n" "Decimal('0.00')\n" ">>> 1.00 % 0.10\n" "0.09999999999999995\n" @@ -423,13 +902,30 @@ msgid ">>> Decimal('1.00') % Decimal('.10')\n" ">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" "False" msgstr "" +">>> Decimal('1.00') % Decimal('.10')\n" +"Decimal('0.00')\n" +">>> 1.00 % 0.10\n" +"0.09999999999999995\n" +"\n" +">>> sum([Decimal('0.1')]*10) == Decimal('1.0')\n" +"True\n" +">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" +"False" #: tutorial/stdlib2.rst:400 -msgid "The :mod:`decimal` module provides arithmetic with as much precision as needed::" -msgstr "" +#, fuzzy +msgid "" +"The :mod:`decimal` module provides arithmetic with as much precision as " +"needed::" +msgstr "ماژول :mod:`decimal` محاسبات را با دقت مورد نیاز ارائه می دهد:" #: tutorial/stdlib2.rst:402 -msgid ">>> getcontext().prec = 36\n" +#, fuzzy +msgid "" +">>> getcontext().prec = 36\n" ">>> Decimal(1) / Decimal(7)\n" "Decimal('0.142857142857142857142857142857142857')" msgstr "" +">>> getcontext().prec = 36\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857142857142857142857142857142857')" diff --git a/tutorial/venv.po b/tutorial/venv.po index 64d600ce..b49e9a63 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -17,83 +17,181 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/venv.rst:6 +#, fuzzy msgid "Virtual Environments and Packages" -msgstr "" +msgstr "بسته ها و محیط های مجازی" #: tutorial/venv.rst:9 +#, fuzzy msgid "Introduction" -msgstr "" +msgstr "مقدمه" #: tutorial/venv.rst:11 -msgid "Python applications will often use packages and modules that don't come as part of the standard library. Applications will sometimes need a specific version of a library, because the application may require that a particular bug has been fixed or the application may be written using an obsolete version of the library's interface." +#, fuzzy +msgid "" +"Python applications will often use packages and modules that don't come as " +"part of the standard library. Applications will sometimes need a specific " +"version of a library, because the application may require that a particular " +"bug has been fixed or the application may be written using an obsolete " +"version of the library's interface." msgstr "" +"برنامه های کاربردی پایتون اغلب از بسته ها و ماژول هایی استفاده می کنند که به" +" عنوان بخشی از کتابخانه استاندارد نیستند. برنامه‌ها گاهی به نسخه خاصی از " +"کتابخانه نیاز دارند، زیرا ممکن است برنامه نیاز به رفع اشکال خاصی داشته باشد " +"یا ممکن است برنامه با استفاده از نسخه منسوخ شده رابط کتابخانه نوشته شود." #: tutorial/venv.rst:17 -msgid "This means it may not be possible for one Python installation to meet the requirements of every application. If application A needs version 1.0 of a particular module but application B needs version 2.0, then the requirements are in conflict and installing either version 1.0 or 2.0 will leave one application unable to run." +#, fuzzy +msgid "" +"This means it may not be possible for one Python installation to meet the " +"requirements of every application. If application A needs version 1.0 of a " +"particular module but application B needs version 2.0, then the requirements" +" are in conflict and installing either version 1.0 or 2.0 will leave one " +"application unable to run." msgstr "" +"این بدان معناست که ممکن است یک نصب پایتون نتواند الزامات هر برنامه را " +"برآورده کند. اگر برنامه A به نسخه 1.0 یک ماژول خاص نیاز دارد اما برنامه B " +"به نسخه 2.0 نیاز دارد، الزامات در تضاد هستند و نصب نسخه 1.0 یا 2.0 باعث می " +"شود که یک برنامه قادر به اجرا نباشد." #: tutorial/venv.rst:23 -msgid "The solution for this problem is to create a :term:`virtual environment`, a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages." +#, fuzzy +msgid "" +"The solution for this problem is to create a :term:`virtual environment`, a " +"self-contained directory tree that contains a Python installation for a " +"particular version of Python, plus a number of additional packages." msgstr "" +"راه حل این مشکل ایجاد یک :term:`virtual environment` است، یک درخت دایرکتوری " +"مستقل که شامل نصب پایتون برای یک نسخه خاص از پایتون، به علاوه تعدادی بسته " +"اضافی است." #: tutorial/venv.rst:27 -msgid "Different applications can then use different virtual environments. To resolve the earlier example of conflicting requirements, application A can have its own virtual environment with version 1.0 installed while application B has another virtual environment with version 2.0. If application B requires a library be upgraded to version 3.0, this will not affect application A's environment." -msgstr "" +#, fuzzy +msgid "" +"Different applications can then use different virtual environments. To " +"resolve the earlier example of conflicting requirements, application A can " +"have its own virtual environment with version 1.0 installed while " +"application B has another virtual environment with version 2.0. If " +"application B requires a library be upgraded to version 3.0, this will not " +"affect application A's environment." +msgstr "" +"سپس برنامه های مختلف می توانند از محیط های مجازی مختلف استفاده کنند. برای حل" +" مثال قبلی از الزامات متناقض، برنامه A می تواند محیط مجازی خود را با نسخه " +"1.0 نصب شده داشته باشد در حالی که برنامه B دارای محیط مجازی دیگری با نسخه " +"2.0 است. اگر برنامه B نیاز به ارتقاء کتابخانه به نسخه 3.0 داشته باشد، این " +"روی محیط برنامه A تأثیری نخواهد داشت." #: tutorial/venv.rst:36 +#, fuzzy msgid "Creating Virtual Environments" -msgstr "" +msgstr "ایجاد محیط های مجازی" #: tutorial/venv.rst:38 -msgid "The module used to create and manage virtual environments is called :mod:`venv`. :mod:`venv` will install the Python version from which the command was run (as reported by the :option:`--version` option). For instance, executing the command with ``python3.12`` will install version 3.12." +#, fuzzy +msgid "" +"The module used to create and manage virtual environments is called " +":mod:`venv`. :mod:`venv` will install the Python version from which the " +"command was run (as reported by the :option:`--version` option). For " +"instance, executing the command with ``python3.12`` will install version " +"3.12." msgstr "" +"ماژول مورد استفاده برای ایجاد و مدیریت محیط های مجازی :mod:`venv` نام دارد." +" :mod:`venv` نسخه پایتونی را که فرمان از آن اجرا شده را نصب خواهد کرد " +"(همانطور که توسط گزینه :option:`--version` گزارش شده است). به عنوان مثال، " +"اجرای دستور با ``python3.12`` نسخه 3.12 را نصب می کند." #: tutorial/venv.rst:44 -msgid "To create a virtual environment, decide upon a directory where you want to place it, and run the :mod:`venv` module as a script with the directory path::" +#, fuzzy +msgid "" +"To create a virtual environment, decide upon a directory where you want to " +"place it, and run the :mod:`venv` module as a script with the directory " +"path::" msgstr "" +"برای ایجاد یک محیط مجازی، دایرکتوری را که می‌خواهید در آن قرار دهید، انتخاب " +"کنید و ماژول :mod:`venv` را به عنوان یک اسکریپت با مسیر دایرکتوری اجرا کنید:" #: tutorial/venv.rst:47 +#, fuzzy msgid "python -m venv tutorial-env" -msgstr "" +msgstr "آموزش python -m venv-env" #: tutorial/venv.rst:49 -msgid "This will create the ``tutorial-env`` directory if it doesn't exist, and also create directories inside it containing a copy of the Python interpreter and various supporting files." +#, fuzzy +msgid "" +"This will create the ``tutorial-env`` directory if it doesn't exist, and " +"also create directories inside it containing a copy of the Python " +"interpreter and various supporting files." msgstr "" +"اگر دایرکتوری ``tutorial-env`` وجود نداشته باشد، این کار ایجاد می‌کند و " +"همچنین دایرکتوری‌هایی در داخل آن ایجاد می‌کند که حاوی یک کپی از مفسر پایتون " +"و فایل‌های مختلف پشتیبانی است." #: tutorial/venv.rst:53 -msgid "A common directory location for a virtual environment is ``.venv``. This name keeps the directory typically hidden in your shell and thus out of the way while giving it a name that explains why the directory exists. It also prevents clashing with ``.env`` environment variable definition files that some tooling supports." +#, fuzzy +msgid "" +"A common directory location for a virtual environment is ``.venv``. This " +"name keeps the directory typically hidden in your shell and thus out of the " +"way while giving it a name that explains why the directory exists. It also " +"prevents clashing with ``.env`` environment variable definition files that " +"some tooling supports." msgstr "" +"یک مکان دایرکتوری رایج برای یک محیط مجازی ``.venv`` است. این نام، دایرکتوری " +"را معمولاً در پوسته شما پنهان نگه می‌دارد و در نتیجه نامی به آن می‌دهد که " +"دلیل وجود دایرکتوری را توضیح می‌دهد. همچنین از برخورد با فایل‌های تعریف " +"متغیر محیطی ``.env`` که برخی ابزارها پشتیبانی می‌کنند جلوگیری می‌کند." #: tutorial/venv.rst:59 +#, fuzzy msgid "Once you've created a virtual environment, you may activate it." -msgstr "" +msgstr "هنگامی که یک محیط مجازی ایجاد کردید، می توانید آن را فعال کنید." #: tutorial/venv.rst:61 +#, fuzzy msgid "On Windows, run::" -msgstr "" +msgstr "در ویندوز اجرا کنید::" #: tutorial/venv.rst:63 +#, fuzzy msgid "tutorial-env\\Scripts\\activate" -msgstr "" +msgstr "tutorial-env\\Scripts\\activate" #: tutorial/venv.rst:65 +#, fuzzy msgid "On Unix or MacOS, run::" -msgstr "" +msgstr "در یونیکس یا MacOS، اجرا کنید::" #: tutorial/venv.rst:67 +#, fuzzy msgid "source tutorial-env/bin/activate" -msgstr "" +msgstr "منبع tutorial-env/bin/activate" #: tutorial/venv.rst:69 -msgid "(This script is written for the bash shell. If you use the :program:`csh` or :program:`fish` shells, there are alternate ``activate.csh`` and ``activate.fish`` scripts you should use instead.)" +#, fuzzy +msgid "" +"(This script is written for the bash shell. If you use the :program:`csh` " +"or :program:`fish` shells, there are alternate ``activate.csh`` and " +"``activate.fish`` scripts you should use instead.)" msgstr "" +"(این اسکریپت برای پوسته bash نوشته شده است. اگر از پوسته های :program:`csh` " +"یا :program:`fish` استفاده می کنید, اسکریپت های جایگزین ``activate.csh`` و " +"``activate.fish`` وجود دارد که باید به جای آن استفاده کنید.)" #: tutorial/venv.rst:74 -msgid "Activating the virtual environment will change your shell's prompt to show what virtual environment you're using, and modify the environment so that running ``python`` will get you that particular version and installation of Python. For example:" +#, fuzzy +msgid "" +"Activating the virtual environment will change your shell's prompt to show " +"what virtual environment you're using, and modify the environment so that " +"running ``python`` will get you that particular version and installation of " +"Python. For example:" msgstr "" +"فعال کردن محیط مجازی، درخواست پوسته شما را تغییر می‌دهد تا نشان دهد از چه " +"محیط مجازی استفاده می‌کنید و محیط را طوری تغییر می‌دهد که اجرای ``python`` " +"آن نسخه خاص و نصب پایتون را برای شما به ارمغان بیاورد. به عنوان مثال:" #: tutorial/venv.rst:79 -msgid "$ source ~/envs/tutorial-env/bin/activate\n" +#, fuzzy +msgid "" +"$ source ~/envs/tutorial-env/bin/activate\n" "(tutorial-env) $ python\n" "Python 3.5.1 (default, May 6 2016, 10:59:36)\n" " ...\n" @@ -103,62 +201,125 @@ msgid "$ source ~/envs/tutorial-env/bin/activate\n" "'~/envs/tutorial-env/lib/python3.5/site-packages']\n" ">>>" msgstr "" +"منبع $ ~/envs/tutorial-env/bin/activate\n" +"(آموزش-env) $ python\n" +"Python 3.5.1 (پیش‌فرض, 6 مه 2016, 10:59:36)\n" +" ...\n" +">>> سیستم را وارد کنید\n" +">>> sys.path\n" +"['', '/usr/local/lib/python35.zip', ...,\n" +"'~/envs/tutorial-env/lib/python3.5/site-packages']\n" +">>>" #: tutorial/venv.rst:91 +#, fuzzy msgid "To deactivate a virtual environment, type::" -msgstr "" +msgstr "برای غیرفعال کردن یک محیط مجازی، تایپ کنید:" #: tutorial/venv.rst:93 +#, fuzzy msgid "deactivate" -msgstr "" +msgstr "غیر فعال کردن" #: tutorial/venv.rst:95 +#, fuzzy msgid "into the terminal." -msgstr "" +msgstr "به ترمینال" #: tutorial/venv.rst:98 +#, fuzzy msgid "Managing Packages with pip" -msgstr "" +msgstr "مدیریت بسته ها با پیپ" #: tutorial/venv.rst:100 -msgid "You can install, upgrade, and remove packages using a program called :program:`pip`. By default ``pip`` will install packages from the `Python Package Index `_. You can browse the Python Package Index by going to it in your web browser." +#, fuzzy +msgid "" +"You can install, upgrade, and remove packages using a program called " +":program:`pip`. By default ``pip`` will install packages from the `Python " +"Package Index `_. You can browse the Python Package Index" +" by going to it in your web browser." msgstr "" +"با استفاده از برنامه ای به نام :program:`pip` می توانید بسته ها را نصب، " +"ارتقا و حذف کنید. به طور پیش فرض ``pip`` بسته هایی را از `Python Package " +"Index `_ نصب می کند. می توانید با رفتن به آن در مرورگر وب" +" خود، فهرست بسته Python را مرور کنید." #: tutorial/venv.rst:105 -msgid "``pip`` has a number of subcommands: \"install\", \"uninstall\", \"freeze\", etc. (Consult the :ref:`installing-index` guide for complete documentation for ``pip``.)" +#, fuzzy +msgid "" +"``pip`` has a number of subcommands: \"install\", \"uninstall\", \"freeze\"," +" etc. (Consult the :ref:`installing-index` guide for complete documentation" +" for ``pip``.)" msgstr "" +"``pip`` تعدادی دستور فرعی دارد: \"install\"، \"uninstall\"، \"freeze\", و " +"غیره (برای مستندات کامل ``pip`` به راهنمای :ref:`installing-index` مراجعه " +"کنید.)" #: tutorial/venv.rst:109 -msgid "You can install the latest version of a package by specifying a package's name:" -msgstr "" +#, fuzzy +msgid "" +"You can install the latest version of a package by specifying a package's " +"name:" +msgstr "می توانید آخرین نسخه یک بسته را با تعیین نام بسته نصب کنید:" #: tutorial/venv.rst:111 -msgid "(tutorial-env) $ python -m pip install novas\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip install novas\n" "Collecting novas\n" " Downloading novas-3.1.1.3.tar.gz (136kB)\n" "Installing collected packages: novas\n" " Running setup.py install for novas\n" "Successfully installed novas-3.1.1.3" msgstr "" +"(آموزش-env) $ python -m pip install novas\n" +"جمع آوری نواها\n" +" دانلود novas-3.1.1.3.tar.gz (136 کیلوبایت)\n" +"نصب پکیج های جمع آوری شده: novas\n" +" نصب setup.py برای nova در حال اجرا است\n" +"novas-3.1.1.3 با موفقیت نصب شد" #: tutorial/venv.rst:120 -msgid "You can also install a specific version of a package by giving the package name followed by ``==`` and the version number:" +#, fuzzy +msgid "" +"You can also install a specific version of a package by giving the package " +"name followed by ``==`` and the version number:" msgstr "" +"همچنین می توانید با دادن نام بسته و سپس ``==`` و شماره نسخه، نسخه خاصی از یک" +" بسته را نصب کنید:" #: tutorial/venv.rst:123 -msgid "(tutorial-env) $ python -m pip install requests==2.6.0\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip install requests==2.6.0\n" "Collecting requests==2.6.0\n" " Using cached requests-2.6.0-py2.py3-none-any.whl\n" "Installing collected packages: requests\n" "Successfully installed requests-2.6.0" msgstr "" +"(tutorial-env) $ python -m pip install requests==2.6.0\n" +"جمع آوری درخواست ها==2.6.0\n" +" استفاده از درخواست‌های کش شده-2.6.0-py2.py3-none-any.whl\n" +"نصب بسته های جمع آوری شده: درخواست ها\n" +"درخواست ها با موفقیت نصب شد-2.6.0" #: tutorial/venv.rst:131 -msgid "If you re-run this command, ``pip`` will notice that the requested version is already installed and do nothing. You can supply a different version number to get that version, or you can run ``python -m pip install --upgrade`` to upgrade the package to the latest version:" +#, fuzzy +msgid "" +"If you re-run this command, ``pip`` will notice that the requested version " +"is already installed and do nothing. You can supply a different version " +"number to get that version, or you can run ``python -m pip install " +"--upgrade`` to upgrade the package to the latest version:" msgstr "" +"اگر این دستور را دوباره اجرا کنید، ``pip`` متوجه می شود که نسخه درخواستی " +"قبلاً نصب شده است و هیچ کاری انجام نمی دهد. برای دریافت آن نسخه می‌توانید " +"شماره نسخه دیگری ارائه دهید، یا می‌توانید ``python -m pip install " +"--upgrade`` را برای ارتقای بسته به آخرین نسخه اجرا کنید:" #: tutorial/venv.rst:136 -msgid "(tutorial-env) $ python -m pip install --upgrade requests\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip install --upgrade requests\n" "Collecting requests\n" "Installing collected packages: requests\n" " Found existing installation: requests 2.6.0\n" @@ -166,17 +327,33 @@ msgid "(tutorial-env) $ python -m pip install --upgrade requests\n" " Successfully uninstalled requests-2.6.0\n" "Successfully installed requests-2.7.0" msgstr "" +"(tutorial-env) $ python -m pip install --upgrade requests\n" +"جمع آوری درخواست ها\n" +"نصب بسته های جمع آوری شده: درخواست ها\n" +" نصب موجود پیدا شد: درخواست های 2.6.0\n" +" Uninstalling requests-2.6.0:\n" +" درخواست ها با موفقیت حذف شدند-2.6.0\n" +"درخواست ها با موفقیت نصب شد-2.7.0" #: tutorial/venv.rst:146 -msgid "``python -m pip uninstall`` followed by one or more package names will remove the packages from the virtual environment." +#, fuzzy +msgid "" +"``python -m pip uninstall`` followed by one or more package names will " +"remove the packages from the virtual environment." msgstr "" +"``python -m pip uninstall`` به دنبال یک یا چند نام بسته، بسته ها را از محیط " +"مجازی حذف می کند." #: tutorial/venv.rst:149 -msgid "``python -m pip show`` will display information about a particular package:" -msgstr "" +#, fuzzy +msgid "" +"``python -m pip show`` will display information about a particular package:" +msgstr "``python -m pip show`` اطلاعات مربوط به یک بسته خاص را نمایش می دهد:" #: tutorial/venv.rst:151 -msgid "(tutorial-env) $ python -m pip show requests\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip show requests\n" "---\n" "Metadata-Version: 2.0\n" "Name: requests\n" @@ -189,38 +366,87 @@ msgid "(tutorial-env) $ python -m pip show requests\n" "Location: /Users/akuchling/envs/tutorial-env/lib/python3.4/site-packages\n" "Requires:" msgstr "" +"(tutorial-env) درخواست های $ python -m pip show\n" +"---\n" +"متادیتا-نسخه: 2.0\n" +"نام: درخواست ها\n" +"نسخه: 2.7.0\n" +"خلاصه: Python HTTP برای انسان ها.\n" +"صفحه اصلی: http://python-requests.org\n" +"نویسنده: کنت رایتز\n" +"ایمیل نویسنده: me@kennethreitz.com\n" +"مجوز: آپاچی 2.0\n" +"مکان: /Users/akuchling/envs/tutorial-env/lib/python3.4/site-packages\n" +"نیاز دارد:" #: tutorial/venv.rst:166 -msgid "``python -m pip list`` will display all of the packages installed in the virtual environment:" +#, fuzzy +msgid "" +"``python -m pip list`` will display all of the packages installed in the " +"virtual environment:" msgstr "" +"``python -m pip list`` تمام بسته های نصب شده در محیط مجازی را نمایش می دهد:" #: tutorial/venv.rst:169 -msgid "(tutorial-env) $ python -m pip list\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip list\n" "novas (3.1.1.3)\n" "numpy (1.9.2)\n" "pip (7.0.3)\n" "requests (2.7.0)\n" "setuptools (16.0)" msgstr "" +"(tutorial-env) $ python -m pip list\n" +"نواس (3.1.1.3)\n" +"numpy (1.9.2)\n" +"پیپ (7.0.3)\n" +"درخواست ها (2.7.0)\n" +"setuptools (16.0)" #: tutorial/venv.rst:178 -msgid "``python -m pip freeze`` will produce a similar list of the installed packages, but the output uses the format that ``python -m pip install`` expects. A common convention is to put this list in a ``requirements.txt`` file:" +#, fuzzy +msgid "" +"``python -m pip freeze`` will produce a similar list of the installed " +"packages, but the output uses the format that ``python -m pip install`` " +"expects. A common convention is to put this list in a ``requirements.txt`` " +"file:" msgstr "" +"``python -m pip freeze`` لیست مشابهی از بسته های نصب شده را تولید می کند، " +"اما خروجی از فرمتی استفاده می کند که ``python -m pip install`` انتظار دارد. " +"یک قرارداد رایج این است که این لیست را در یک فایل ``requirements.txt`` قرار " +"دهید:" #: tutorial/venv.rst:182 -msgid "(tutorial-env) $ python -m pip freeze > requirements.txt\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip freeze > requirements.txt\n" "(tutorial-env) $ cat requirements.txt\n" "novas==3.1.1.3\n" "numpy==1.9.2\n" "requests==2.7.0" msgstr "" +"(tutorial-env) $ python -m pip freeze > requires.txt\n" +"(آموزش-env) $ cat requires.txt\n" +"novas==3.1.1.3\n" +"numpy==1.9.2\n" +"درخواست ها==2.7.0" #: tutorial/venv.rst:190 -msgid "The ``requirements.txt`` can then be committed to version control and shipped as part of an application. Users can then install all the necessary packages with ``install -r``:" +#, fuzzy +msgid "" +"The ``requirements.txt`` can then be committed to version control and " +"shipped as part of an application. Users can then install all the necessary" +" packages with ``install -r``:" msgstr "" +"سپس ``requirements.txt`` می تواند به کنترل نسخه متعهد شود و به عنوان بخشی از" +" یک برنامه ارسال شود. سپس کاربران می توانند تمام بسته های لازم را با " +"``install -r`` نصب کنند:" #: tutorial/venv.rst:194 -msgid "(tutorial-env) $ python -m pip install -r requirements.txt\n" +#, fuzzy +msgid "" +"(tutorial-env) $ python -m pip install -r requirements.txt\n" "Collecting novas==3.1.1.3 (from -r requirements.txt (line 1))\n" " ...\n" "Collecting numpy==1.9.2 (from -r requirements.txt (line 2))\n" @@ -231,7 +457,26 @@ msgid "(tutorial-env) $ python -m pip install -r requirements.txt\n" " Running setup.py install for novas\n" "Successfully installed novas-3.1.1.3 numpy-1.9.2 requests-2.7.0" msgstr "" +"(tutorial-env) $ python -m pip install -r requires.txt\n" +"جمع آوری novas==3.1.1.3 (از -r requirements.txt (خط 1))\n" +" ...\n" +"جمع آوری numpy==1.9.2 (از -r requirement.txt (خط 2))\n" +" ...\n" +"جمع آوری درخواست ها==2.7.0 (از -r requirements.txt (خط 3))\n" +" ...\n" +"نصب بسته های جمع آوری شده: nova، numpy، درخواست ها\n" +" نصب setup.py برای nova در حال اجرا است\n" +"novas-3.1.1.3 numpy-1.9.2 requests-2.7.0 با موفقیت نصب شد" #: tutorial/venv.rst:207 -msgid "``pip`` has many more options. Consult the :ref:`installing-index` guide for complete documentation for ``pip``. When you've written a package and want to make it available on the Python Package Index, consult the `Python packaging user guide`_." -msgstr "" +#, fuzzy +msgid "" +"``pip`` has many more options. Consult the :ref:`installing-index` guide " +"for complete documentation for ``pip``. When you've written a package and " +"want to make it available on the Python Package Index, consult the `Python " +"packaging user guide`_." +msgstr "" +"``pip`` گزینه های بسیار بیشتری دارد. برای مستندات کامل ``pip`` با راهنمای " +":ref:`installing-index` مشورت کنید. هنگامی که بسته ای را نوشتید و می خواهید" +" آن را در فهرست بسته Python در دسترس قرار دهید، با `Python packaging user " +"guide`_ مشورت کنید." diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 15bfc72d..e9930f58 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -17,73 +17,181 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: tutorial/whatnow.rst:5 +#, fuzzy msgid "What Now?" -msgstr "" +msgstr "حالا چی؟" #: tutorial/whatnow.rst:7 -msgid "Reading this tutorial has probably reinforced your interest in using Python --- you should be eager to apply Python to solving your real-world problems. Where should you go to learn more?" +#, fuzzy +msgid "" +"Reading this tutorial has probably reinforced your interest in using Python " +"--- you should be eager to apply Python to solving your real-world problems." +" Where should you go to learn more?" msgstr "" +"خواندن این آموزش احتمالاً علاقه شما را به استفاده از پایتون تقویت کرده است " +"--- باید مشتاق استفاده از پایتون برای حل مشکلات دنیای واقعی خود باشید. برای " +"کسب اطلاعات بیشتر به کجا باید مراجعه کرد؟" #: tutorial/whatnow.rst:11 -msgid "This tutorial is part of Python's documentation set. Some other documents in the set are:" +#, fuzzy +msgid "" +"This tutorial is part of Python's documentation set. Some other documents " +"in the set are:" msgstr "" +"این آموزش بخشی از مجموعه مستندات پایتون است. برخی دیگر از اسناد این مجموعه" +" عبارتند از:" #: tutorial/whatnow.rst:14 +#, fuzzy msgid ":ref:`library-index`:" -msgstr "" +msgstr ":ref:`library-index`:" #: tutorial/whatnow.rst:16 -msgid "You should browse through this manual, which gives complete (though terse) reference material about types, functions, and the modules in the standard library. The standard Python distribution includes a *lot* of additional code. There are modules to read Unix mailboxes, retrieve documents via HTTP, generate random numbers, parse command-line options, compress data, and many other tasks. Skimming through the Library Reference will give you an idea of what's available." -msgstr "" +#, fuzzy +msgid "" +"You should browse through this manual, which gives complete (though terse) " +"reference material about types, functions, and the modules in the standard " +"library. The standard Python distribution includes a *lot* of additional " +"code. There are modules to read Unix mailboxes, retrieve documents via HTTP," +" generate random numbers, parse command-line options, compress data, and " +"many other tasks. Skimming through the Library Reference will give you an " +"idea of what's available." +msgstr "" +"شما باید از طریق این راهنما مرور کنید، که مطالب مرجع کامل (هر چند مختصر) در " +"مورد انواع، عملکردها و ماژول های موجود در کتابخانه استاندارد ارائه می دهد. " +"توزیع استاندارد پایتون شامل کد اضافی *lot* است. ماژول هایی برای خواندن صندوق" +" های پستی یونیکس، بازیابی اسناد از طریق HTTP، تولید اعداد تصادفی، تجزیه " +"گزینه های خط فرمان، فشرده سازی داده ها و بسیاری از کارهای دیگر وجود دارد. " +"مروری بر مرجع کتابخانه به شما ایده ای از آنچه در دسترس است می دهد." #: tutorial/whatnow.rst:24 -msgid ":ref:`installing-index` explains how to install additional modules written by other Python users." +#, fuzzy +msgid "" +":ref:`installing-index` explains how to install additional modules written " +"by other Python users." msgstr "" +":ref:`installing-index` نحوه نصب ماژول های اضافی نوشته شده توسط سایر کاربران" +" پایتون را توضیح می دهد." #: tutorial/whatnow.rst:27 -msgid ":ref:`reference-index`: A detailed explanation of Python's syntax and semantics. It's heavy reading, but is useful as a complete guide to the language itself." +#, fuzzy +msgid "" +":ref:`reference-index`: A detailed explanation of Python's syntax and " +"semantics. It's heavy reading, but is useful as a complete guide to the " +"language itself." msgstr "" +":ref:`reference-index`: توضیح مفصلی از نحو و معناشناسی پایتون. خواندن آن " +"سنگین است، اما به عنوان یک راهنمای کامل برای خود زبان مفید است." #: tutorial/whatnow.rst:31 +#, fuzzy msgid "More Python resources:" -msgstr "" +msgstr "منابع بیشتر پایتون:" #: tutorial/whatnow.rst:33 -msgid "https://www.python.org: The major Python web site. It contains code, documentation, and pointers to Python-related pages around the web." +#, fuzzy +msgid "" +"https://www.python.org: The major Python web site. It contains code, " +"documentation, and pointers to Python-related pages around the web." msgstr "" +"https://www.python.org: وب سایت اصلی پایتون. این شامل کد، اسناد و اشاره گر " +"به صفحات مرتبط با پایتون در سراسر وب است." #: tutorial/whatnow.rst:36 +#, fuzzy msgid "https://docs.python.org: Fast access to Python's documentation." -msgstr "" +msgstr "https://docs.python.org: دسترسی سریع به اسناد پایتون." #: tutorial/whatnow.rst:38 -msgid "https://pypi.org: The Python Package Index, previously also nicknamed the Cheese Shop [#]_, is an index of user-created Python modules that are available for download. Once you begin releasing code, you can register it here so that others can find it." +#, fuzzy +msgid "" +"https://pypi.org: The Python Package Index, previously also nicknamed the " +"Cheese Shop [#]_, is an index of user-created Python modules that are " +"available for download. Once you begin releasing code, you can register it " +"here so that others can find it." msgstr "" +"https://pypi.org: فهرست بسته Python که قبلاً با نام مستعار Cheese Shop [#]_ " +"نیز شناخته می شد، فهرستی از ماژول های Python ساخته شده توسط کاربر است که " +"برای دانلود در دسترس هستند. هنگامی که شروع به انتشار کد کردید، می توانید آن" +" را در اینجا ثبت کنید تا دیگران بتوانند آن را پیدا کنند." #: tutorial/whatnow.rst:43 -msgid "https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a sizable collection of code examples, larger modules, and useful scripts. Particularly notable contributions are collected in a book also titled Python Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)" +#, fuzzy +msgid "" +"https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a" +" sizable collection of code examples, larger modules, and useful scripts. " +"Particularly notable contributions are collected in a book also titled " +"Python Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)" msgstr "" +"https://code.activestate.com/recipes/langs/python/: کتاب آشپزی پایتون مجموعه" +" قابل توجهی از نمونه های کد، ماژول های بزرگتر و اسکریپت های مفید است. " +"مشارکت‌های قابل‌توجهی در کتابی با عنوان کتاب آشپزی پایتون (O'Reilly & " +"Associates, ISBN 0-596-00797-3) جمع‌آوری شده است." #: tutorial/whatnow.rst:48 -msgid "https://pyvideo.org collects links to Python-related videos from conferences and user-group meetings." +#, fuzzy +msgid "" +"https://pyvideo.org collects links to Python-related videos from conferences" +" and user-group meetings." msgstr "" +"https://pyvideo.org پیوندهایی را به ویدیوهای مرتبط با پایتون از کنفرانس ها و" +" جلسات گروه کاربر جمع آوری می کند." #: tutorial/whatnow.rst:51 -msgid "https://scipy.org: The Scientific Python project includes modules for fast array computations and manipulations plus a host of packages for such things as linear algebra, Fourier transforms, non-linear solvers, random number distributions, statistical analysis and the like." +#, fuzzy +msgid "" +"https://scipy.org: The Scientific Python project includes modules for fast " +"array computations and manipulations plus a host of packages for such things" +" as linear algebra, Fourier transforms, non-linear solvers, random number " +"distributions, statistical analysis and the like." msgstr "" +"https://scipy.org: پروژه علمی پایتون شامل ماژول هایی برای محاسبات و دستکاری " +"آرایه های سریع به علاوه مجموعه ای از بسته ها برای مواردی مانند جبر خطی، " +"تبدیل فوریه، حل کننده های غیر خطی، توزیع اعداد تصادفی، تجزیه و تحلیل آماری و" +" موارد مشابه است." #: tutorial/whatnow.rst:56 -msgid "For Python-related questions and problem reports, you can post to the newsgroup :newsgroup:`comp.lang.python`, or send them to the mailing list at python-list@python.org. The newsgroup and mailing list are gatewayed, so messages posted to one will automatically be forwarded to the other. There are hundreds of postings a day, asking (and answering) questions, suggesting new features, and announcing new modules. Mailing list archives are available at https://mail.python.org/pipermail/." -msgstr "" +#, fuzzy +msgid "" +"For Python-related questions and problem reports, you can post to the " +"newsgroup :newsgroup:`comp.lang.python`, or send them to the mailing list at" +" python-list@python.org. The newsgroup and mailing list are gatewayed, so " +"messages posted to one will automatically be forwarded to the other. There " +"are hundreds of postings a day, asking (and answering) questions, suggesting" +" new features, and announcing new modules. Mailing list archives are " +"available at https://mail.python.org/pipermail/." +msgstr "" +"برای سؤالات مرتبط با پایتون و گزارش مشکلات، می‌توانید به گروه خبری " +":newsgroup:`comp.lang.python` پست کنید، یا آنها را به فهرست پستی به آدرس " +"python-list@python.org ارسال کنید. گروه خبری و لیست پستی دارای دروازه " +"هستند، بنابراین پیام های ارسال شده به یکی به طور خودکار به دیگری ارسال می " +"شود. صدها پست در روز وجود دارد که سوالاتی را مطرح می کنند (و پاسخ می دهند)," +" ویژگی های جدید را پیشنهاد می کنند و ماژول های جدید را اعلام می کنند. آرشیو " +"لیست پستی در https://mail.python.org/pipermail/ موجود است." #: tutorial/whatnow.rst:64 -msgid "Before posting, be sure to check the list of :ref:`Frequently Asked Questions ` (also called the FAQ). The FAQ answers many of the questions that come up again and again, and may already contain the solution for your problem." +#, fuzzy +msgid "" +"Before posting, be sure to check the list of :ref:`Frequently Asked " +"Questions ` (also called the FAQ). The FAQ answers many of the " +"questions that come up again and again, and may already contain the solution" +" for your problem." msgstr "" +"قبل از ارسال، حتماً لیست :ref:`Frequently Asked Questions ` (که " +"به آن پرسش و پاسخ نیز گفته می شود) را بررسی کنید. سؤالات متداول به بسیاری " +"از سؤالاتی که بارها و بارها مطرح می شوند پاسخ می دهد و ممکن است قبلاً حاوی " +"راه حلی برای مشکل شما باشد." #: tutorial/whatnow.rst:70 +#, fuzzy msgid "Footnotes" -msgstr "" +msgstr "پاورقی ها" #: tutorial/whatnow.rst:71 -msgid "\"Cheese Shop\" is a Monty Python's sketch: a customer enters a cheese shop, but whatever cheese he asks for, the clerk says it's missing." +#, fuzzy +msgid "" +"\"Cheese Shop\" is a Monty Python's sketch: a customer enters a cheese shop," +" but whatever cheese he asks for, the clerk says it's missing." msgstr "" +"«پنیرفروشی» یک طرح مونتی پایتون است: مشتری وارد پنیر فروشی می شود، اما هر چه" +" پنیر بخواهد، منشی می گوید گم شده است."