"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid"What's New In Python 3.1"
msgstr"چه چیزهایی در پایتون 3.1 جدید است"
msgid"Author"
msgstr"نویسنده"
msgid"Raymond Hettinger"
msgstr"Raymond Hettinger"
msgid"This article explains the new features in Python 3.1, compared to 3.0. Python 3.1 was released on June 27, 2009."
msgstr"این مقاله ویژگیهای جدید پایتون 3.1 را در مقایسه با 3.0 توضیح میدهد. پایتون 3.1 در ۲۷ ژوئن ۲۰۰۹ منتشر شد."
msgid"PEP 372: Ordered Dictionaries"
msgstr"PEP 372: دیکشنریهای مرتب"
msgid"Regular Python dictionaries iterate over key/value pairs in arbitrary order. Over the years, a number of authors have written alternative implementations that remember the order that the keys were originally inserted. Based on the experiences from those implementations, a new :class:`collections.OrderedDict` class has been introduced."
msgstr"دیکشنریهای معمولی پایتون بر روی جفتهای کلید/مقدار به ترتیب دلخواه پیمایش میکنند. طی سالها، شماری از نویسندگان پیادهسازیهای جایگزینی نوشتهاند که ترتیب درج اولیه کلیدها را به خاطر میسپارند. بر اساس تجربههای حاصل از آن پیادهسازیها، کلاس جدید :class:`collections.OrderedDict` معرفی شده است."
msgid"The OrderedDict API is substantially the same as regular dictionaries but will iterate over keys and values in a guaranteed order depending on when a key was first inserted. If a new entry overwrites an existing entry, the original insertion position is left unchanged. Deleting an entry and reinserting it will move it to the end."
msgstr"API کلاس OrderedDict اساساً همانند دیکشنریهای معمولی است، اما کلیدها و مقادیر را به ترتیبی تضمینشده پیمایش میکند که به زمان نخستین درج هر کلید بستگی دارد. اگر یک ورودی جدید، ورودی موجود را بازنویسی کند، موقعیت درج اصلی بدون تغییر باقی میماند. حذف یک ورودی و درج مجدد آن، آن را به انتها منتقل میکند."
msgid"The standard library now supports use of ordered dictionaries in several modules. The :mod:`configparser` module uses them by default. This lets configuration files be read, modified, and then written back in their original order. The *_asdict()* method for :func:`collections.namedtuple` now returns an ordered dictionary with the values appearing in the same order as the underlying tuple indices. The :mod:`json` module is being built-out with an *object_pairs_hook* to allow OrderedDicts to be built by the decoder. Support was also added for third-party tools like `PyYAML <https://pyyaml.org/>`_."
msgstr"کتابخانه استاندارد اکنون استفاده از دیکشنریهای مرتب را در چندین ماژول پشتیبانی میکند. ماژول :mod:`configparser` بهطور پیشفرض از آنها استفاده میکند. این امر امکان میدهد پروندههای پیکربندی خوانده شوند، تغییر داده شوند و سپس به ترتیب اصلی خود بازنوشته شوند. متد *_asdict()* برای :func:`collections.namedtuple` اکنون یک دیکشنری مرتب برمیگرداند که مقادیر در آن به همان ترتیب اندیسهای تاپل زیرین ظاهر میشوند. ماژول :mod:`json` با یک *object_pairs_hook* در حال گسترش است تا امکان ساخت OrderedDictها توسط کدگشا فراهم شود. پشتیبانی از ابزارهای شخص ثالثی مانند `PyYAML <https://pyyaml.org/>`_ نیز افزوده شد."
msgid":pep:`372` - Ordered Dictionaries"
msgstr":pep:`372` - دیکشنریهای مرتب"
msgid"PEP written by Armin Ronacher and Raymond Hettinger. Implementation written by Raymond Hettinger."
msgstr"PEP نوشتهشده توسط آرمین روناکر و ریموند هتینگر. پیادهسازی نوشتهشده توسط ریموند هتینگر."
msgid"Since an ordered dictionary remembers its insertion order, it can be used in conjunction with sorting to make a sorted dictionary::"
msgstr"از آنجا که یک دیکشنری ترتیبدار ترتیب درج خود را به یاد میآورد، میتوان از آن در ترکیب با مرتبسازی برای ساخت یک دیکشنری مرتبشده استفاده کرد::"
msgid""
">>> # regular unsorted dictionary\n"
">>> d = {'banana': 3, 'apple':4, 'pear': 1, 'orange': 2}\n"
msgid"The new sorted dictionaries maintain their sort order when entries are deleted. But when new keys are added, the keys are appended to the end and the sort is not maintained."
msgstr"دیکشنریهای مرتبشدهی جدید هنگام حذف ورودیها ترتیب مرتبسازی خود را حفظ میکنند. اما هنگامی که کلیدهای جدید اضافه میشوند، کلیدها به انتها افزوده میشوند و مرتبسازی حفظ نمیشود."
msgid"PEP 378: Format Specifier for Thousands Separator"
msgstr"PEP 378: مشخصکننده قالب برای جداکننده هزارگان"
msgid"The built-in :func:`format` function and the :meth:`str.format` method use a mini-language that now includes a simple, non-locale aware way to format a number with a thousands separator. That provides a way to humanize a program's output, improving its professional appearance and readability::"
msgstr"تابع توکار :func:`format` و متد :meth:`str.format` از یک زبان کوچک (mini-language) استفاده میکنند که اکنون شامل راهی ساده و مستقل از locale برای قالببندی یک عدد با جداکنندهی هزارگان است. این امر راهی برای انسانیسازی خروجی یک برنامه فراهم میکند و ظاهر حرفهای و خوانایی آن را بهبود میبخشد::"
msgid""
">>> format(1234567, ',d')\n"
"'1,234,567'\n"
">>> format(1234567.89, ',.2f')\n"
"'1,234,567.89'\n"
">>> format(12345.6 + 8901234.12j, ',f')\n"
"'12,345.600000+8,901,234.120000j'\n"
">>> format(Decimal('1234567.89'), ',f')\n"
"'1,234,567.89'"
msgstr""
">>> format(1234567, ',d')\n"
"'1,234,567'\n"
">>> format(1234567.89, ',.2f')\n"
"'1,234,567.89'\n"
">>> format(12345.6 + 8901234.12j, ',f')\n"
"'12,345.600000+8,901,234.120000j'\n"
">>> format(Decimal('1234567.89'), ',f')\n"
"'1,234,567.89'"
msgid"The supported types are :class:`int`, :class:`float`, :class:`complex` and :class:`decimal.Decimal`."
msgstr"انواع پشتیبانیشده عبارتند از :class:`int`، :class:`float`، :class:`complex` و :class:`decimal.Decimal`."
msgid"Discussions are underway about how to specify alternative separators like dots, spaces, apostrophes, or underscores. Locale-aware applications should use the existing *n* format specifier which already has some support for thousands separators."
msgstr"بحثهایی درباره چگونگی مشخص کردن جداکنندههای جایگزین مانند نقطه، فاصله، آپاستروف یا زیرخط در جریان است. برنامههای آگاه از locale باید از مشخصکننده قالب *n* موجود استفاده کنند که از پیش تا حدی از جداکنندههای هزارگان پشتیبانی میکند."
msgid":pep:`378` - Format Specifier for Thousands Separator"
msgstr":pep:`378` - مشخصکننده قالب برای جداکننده هزارگان"
msgid"PEP written by Raymond Hettinger and implemented by Eric Smith and Mark Dickinson."
msgstr"PEP (پیشنهاد بهبود پایتون) نوشتهشده توسط ریموند هتینگر و پیادهسازیشده توسط اریک اسمیت و مارک دیکینسون."
msgid"Other Language Changes"
msgstr"سایر تغییرات زبان"
msgid"Some smaller changes made to the core Python language are:"
msgstr"برخی از تغییرات کوچکتر اعمالشده در هسته زبان پایتون عبارتاند از:"
msgid"Directories and zip archives containing a :file:`__main__.py` file can now be executed directly by passing their name to the interpreter. The directory/zipfile is automatically inserted as the first entry in sys.path. (Suggestion and initial patch by Andy Chu; revised patch by Phillip J. Eby and Nick Coghlan; :issue:`1739468`.)"
msgstr"پوشهها و آرشیوهای zip که حاوی پروندهی :file:`__main__.py` هستند، اکنون میتوانند با ارسال نام آنها به مفسر، مستقیماً اجرا شوند. پوشه/پروندهی zip بهطور خودکار بهعنوان نخستین ورودی در sys.path درج میشود. (پیشنهاد و وصل اولیه از Andy Chu؛ وصل بازنگریشده از Phillip J. Eby و Nick Coghlan؛ :issue:`1739468`.)"
msgid"The :func:`int` type gained a ``bit_length`` method that returns the number of bits necessary to represent its argument in binary::"
msgstr"نوع :func:`int` متد ``bit_length`` را به دست آورد که تعداد بیتهای لازم برای نمایش آرگومان خود به صورت دودویی را برمیگرداند::"
msgid""
">>> n = 37\n"
">>> bin(37)\n"
"'0b100101'\n"
">>> n.bit_length()\n"
"6\n"
">>> n = 2**123-1\n"
">>> n.bit_length()\n"
"123\n"
">>> (n+1).bit_length()\n"
"124"
msgstr""
">>> n = 37\n"
">>> bin(37)\n"
"'0b100101'\n"
">>> n.bit_length()\n"
"6\n"
">>> n = 2**123-1\n"
">>> n.bit_length()\n"
"123\n"
">>> (n+1).bit_length()\n"
"124"
msgid"(Contributed by Fredrik Johansson, Victor Stinner, Raymond Hettinger, and Mark Dickinson; :issue:`3439`.)"
msgstr"(مشارکتشده توسط فردریک یوهانسون، ویکتور استینر، ریموند هتینگر و مارک دیکینسون؛ :issue:`3439`.)"
msgid"The fields in :func:`format` strings can now be automatically numbered::"
msgstr"فیلدهای رشتههای :func:`format` اکنون میتوانند بهطور خودکار شمارهگذاری شوند::"
msgid""
">>> 'Sir {} of {}'.format('Gallahad', 'Camelot')\n"
"'Sir Gallahad of Camelot'"
msgstr""
">>> 'Sir {} of {}'.format('Gallahad', 'Camelot')\n"
"'Sir Gallahad of Camelot'"
msgid"Formerly, the string would have required numbered fields such as: ``'Sir {0} of {1}'``."
msgstr"در گذشته، این رشته نیازمند فیلدهای شمارهدار مانند ``'Sir {0} of {1}'`` بود."
msgid"(Contributed by Eric Smith; :issue:`5237`.)"
msgstr"(مشارکتشده توسط اریک اسمیت؛ :issue:`5237`.)"
msgid"The :func:`!string.maketrans` function is deprecated and is replaced by new static methods, :meth:`bytes.maketrans` and :meth:`bytearray.maketrans`. This change solves the confusion around which types were supported by the :mod:`string` module. Now, :class:`str`, :class:`bytes`, and :class:`bytearray` each have their own **maketrans** and **translate** methods with intermediate translation tables of the appropriate type."
msgstr"تابع :func:`!string.maketrans` منسوخ شده است و با متدهای ایستای جدید :meth:`bytes.maketrans` و :meth:`bytearray.maketrans` جایگزین شده است. این تغییر، سردرگمی دربارهی اینکه کدام نوعها توسط ماژول :mod:`string` پشتیبانی میشدند را برطرف میکند. اکنون، :class:`str`، :class:`bytes` و :class:`bytearray` هر یک متدهای **maketrans** و **translate** خود را با جدولهای ترجمهی میانی از نوع مناسب دارند."
msgid"(Contributed by Georg Brandl; :issue:`5675`.)"
msgstr"(با مشارکت Georg Brandl؛ :issue:`5675`.)"
msgid"The syntax of the :keyword:`with` statement now allows multiple context managers in a single statement::"
msgstr"سینتکس دستور :keyword:`with` اکنون اجازه میدهد چندین مدیر زمینه در یک دستور واحد استفاده شوند::"
msgid""
">>> with open('mylog.txt') as infile, open('a.out', 'w') as outfile:\n"
"... for line in infile:\n"
"... if '<critical>' in line:\n"
"... outfile.write(line)"
msgstr""
">>> with open('mylog.txt') as infile, open('a.out', 'w') as outfile:\n"
"... for line in infile:\n"
"... if '<critical>' in line:\n"
"... outfile.write(line)"
msgid"With the new syntax, the :func:`!contextlib.nested` function is no longer needed and is now deprecated."
msgstr"با سینتکس جدید، تابع :func:`!contextlib.nested` دیگر مورد نیاز نیست و اکنون منسوخ شده است."
msgid"(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 <https://codereview.appspot.com/53094>`_.)"
msgstr"(مشارکتشده توسط Georg Brandl و Mattias Brändström؛ `appspot issue 53094 <https://codereview.appspot.com/53094>`_.)"
msgid"``round(x, n)`` now returns an integer if *x* is an integer. Previously it returned a float::"
msgstr"``round(x, n)`` اکنون اگر *x* یک عدد صحیح باشد، یک عدد صحیح برمیگرداند. پیش از این یک عدد اعشاری برمیگرداند::"
msgid""
">>> round(1123, -2)\n"
"1100"
msgstr""
">>> round(1123, -2)\n"
"1100"
msgid"(Contributed by Mark Dickinson; :issue:`4707`.)"
msgstr"(با مشارکت Mark Dickinson؛ :issue:`4707`.)"
msgid"Python now uses David Gay's algorithm for finding the shortest floating-point representation that doesn't change its value. This should help mitigate some of the confusion surrounding binary floating-point numbers."
msgstr"پایتون اکنون از الگوریتم دیوید گِی برای یافتن کوتاهترین نمایش ممیز شناور که مقدار آن را تغییر نمیدهد استفاده میکند. این امر باید به کاهش بخشی از سردرگمیهای پیرامون اعداد ممیز شناور دودویی کمک کند."
msgid"The significance is easily seen with a number like ``1.1`` which does not have an exact equivalent in binary floating point. Since there is no exact equivalent, an expression like ``float('1.1')`` evaluates to the nearest representable value which is ``0x1.199999999999ap+0`` in hex or ``1.100000000000000088817841970012523233890533447265625`` in decimal. That nearest value was and still is used in subsequent floating-point calculations."
msgstr"اهمیت این موضوع بهسادگی با عددی مانند ``1.1`` دیده میشود که معادل دقیقی در ممیز شناور دودویی ندارد. از آنجا که معادل دقیقی وجود ندارد، عبارتی مانند ``float('1.1')`` به نزدیکترین مقدار قابل نمایش ارزیابی میشود که برابر با ``0x1.199999999999ap+0`` در مبنای شانزده یا ``1.100000000000000088817841970012523233890533447265625`` در مبنای ده است. آن نزدیکترین مقدار در محاسبات ممیز شناور بعدی استفاده میشد و همچنان نیز استفاده میشود."
msgid"What is new is how the number gets displayed. Formerly, Python used a simple approach. The value of ``repr(1.1)`` was computed as ``format(1.1, '.17g')`` which evaluated to ``'1.1000000000000001'``. The advantage of using 17 digits was that it relied on IEEE-754 guarantees to assure that ``eval(repr(1.1))`` would round-trip exactly to its original value. The disadvantage is that many people found the output to be confusing (mistaking intrinsic limitations of binary floating-point representation as being a problem with Python itself)."
msgstr"آنچه جدید است، نحوهی نمایش داده شدن عدد است. پیشتر، پایتون از رویکردی ساده استفاده میکرد. مقدار ``repr(1.1)`` بهصورت ``format(1.1, '.17g')`` محاسبه میشد که به ``'1.1000000000000001'`` ارزیابی میشد. مزیت استفاده از ۱۷ رقم این بود که به تضمینهای IEEE-754 تکیه میکرد تا اطمینان دهد ``eval(repr(1.1))`` دقیقاً به مقدار اصلی خود رفتوبرگشت میکند. عیب آن این است که بسیاری از افراد خروجی را گیجکننده مییافتند (محدودیتهای ذاتی نمایش دودویی ممیز شناور را اشتباهاً مشکلی در خود پایتون میپنداشتند)."
msgid"The new algorithm for ``repr(1.1)`` is smarter and returns ``'1.1'``. Effectively, it searches all equivalent string representations (ones that get stored with the same underlying float value) and returns the shortest representation."
msgstr"الگوریتم جدید برای ``repr(1.1)`` هوشمندتر است و ``'1.1'`` را برمیگرداند. در عمل، این الگوریتم تمام نمایشهای رشتهای معادل (نمایشهایی که با همان مقدار ممیز شناور زیربنایی ذخیره میشوند) را جستوجو میکند و کوتاهترین نمایش را برمیگرداند."
msgid"The new algorithm tends to emit cleaner representations when possible, but it does not change the underlying values. So, it is still the case that ``1.1 + 2.2 != 3.3`` even though the representations may suggest otherwise."
msgstr"الگوریتم جدید در صورت امکان تمایل دارد نمایشهای تمیزتری تولید کند، اما مقادیر زیربنایی را تغییر نمیدهد. بنابراین همچنان ``1.1 + 2.2 != 3.3`` برقرار است، حتی اگر نمایشها خلاف آن را القا کنند."
msgid"The new algorithm depends on certain features in the underlying floating-point implementation. If the required features are not found, the old algorithm will continue to be used. Also, the text pickle protocols assure cross-platform portability by using the old algorithm."
msgstr"الگوریتم جدید به ویژگیهای خاصی در پیادهسازی ممیز شناور زیرین وابسته است. اگر ویژگیهای مورد نیاز یافت نشوند، به استفاده از الگوریتم قدیمی ادامه خواهد شد. همچنین، پروتکلهای پیکل متنی با استفاده از الگوریتم قدیمی، قابلیت انتقال بینسکویی را تضمین میکنند."
msgid"(Contributed by Eric Smith and Mark Dickinson; :issue:`1580`)"
msgstr"(همکاری اریک اسمیت و مارک دیکنسون؛ :issue:`1580`)"
msgid"New, Improved, and Deprecated Modules"
msgstr"ماژولهای جدید، بهبودیافته و منسوخ"
msgid"Added a :class:`collections.Counter` class to support convenient counting of unique items in a sequence or iterable::"
msgstr"کلاس :class:`collections.Counter` برای پشتیبانی از شمارش آسان آیتمهای یکتا در یک دنباله یا شیء پیمایشپذیر اضافه شد::"
msgid"(Contributed by Raymond Hettinger; :issue:`1696199`.)"
msgstr"(مشارکت Raymond Hettinger؛ :issue:`1696199`.)"
msgid"Added a new module, :mod:`tkinter.ttk` for access to the Tk themed widget set. The basic idea of ttk is to separate, to the extent possible, the code implementing a widget's behavior from the code implementing its appearance."
msgstr"ماژول جدیدی به نام :mod:`tkinter.ttk` برای دسترسی به مجموعه ابزارکهای تمدار Tk اضافه شد. ایدهی اصلی ttk این است که کد پیادهسازیکنندهی رفتار یک ابزارک، تا حد امکان، از کد پیادهسازیکنندهی ظاهر آن جدا شود."
msgid"(Contributed by Guilherme Polo; :issue:`2983`.)"
msgstr"(مشارکت توسط Guilherme Polo؛ :issue:`2983`.)"
msgid"The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classes now support the context management protocol::"
msgstr"کلاسهای :class:`gzip.GzipFile` و :class:`bz2.BZ2File` اکنون از پروتکل مدیریت زمینه پشتیبانی میکنند::"
msgid""
">>> # Automatically close file after writing\n"
">>> with gzip.GzipFile(filename, \"wb\") as f:\n"
"... f.write(b\"xxx\")"
msgstr""
">>> # Automatically close file after writing\n"
">>> with gzip.GzipFile(filename, \"wb\") as f:\n"
"... f.write(b\"xxx\")"
msgid"(Contributed by Antoine Pitrou.)"
msgstr"(مشارکتشده توسط آنتوان پیترو.)"
msgid"The :mod:`decimal` module now supports methods for creating a decimal object from a binary :class:`float`. The conversion is exact but can sometimes be surprising::"
msgstr"ماژول :mod:`decimal` اکنون از متدهایی برای ایجاد یک شیء دهدهی از یک :class:`float` دودویی پشتیبانی میکند. این تبدیل دقیق است، اما گاهی ممکن است تعجبآور باشد::"
msgid"The long decimal result shows the actual binary fraction being stored for *1.1*. The fraction has many digits because *1.1* cannot be exactly represented in binary."
msgstr"نتیجهی اعشاری طولانی، کسر دودوییِ واقعیِ ذخیرهشده برای *1.1* را نشان میدهد. این کسر رقمهای زیادی دارد، زیرا *1.1* را نمیتوان بهطور دقیق در مبنای دودویی بازنمایی کرد."
msgid"(Contributed by Raymond Hettinger and Mark Dickinson.)"
msgstr"(مشارکتشده توسط Raymond Hettinger و Mark Dickinson.)"
msgid"The :mod:`itertools` module grew two new functions. The :func:`itertools.combinations_with_replacement` function is one of four for generating combinatorics including permutations and Cartesian products. The :func:`itertools.compress` function mimics its namesake from APL. Also, the existing :func:`itertools.count` function now has an optional *step* argument and can accept any type of counting sequence including :class:`fractions.Fraction` and :class:`decimal.Decimal`::"
msgstr"به ماژول :mod:`itertools` دو تابع جدید اضافه شد. تابع :func:`itertools.combinations_with_replacement` یکی از چهار تابع برای تولید ترکیبیات از جمله جایگشتها و ضربهای دکارتی است. تابع :func:`itertools.compress` همانند همنام خود در APL عمل میکند. همچنین، تابع از پیش موجود :func:`itertools.count` اکنون یک آرگومان اختیاری *step* دارد و میتواند هر نوع دنباله شمارشی از جمله :class:`fractions.Fraction` و :class:`decimal.Decimal` را بپذیرد::"
msgid""
">>> [p+q for p,q in combinations_with_replacement('LOVE', 2)]\n"
msgid":func:`collections.namedtuple` now supports a keyword argument *rename* which lets invalid fieldnames be automatically converted to positional names in the form _0, _1, etc. This is useful when the field names are being created by an external source such as a CSV header, SQL field list, or user input::"
msgstr":func:`collections.namedtuple` اکنون از آرگومان کلیدواژهای *rename* پشتیبانی میکند که اجازه میدهد نامهای فیلد نامعتبر بهطور خودکار به نامهای جایگاهی به شکل _0، _1 و غیره تبدیل شوند. این زمانی مفید است که نام فیلدها توسط منبعی خارجی مانند سرآیند CSV، فهرست فیلد SQL یا ورودی کاربر ایجاد میشوند::"
msgid""
">>> query = input()\n"
"SELECT region, dept, count(*) FROM main GROUPBY region, dept\n"
"\n"
">>> cursor.execute(query)\n"
">>> query_fields = [desc[0] for desc in cursor.description]\n"
msgid"(Contributed by Raymond Hettinger; :issue:`1818`.)"
msgstr"(ارائهشده توسط Raymond Hettinger؛ :issue:`1818`.)"
msgid"The :func:`re.sub`, :func:`re.subn` and :func:`re.split` functions now accept a flags parameter."
msgstr"توابع :func:`re.sub`، :func:`re.subn` و :func:`re.split` اکنون پارامتر flags را میپذیرند."
msgid"(Contributed by Gregory Smith.)"
msgstr"(با مشارکت گریگوری اسمیت.)"
msgid"The :mod:`logging` module now implements a simple :class:`logging.NullHandler` class for applications that are not using logging but are calling library code that does. Setting-up a null handler will suppress spurious warnings such as \"No handlers could be found for logger foo\"::"
msgstr"ماژول :mod:`logging` اکنون یک کلاس سادهی :class:`logging.NullHandler` را برای برنامههایی که خود از گزارشگیری استفاده نمیکنند اما کد کتابخانهای را فراخوانی میکنند که از آن استفاده میکند، پیادهسازی میکند. راهاندازی یک هندلر تهی، هشدارهای کاذبی مانند «No handlers could be found for logger foo» را سرکوب میکند::"
msgid""
">>> h = logging.NullHandler()\n"
">>> logging.getLogger(\"foo\").addHandler(h)"
msgstr""
">>> h = logging.NullHandler()\n"
">>> logging.getLogger(\"foo\").addHandler(h)"
msgid"(Contributed by Vinay Sajip; :issue:`4384`)."
msgstr"(مشارکت وینای ساجیپ؛ :issue:`4384`)."
msgid"The :mod:`runpy` module which supports the ``-m`` command line switch now supports the execution of packages by looking for and executing a ``__main__`` submodule when a package name is supplied."
msgstr"ماژول :mod:`runpy` که از سوییچ خط فرمان ``-m`` پشتیبانی میکند، اکنون هنگامی که نام یک بسته ارائه میشود، با جستوجو و اجرای زیرماژول ``__main__`` از اجرای بستهها پشتیبانی میکند."
msgid"(Contributed by Andi Vajda; :issue:`4195`.)"
msgstr"(مشارکت از سوی Andi Vajda؛ :issue:`4195`.)"
msgid"The :mod:`pdb` module can now access and display source code loaded via :mod:`zipimport` (or any other conformant :pep:`302` loader)."
msgstr"ماژول :mod:`pdb` اکنون میتواند به کد منبع بارگذاریشده از طریق :mod:`zipimport` (یا هر بارگذار دیگری که با :pep:`302` سازگار باشد) دسترسی داشته باشد و آن را نمایش دهد."
msgid"(Contributed by Alexander Belopolsky; :issue:`4201`.)"
msgstr"(مشارکت توسط Alexander Belopolsky؛ :issue:`4201`.)"
msgid":class:`functools.partial` objects can now be pickled."
msgstr"اشیاء :class:`functools.partial` اکنون میتوانند پیکل شوند."
msgid"(Suggested by Antoine Pitrou and Jesse Noller. Implemented by Jack Diederich; :issue:`5228`.)"
msgstr"(پیشنهادشده توسط Antoine Pitrou و Jesse Noller. پیادهسازیشده توسط Jack Diederich؛ :issue:`5228`.)"
msgid"Add :mod:`pydoc` help topics for symbols so that ``help('@')`` works as expected in the interactive environment."
msgstr"موضوعات راهنمای :mod:`pydoc` را برای نمادها اضافه کنید تا ``help('@')`` در محیط تعاملی همانطور که انتظار میرود کار کند."
msgid"(Contributed by David Laban; :issue:`4739`.)"
msgstr"(مشارکتشده توسط David Laban؛ :issue:`4739`.)"
msgid"The :mod:`unittest` module now supports skipping individual tests or classes of tests. And it supports marking a test as an expected failure, a test that is known to be broken, but shouldn't be counted as a failure on a TestResult::"
msgstr"ماژول :mod:`unittest` اکنون از نادیده گرفتن آزمونهای منفرد یا کلاسهای آزمون پشتیبانی میکند. همچنین از علامتگذاری یک آزمون به عنوان شکست مورد انتظار پشتیبانی میکند؛ آزمونی که میدانیم معیوب است، اما نباید به عنوان شکست در TestResult شمرده شود::"
msgid"Also, tests for exceptions have been builtout to work with context managers using the :keyword:`with` statement::"
msgstr"همچنین، آزمونهای استثناها بهگونهای ساخته شدهاند که با استفاده از دستور :keyword:`with` با مدیرهای زمینه کار کنند::"
msgid""
"def test_division_by_zero(self):\n"
" with self.assertRaises(ZeroDivisionError):\n"
" x / 0"
msgstr""
"def test_division_by_zero(self):\n"
" with self.assertRaises(ZeroDivisionError):\n"
" x / 0"
msgid"In addition, several new assertion methods were added including :meth:`~unittest.TestCase.assertSetEqual`, :meth:`~unittest.TestCase.assertDictEqual`, :meth:`!assertDictContainsSubset`, :meth:`~unittest.TestCase.assertListEqual`, :meth:`~unittest.TestCase.assertTupleEqual`, :meth:`~unittest.TestCase.assertSequenceEqual`, :meth:`assertRaisesRegexp() <unittest.TestCase.assertRaisesRegex>`, :meth:`~unittest.TestCase.assertIsNone`, and :meth:`~unittest.TestCase.assertIsNotNone`."
msgstr"علاوه بر این، چندین متد ادعای جدید از جمله :meth:`~unittest.TestCase.assertSetEqual`، :meth:`~unittest.TestCase.assertDictEqual`، :meth:`!assertDictContainsSubset`، :meth:`~unittest.TestCase.assertListEqual`، :meth:`~unittest.TestCase.assertTupleEqual`، :meth:`~unittest.TestCase.assertSequenceEqual`، :meth:`assertRaisesRegexp() <unittest.TestCase.assertRaisesRegex>`، :meth:`~unittest.TestCase.assertIsNone` و :meth:`~unittest.TestCase.assertIsNotNone` افزوده شد."
msgid"(Contributed by Benjamin Peterson and Antoine Pitrou.)"
msgstr"(با مشارکت Benjamin Peterson و Antoine Pitrou.)"
msgid"The :mod:`io` module has three new constants for the :meth:`~io.IOBase.seek` method: :data:`~os.SEEK_SET`, :data:`~os.SEEK_CUR`, and :data:`~os.SEEK_END`."
msgstr"ماژول :mod:`io` سه ثابت جدید برای متد :meth:`~io.IOBase.seek` دارد: :data:`~os.SEEK_SET`، :data:`~os.SEEK_CUR` و :data:`~os.SEEK_END`."
msgid"The :data:`sys.version_info` tuple is now a named tuple::"
msgstr"تاپل :data:`sys.version_info` اکنون یک تاپل نامدار است::"
msgid"(Contributed by Ross Light; :issue:`4285`.)"
msgstr"(با مشارکت Ross Light؛ :issue:`4285`.)"
msgid"The :mod:`!nntplib` and :mod:`imaplib` modules now support IPv6."
msgstr"ماژولهای :mod:`!nntplib` و :mod:`imaplib` اکنون از IPv6 پشتیبانی میکنند."
msgid"(Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.)"
msgstr"(مشارکتشده توسط Derek Morr؛ :issue:`1655` و :issue:`1664`.)"
msgid"The :mod:`pickle` module has been adapted for better interoperability with Python 2.x when used with protocol 2 or lower. The reorganization of the standard library changed the formal reference for many objects. For example, ``__builtin__.set`` in Python 2 is called ``builtins.set`` in Python 3. This change confounded efforts to share data between different versions of Python. But now when protocol 2 or lower is selected, the pickler will automatically use the old Python 2 names for both loading and dumping. This remapping is turned-on by default but can be disabled with the *fix_imports* option::"
msgstr "ماژول :mod:`pickle` هنگامی که با پروتکل ۲ یا پایینتر استفاده شود، برای همکنشپذیری بهتر با Python 2.x تطبیق داده شده است. سازماندهی مجدد کتابخانه استاندارد، ارجاع رسمی بسیاری از اشیاء را تغییر داد. برای مثال، ``__builtin__.set`` در Python 2، در Python 3 ``builtins.set`` نامیده میشود. این تغییر تلاشها برای همرسانی دادهها بین نسخههای مختلف Python را دشوار میکرد. اما اکنون وقتی پروتکل ۲ یا پایینتر انتخاب شود، پیکلساز بهطور خودکار از نامهای قدیمی Python 2 هم برای بارگذاری و هم برای برونریزی استفاده میکند. این بازنگاشت بهصورت پیشفرض فعال است، اما میتوان آن را با گزینه *fix_imports* غیرفعال کرد::"
msgid"An unfortunate but unavoidable side-effect of this change is that protocol 2 pickles produced by Python 3.1 won't be readable with Python 3.0. The latest pickle protocol, protocol 3, should be used when migrating data between Python 3.x implementations, as it doesn't attempt to remain compatible with Python 2.x."
msgstr"عارضهی جانبی تأسفانگیز اما ناگزیر این تغییر این است که پیکلهای پروتکل ۲ تولیدشده توسط Python 3.1 با Python 3.0 قابل خواندن نخواهند بود. جدیدترین پروتکل پیکل، یعنی پروتکل ۳، باید هنگام مهاجرت دادهها بین پیادهسازیهای Python 3.x استفاده شود، زیرا تلاشی برای سازگار ماندن با Python 2.x نمیکند."
msgid"(Contributed by Alexandre Vassalotti and Antoine Pitrou, :issue:`6137`.)"
msgstr"(مشارکتشده توسط Alexandre Vassalotti و Antoine Pitrou، :issue:`6137`.)"
msgid"A new module, :mod:`importlib` was added. It provides a complete, portable, pure Python reference implementation of the :keyword:`import` statement and its counterpart, the :func:`__import__` function. It represents a substantial step forward in documenting and defining the actions that take place during imports."
msgstr"یک ماژول جدید، :mod:`importlib` اضافه شد. این ماژول یک پیادهسازی مرجع کامل، قابل حمل و به پایتون خالص از دستور :keyword:`import` و همتای آن، تابع :func:`__import__` فراهم میکند. این امر گامی اساسی به جلو در مستندسازی و تعریف کنشهایی است که در طول ایمپورتها رخ میدهند."
msgid"(Contributed by Brett Cannon.)"
msgstr"(مشارکتشده توسط Brett Cannon.)"
msgid"Optimizations"
msgstr"بهینهسازیها"
msgid"Major performance enhancements have been added:"
msgstr"بهبودهای عمدهای در کارایی اضافه شدهاند:"
msgid"The new I/O library (as defined in :pep:`3116`) was mostly written in Python and quickly proved to be a problematic bottleneck in Python 3.0. In Python 3.1, the I/O library has been entirely rewritten in C and is 2 to 20 times faster depending on the task at hand. The pure Python version is still available for experimentation purposes through the ``_pyio`` module."
msgstr"کتابخانهی جدید I/O (همانطور که در :pep:`3116` تعریف شده است) عمدتاً به زبان پایتون نوشته شده بود و بهسرعت در پایتون 3.0 به گلوگاهی مشکلساز تبدیل شد. در پایتون 3.1، کتابخانهی I/O بهطور کامل به زبان C بازنویسی شده است و بسته به وظیفهی موردنظر، ۲ تا ۲۰ برابر سریعتر است. نسخهی پایتون خالص همچنان برای اهداف آزمایشی از طریق ماژول ``_pyio`` در دسترس است."
msgid"(Contributed by Amaury Forgeot d'Arc and Antoine Pitrou.)"
msgstr"(مشارکتشده توسط Amaury Forgeot d'Arc و Antoine Pitrou.)"
msgid"Added a heuristic so that tuples and dicts containing only untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes."
msgstr"روشی ابتکاری افزوده شد تا تاپلها و دیکشنریهایی که فقط شامل اشیای غیرقابلپیگیری هستند، توسط زبالهروب پیگیری نشوند. این امر میتواند در برنامههای طولانیمدت، بسته به نحوهی استفادهی خاص آنها از انواع داده، اندازهی گردآوریها و در نتیجه سربار زبالهروبی را کاهش دهد."
msgid"(Contributed by Antoine Pitrou, :issue:`4688`.)"
msgstr"(مشارکتشده توسط Antoine Pitrou، :issue:`4688`.)"
msgid"Enabling a configure option named ``--with-computed-gotos`` on compilers that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is compiled with a new dispatch mechanism which gives speedups of up to 20%, depending on the system, the compiler, and the benchmark."
msgstr"با فعالسازی گزینهای از configure به نام ``--with-computed-gotos`` روی کامپایلرهایی که از آن پشتیبانی میکنند (بهویژه: gcc، SunPro و icc)، حلقهی ارزیابی بایتکد با سازوکار نگاشت جدیدی کامپایل میشود که بسته به سیستم، کامپایلر و بنچمارک، افزایش سرعتی تا ۲۰٪ ایجاد میکند."
msgid"(Contributed by Antoine Pitrou along with a number of other participants, :issue:`4753`)."
msgstr"(مشارکتشده توسط Antoine Pitrou به همراه تعدادی از شرکتکنندگان دیگر، :issue:`4753`)."
msgid"The decoding of UTF-8, UTF-16 and LATIN-1 is now two to four times faster."
msgstr"کدگشایی UTF-8، UTF-16 و LATIN-1 اکنون دو تا چهار برابر سریعتر شده است."
msgid"(Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.)"
msgstr"(مشارکت Antoine Pitrou و Amaury Forgeot d'Arc، :issue:`4868`.)"
msgid"The :mod:`json` module now has a C extension to substantially improve its performance. In addition, the API was modified so that json works only with :class:`str`, not with :class:`bytes`. That change makes the module closely match the `JSON specification <https://json.org/>`_ which is defined in terms of Unicode."
msgstr"ماژول :mod:`json` اکنون دارای یک افزونهی C است که کارایی آن را بهطور چشمگیری بهبود میبخشد. علاوه بر این، API به گونهای تغییر داده شد که json فقط با :class:`str` کار کند، نه با :class:`bytes`. این تغییر باعث میشود ماژول با `مشخصات JSON <https://json.org/>`_ که بر حسب یونیکد تعریف شده است، تطابق نزدیکی داشته باشد."
msgid"(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and Benjamin Peterson; :issue:`4136`.)"
msgstr"(مشارکتشده توسط Bob Ippolito و به Py3.1 تبدیلشده توسط Antoine Pitrou و Benjamin Peterson؛ :issue:`4136`.)"
msgid"Unpickling now interns the attribute names of pickled objects. This saves memory and allows pickles to be smaller."
msgstr"پیکلگشایی اکنون نامهای ویژگی اشیاء پیکلشده را درونسازی (intern) میکند. این کار در مصرف حافظه صرفهجویی میکند و به پیکلها اجازه میدهد کوچکتر باشند."
msgid"(Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.)"
msgstr"(مشارکت Jake McGuire و Antoine Pitrou؛ :issue:`5084`.)"
msgid"IDLE"
msgstr"IDLE"
msgid"IDLE's format menu now provides an option to strip trailing whitespace from a source file."
msgstr"منوی Format در IDLE اکنون گزینهای برای حذف فاصلههای سفید انتهایی از یک پرونده منبع ارائه میدهد."
msgid"(Contributed by Roger D. Serwy; :issue:`5150`.)"
msgstr"(مشارکتکرده توسط راجر دی. سروی؛ :issue:`5150`.)"
msgid"Build and C API Changes"
msgstr"تغییرات ساخت و API زبان C"
msgid"Changes to Python's build process and to the C API include:"
msgstr"تغییرات در فرایند ساخت پایتون و در C API شامل موارد زیر است:"
msgid"Integers are now stored internally either in base ``2**15`` or in base ``2**30``, the base being determined at build time. Previously, they were always stored in base ``2**15``. Using base ``2**30`` gives significant performance improvements on 64-bit machines, but benchmark results on 32-bit machines have been mixed. Therefore, the default is to use base ``2**30`` on 64-bit machines and base ``2**15`` on 32-bit machines; on Unix, there's a new configure option ``--enable-big-digits`` that can be used to override this default."
msgstr"اعداد صحیح اکنون بهصورت داخلی یا در مبنای ``2**15`` یا در مبنای ``2**30`` ذخیره میشوند، که مبنای آن در زمان ساخت تعیین میشود. پیش از این، آنها همیشه در مبنای ``2**15`` ذخیره میشدند. استفاده از مبنای ``2**30`` بهبود عملکرد قابلتوجهی روی رایانههای ۶۴ بیتی به همراه دارد، اما نتایج بنچمارک روی رایانههای ۳۲ بیتی متفاوت بوده است. بنابراین، پیشفرض، استفاده از مبنای ``2**30`` روی رایانههای ۶۴ بیتی و مبنای ``2**15`` روی رایانههای ۳۲ بیتی است؛ در یونیکس، گزینهی جدید پیکربندی ``--enable-big-digits`` وجود دارد که میتوان از آن برای لغو این پیشفرض استفاده کرد."
msgid"Apart from the performance improvements this change should be invisible to end users, with one exception: for testing and debugging purposes there's a new :data:`sys.int_info` that provides information about the internal format, giving the number of bits per digit and the size in bytes of the C type used to store each digit::"
msgstr"به جز بهبودهای کارایی، این تغییر باید برای کاربران نهایی نامرئی باشد، با یک استثنا: برای اهداف آزمون و اشکالزدایی، یک :data:`sys.int_info` جدید وجود دارد که اطلاعاتی دربارهی قالب داخلی فراهم میکند و تعداد بیتها به ازای هر رقم و اندازهی نوع C استفادهشده برای ذخیرهی هر رقم را بر حسب بایت مشخص میکند::"
msgid""
">>> import sys\n"
">>> sys.int_info\n"
"sys.int_info(bits_per_digit=30, sizeof_digit=4)"
msgstr""
">>> import sys\n"
">>> sys.int_info\n"
"sys.int_info(bits_per_digit=30, sizeof_digit=4)"
msgid"(Contributed by Mark Dickinson; :issue:`4258`.)"
msgstr"(مشارکتشده توسط Mark Dickinson؛ :issue:`4258`.)"
msgid"The :c:func:`PyLong_AsUnsignedLongLong()` function now handles a negative *pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`."
msgstr"تابع :c:func:`PyLong_AsUnsignedLongLong()` اکنون یک *pylong* منفی را با ایجاد :exc:`OverflowError` بهجای :exc:`TypeError` مدیریت میکند."
msgid"(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)"
msgstr"(مشارکتشده توسط Mark Dickinson و Lisandro Dalcrin؛ :issue:`5175`.)"
msgid"Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead."
msgstr":c:func:`!PyNumber_Int` منسوخ شده است. به جای آن از :c:func:`PyNumber_Long` استفاده کنید."
msgid"(Contributed by Mark Dickinson; :issue:`4910`.)"
msgstr"(مشارکت توسط Mark Dickinson؛ :issue:`4910`.)"
msgid"Added a new :c:func:`PyOS_string_to_double` function to replace the deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof`."
msgstr"تابع جدید :c:func:`PyOS_string_to_double` برای جایگزینی توابع منسوخ :c:func:`!PyOS_ascii_strtod` و :c:func:`!PyOS_ascii_atof` اضافه شد."
msgid"(Contributed by Mark Dickinson; :issue:`5914`.)"
msgstr"(مشارکتشده توسط Mark Dickinson؛ :issue:`5914`.)"
msgid"Added :c:type:`PyCapsule` as a replacement for the :c:type:`!PyCObject` API. The principal difference is that the new type has a well defined interface for passing typing safety information and a less complicated signature for calling a destructor. The old type had a problematic API and is now deprecated."
msgstr":c:type:`PyCapsule` بهعنوان جایگزینی برای API :c:type:`!PyCObject` افزوده شد. تفاوت اصلی این است که نوع جدید، رابطی کاملاً تعریفشده برای انتقال اطلاعات ایمنی نوع و امضایی سادهتر برای فراخوانی مخرب دارد. نوع قدیمی API مشکلداری داشت و اکنون منسوخ شده است."
msgid"(Contributed by Larry Hastings; :issue:`5630`.)"
msgstr"(مشارکت از سوی لری هستینگز؛ :issue:`5630`.)"
msgid"Porting to Python 3.1"
msgstr"انتقال به پایتون 3.1"
msgid"This section lists previously described changes and other bugfixes that may require changes to your code:"
msgstr"این بخش تغییرات پیشتر توصیفشده و سایر رفع اشکالهایی را که ممکن است نیازمند تغییراتی در کد شما باشند، فهرست میکند:"
msgid"The new floating-point string representations can break existing doctests. For example::"
msgstr"نمایشهای رشتهای جدید اعداد ممیز شناور میتوانند داکتستهای (doctest) موجود را خراب کنند. برای مثال::"
msgid""
"def e():\n"
" '''Compute the base of natural logarithms.\n"
"\n"
" >>> e()\n"
" 2.7182818284590451\n"
"\n"
" '''\n"
" return sum(1/math.factorial(x) for x in reversed(range(30)))\n"
msgid"The automatic name remapping in the pickle module for protocol 2 or lower can make Python 3.1 pickles unreadable in Python 3.0. One solution is to use protocol 3. Another solution is to set the *fix_imports* option to ``False``. See the discussion above for more details."
msgstr"بازنگاشت خودکار نام در ماژول pickle برای پروتکل 2 یا پایینتر میتواند پیکلهای پایتون 3.1 را در پایتون 3.0 ناخوانا کند. یک راهحل استفاده از پروتکل 3 است. راهحل دیگر، تنظیم گزینهی *fix_imports* روی ``False`` است. برای جزئیات بیشتر، به بحث بالا مراجعه کنید."