-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathipaddress.po
More file actions
427 lines (362 loc) · 27.3 KB
/
Copy pathipaddress.po
File metadata and controls
427 lines (362 loc) · 27.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Danial Behzadi <dani.behzi@ubuntu.com>, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-16 12:56+0000\n"
"PO-Revision-Date: 2021-06-28 00:53+0000\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "An introduction to the ipaddress module"
msgstr "مقدمهای بر ماژول ipaddress"
msgid "author"
msgstr "نویسنده"
msgid "Peter Moody"
msgstr "پیتر مودی"
msgid "Nick Coghlan"
msgstr "Nick Coghlan"
msgid "Overview"
msgstr "مرور کلی"
msgid "This document aims to provide a gentle introduction to the :mod:`ipaddress` module. It is aimed primarily at users that aren't already familiar with IP networking terminology, but may also be useful to network engineers wanting an overview of how :mod:`ipaddress` represents IP network addressing concepts."
msgstr "هدف این سند ارائهی مقدمهای ملایم برای ماژول :mod:`ipaddress` است. این سند عمدتاً برای کاربرانی در نظر گرفته شده است که از پیش با اصطلاحات شبکهسازی IP آشنا نیستند، اما ممکن است برای مهندسان شبکهای که به دنبال مروری بر چگونگی نمایش مفاهیم آدرسدهی شبکههای IP توسط :mod:`ipaddress` هستند نیز مفید باشد."
msgid "Creating Address/Network/Interface objects"
msgstr "ایجاد اشیاء نشانی/شبکه/رابط"
msgid "Since :mod:`ipaddress` is a module for inspecting and manipulating IP addresses, the first thing you'll want to do is create some objects. You can use :mod:`ipaddress` to create objects from strings and integers."
msgstr "از آنجا که :mod:`ipaddress` ماژولی برای بررسی و دستکاری آدرسهای IP است، اولین کاری که میخواهید انجام دهید ایجاد چند شیء است. میتوانید از :mod:`ipaddress` برای ایجاد شیءها از رشتهها و اعداد صحیح استفاده کنید."
msgid "A Note on IP Versions"
msgstr "یادداشتی درباره نسخههای IP"
msgid "For readers that aren't particularly familiar with IP addressing, it's important to know that the Internet Protocol (IP) is currently in the process of moving from version 4 of the protocol to version 6. This transition is occurring largely because version 4 of the protocol doesn't provide enough addresses to handle the needs of the whole world, especially given the increasing number of devices with direct connections to the internet."
msgstr "برای خوانندگانی که بهویژه با آدرسدهی IP آشنا نیستند، مهم است بدانند که پروتکل اینترنت (IP) در حال حاضر در حال گذار از نسخه 4 این پروتکل به نسخه 6 است. این گذار عمدتاً به این دلیل رخ میدهد که نسخه 4 پروتکل، آدرسهای کافی برای پاسخگویی به نیازهای کل جهان را فراهم نمیکند، بهویژه با توجه به افزایش تعداد دستگاههایی که اتصال مستقیم به اینترنت دارند."
msgid "Explaining the details of the differences between the two versions of the protocol is beyond the scope of this introduction, but readers need to at least be aware that these two versions exist, and it will sometimes be necessary to force the use of one version or the other."
msgstr "توضیح جزئیات تفاوتهای میان دو نسخه از پروتکل خارج از دامنه این مقدمه است، اما شما باید دستکم از وجود این دو نسخه آگاه باشید، و گاهی لازم است استفاده از یکی از این دو نسخه را تحمیل کنید."
msgid "IP Host Addresses"
msgstr "آدرسهای میزبان IP"
msgid "Addresses, often referred to as \"host addresses\" are the most basic unit when working with IP addressing. The simplest way to create addresses is to use the :func:`ipaddress.ip_address` factory function, which automatically determines whether to create an IPv4 or IPv6 address based on the passed in value:"
msgstr "نشانیها، که اغلب با عنوان «نشانیهای میزبان» شناخته میشوند، پایهایترین واحد هنگام کار با نشانیدهی IP هستند. سادهترین راه برای ایجاد نشانیها، استفاده از تابع کارخانهایٔ :func:`ipaddress.ip_address` است، که بهطور خودکار بر اساس مقدار ورودی تعیین میکند که یک نشانی IPv4 ایجاد شود یا IPv6:"
msgid "Addresses can also be created directly from integers. Values that will fit within 32 bits are assumed to be IPv4 addresses::"
msgstr "نشانیها همچنین میتوانند مستقیماً از اعداد صحیح ساخته شوند. مقادیری که در ۳۲ بیت جای میگیرند، نشانیهای IPv4 فرض میشوند::"
msgid ""
">>> ipaddress.ip_address(3221225985)\n"
"IPv4Address('192.0.2.1')\n"
">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n"
"IPv6Address('2001:db8::1')"
msgstr ""
">>> ipaddress.ip_address(3221225985)\n"
"IPv4Address('192.0.2.1')\n"
">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n"
"IPv6Address('2001:db8::1')"
msgid "To force the use of IPv4 or IPv6 addresses, the relevant classes can be invoked directly. This is particularly useful to force creation of IPv6 addresses for small integers::"
msgstr "برای وادار کردن به استفاده از نشانیهای IPv4 یا IPv6، میتوان کلاسهای مربوطه را مستقیماً فراخوانی کرد. این کار بهویژه برای وادار کردن به ایجاد نشانیهای IPv6 برای اعداد صحیح کوچک مفید است::"
msgid ""
">>> ipaddress.ip_address(1)\n"
"IPv4Address('0.0.0.1')\n"
">>> ipaddress.IPv4Address(1)\n"
"IPv4Address('0.0.0.1')\n"
">>> ipaddress.IPv6Address(1)\n"
"IPv6Address('::1')"
msgstr ""
">>> ipaddress.ip_address(1)\n"
"IPv4Address('0.0.0.1')\n"
">>> ipaddress.IPv4Address(1)\n"
"IPv4Address('0.0.0.1')\n"
">>> ipaddress.IPv6Address(1)\n"
"IPv6Address('::1')"
msgid "Defining Networks"
msgstr "تعریف شبکهها"
msgid "Host addresses are usually grouped together into IP networks, so :mod:`ipaddress` provides a way to create, inspect and manipulate network definitions. IP network objects are constructed from strings that define the range of host addresses that are part of that network. The simplest form for that information is a \"network address/network prefix\" pair, where the prefix defines the number of leading bits that are compared to determine whether or not an address is part of the network and the network address defines the expected value of those bits."
msgstr "نشانیهای میزبان معمولاً با یکدیگر در شبکههای IP گروهبندی میشوند، بنابراین :mod:`ipaddress` راهی برای ایجاد، بررسی و دستکاری تعریفهای شبکه فراهم میکند. اشیاء شبکهی IP از رشتههایی ساخته میشوند که بازهی نشانیهای میزبانی که بخشی از آن شبکه هستند را تعریف میکنند. سادهترین شکل برای این اطلاعات، یک جفت «نشانی شبکه/پیشوند شبکه» است، که در آن پیشوند تعداد بیتهای پیشرویی را تعریف میکند که برای تعیین اینکه آیا یک نشانی بخشی از شبکه است یا خیر مقایسه میشوند و نشانی شبکه مقدار مورد انتظار آن بیتها را تعریف میکند."
msgid "As for addresses, a factory function is provided that determines the correct IP version automatically::"
msgstr "در مورد آدرسها، یک تابع کارخانهای ارائه شده است که نسخه صحیح IP را بهطور خودکار تعیین میکند::"
msgid ""
">>> ipaddress.ip_network('192.0.2.0/24')\n"
"IPv4Network('192.0.2.0/24')\n"
">>> ipaddress.ip_network('2001:db8::0/96')\n"
"IPv6Network('2001:db8::/96')"
msgstr ""
">>> ipaddress.ip_network('192.0.2.0/24')\n"
"IPv4Network('192.0.2.0/24')\n"
">>> ipaddress.ip_network('2001:db8::0/96')\n"
"IPv6Network('2001:db8::/96')"
msgid "Network objects cannot have any host bits set. The practical effect of this is that ``192.0.2.1/24`` does not describe a network. Such definitions are referred to as interface objects since the ip-on-a-network notation is commonly used to describe network interfaces of a computer on a given network and are described further in the next section."
msgstr "اشیاء شبکه نمیتوانند هیچ بیت میزبان تنظیمشدهای داشته باشند. اثر عملی این موضوع آن است که ``192.0.2.1/24`` یک شبکه را توصیف نمیکند. چنین تعاریفی بهعنوان اشیاء رابط شناخته میشوند، زیرا نمادگذاری آیپی روی شبکه (ip-on-a-network) معمولاً برای توصیف رابطهای شبکهی یک کامپیوتر در یک شبکهی مشخص به کار میرود و در بخش بعدی بیشتر توضیح داده شدهاند."
msgid "By default, attempting to create a network object with host bits set will result in :exc:`ValueError` being raised. To request that the additional bits instead be coerced to zero, the flag ``strict=False`` can be passed to the constructor::"
msgstr "بهطور پیشفرض، تلاش برای ایجاد یک شیء شبکه با بیتهای میزبانِ تنظیمشده، باعث پرتاب :exc:`ValueError` میشود. برای درخواست اینکه بیتهای اضافی درعوض به صفر تبدیل شوند، میتوان پرچم ``strict=False`` را به سازنده ارسال کرد::"
msgid ""
">>> ipaddress.ip_network('192.0.2.1/24')\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: 192.0.2.1/24 has host bits set\n"
">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n"
"IPv4Network('192.0.2.0/24')"
msgstr ""
">>> ipaddress.ip_network('192.0.2.1/24')\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: 192.0.2.1/24 has host bits set\n"
">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n"
"IPv4Network('192.0.2.0/24')"
msgid "While the string form offers significantly more flexibility, networks can also be defined with integers, just like host addresses. In this case, the network is considered to contain only the single address identified by the integer, so the network prefix includes the entire network address::"
msgstr "اگرچه شکل رشتهای انعطافپذیری بسیار بیشتری فراهم میکند، شبکهها را میتوان درست مانند آدرسهای میزبان، با اعداد صحیح نیز تعریف کرد. در این حالت، شبکه تنها شامل آدرس شناساییشده توسط آن عدد صحیح در نظر گرفته میشود، بنابراین پیشوند شبکه، کل آدرس شبکه را شامل میشود::"
msgid ""
">>> ipaddress.ip_network(3221225984)\n"
"IPv4Network('192.0.2.0/32')\n"
">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n"
"IPv6Network('2001:db8::/128')"
msgstr ""
">>> ipaddress.ip_network(3221225984)\n"
"IPv4Network('192.0.2.0/32')\n"
">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n"
"IPv6Network('2001:db8::/128')"
msgid "As with addresses, creation of a particular kind of network can be forced by calling the class constructor directly instead of using the factory function."
msgstr "همانند آدرسها، میتوان با فراخوانی مستقیم سازندهی کلاس بهجای استفاده از تابع کارخانه (factory function)، ایجاد یک نوع خاص از شبکه را اجباری کرد."
msgid "Host Interfaces"
msgstr "رابطهای میزبان"
msgid "As mentioned just above, if you need to describe an address on a particular network, neither the address nor the network classes are sufficient. Notation like ``192.0.2.1/24`` is commonly used by network engineers and the people who write tools for firewalls and routers as shorthand for \"the host ``192.0.2.1`` on the network ``192.0.2.0/24``\", Accordingly, :mod:`ipaddress` provides a set of hybrid classes that associate an address with a particular network. The interface for creation is identical to that for defining network objects, except that the address portion isn't constrained to being a network address."
msgstr "همانطور که درست در بالا اشاره شد، اگر نیاز دارید نشانیای در یک شبکه خاص را توصیف کنید، نه کلاسهای نشانی و نه کلاسهای شبکه کافی نیستند. مهندسان شبکه و افرادی که ابزارهایی برای فایروالها و مسیریابها مینویسند، معمولاً از نمادگذاری مانند ``192.0.2.1/24`` بهعنوان خلاصهای برای «میزبان ``192.0.2.1`` در شبکه ``192.0.2.0/24``» استفاده میکنند. بر همین اساس، :mod:`ipaddress` مجموعهای از کلاسهای ترکیبی را فراهم میکند که یک نشانی را با یک شبکه خاص مرتبط میکنند. رابط ایجاد آنها کاملاً مشابه رابط تعریف اشیاء شبکه است، با این تفاوت که بخش نشانی محدود به نشانی شبکه نیست."
msgid "Integer inputs are accepted (as with networks), and use of a particular IP version can be forced by calling the relevant constructor directly."
msgstr "ورودیهای عدد صحیح پذیرفته میشوند (همانطور که در شبکهها نیز چنین است)، و میتوان با فراخوانی مستقیم سازنده مربوطه، استفاده از نسخه خاصی از IP را الزامی کرد."
msgid "Inspecting Address/Network/Interface Objects"
msgstr "بررسی اشیاء آدرس/شبکه/رابط"
msgid "You've gone to the trouble of creating an IPv(4|6)(Address|Network|Interface) object, so you probably want to get information about it. :mod:`ipaddress` tries to make doing this easy and intuitive."
msgstr "شما زحمت ایجاد یک شیء IPv(4|6)(Address|Network|Interface) را به خود دادهاید، بنابراین احتمالاً میخواهید اطلاعاتی دربارهی آن کسب کنید. :mod:`ipaddress` تلاش میکند انجام این کار را آسان و شهودی کند."
msgid "Extracting the IP version::"
msgstr "استخراج نسخه IP::"
msgid ""
">>> addr4 = ipaddress.ip_address('192.0.2.1')\n"
">>> addr6 = ipaddress.ip_address('2001:db8::1')\n"
">>> addr6.version\n"
"6\n"
">>> addr4.version\n"
"4"
msgstr ""
">>> addr4 = ipaddress.ip_address('192.0.2.1')\n"
">>> addr6 = ipaddress.ip_address('2001:db8::1')\n"
">>> addr6.version\n"
"6\n"
">>> addr4.version\n"
"4"
msgid "Obtaining the network from an interface::"
msgstr "به دست آوردن شبکه از یک رابط::"
msgid ""
">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n"
">>> host4.network\n"
"IPv4Network('192.0.2.0/24')\n"
">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n"
">>> host6.network\n"
"IPv6Network('2001:db8::/96')"
msgstr ""
">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n"
">>> host4.network\n"
"IPv4Network('192.0.2.0/24')\n"
">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n"
">>> host6.network\n"
"IPv6Network('2001:db8::/96')"
msgid "Finding out how many individual addresses are in a network::"
msgstr "یافتن تعداد آدرسهای منفرد موجود در یک شبکه::"
msgid ""
">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n"
">>> net4.num_addresses\n"
"256\n"
">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n"
">>> net6.num_addresses\n"
"4294967296"
msgstr ""
">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n"
">>> net4.num_addresses\n"
"256\n"
">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n"
">>> net6.num_addresses\n"
"4294967296"
msgid "Iterating through the \"usable\" addresses on a network::"
msgstr "پیمایش آدرسهای «قابلاستفاده» در یک شبکه::"
msgid ""
">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n"
">>> for x in net4.hosts():\n"
"... print(x)\n"
"192.0.2.1\n"
"192.0.2.2\n"
"192.0.2.3\n"
"192.0.2.4\n"
"...\n"
"192.0.2.252\n"
"192.0.2.253\n"
"192.0.2.254"
msgstr ""
">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n"
">>> for x in net4.hosts():\n"
"... print(x)\n"
"192.0.2.1\n"
"192.0.2.2\n"
"192.0.2.3\n"
"192.0.2.4\n"
"...\n"
"192.0.2.252\n"
"192.0.2.253\n"
"192.0.2.254"
msgid "Obtaining the netmask (i.e. set bits corresponding to the network prefix) or the hostmask (any bits that are not part of the netmask):"
msgstr "بهدست آوردن netmask (یعنی بیتهای تنظیمشده متناظر با پیشوند شبکه) یا hostmask (هر بیتی که بخشی از netmask نیست):"
msgid "Exploding or compressing the address::"
msgstr "بسط یا فشردهسازی نشانی::"
msgid ""
">>> addr6.exploded\n"
"'2001:0db8:0000:0000:0000:0000:0000:0001'\n"
">>> addr6.compressed\n"
"'2001:db8::1'\n"
">>> net6.exploded\n"
"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n"
">>> net6.compressed\n"
"'2001:db8::/96'"
msgstr ""
">>> addr6.exploded\n"
"'2001:0db8:0000:0000:0000:0000:0000:0001'\n"
">>> addr6.compressed\n"
"'2001:db8::1'\n"
">>> net6.exploded\n"
"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n"
">>> net6.compressed\n"
"'2001:db8::/96'"
msgid "While IPv4 doesn't support explosion or compression, the associated objects still provide the relevant properties so that version neutral code can easily ensure the most concise or most verbose form is used for IPv6 addresses while still correctly handling IPv4 addresses."
msgstr "اگرچه IPv4 از بسط (explosion) یا فشردهسازی پشتیبانی نمیکند، اشیاء مرتبط همچنان ویژگیهای مربوطه را فراهم میکنند تا کد مستقل از نسخه بتواند بهراحتی اطمینان حاصل کند که مختصرترین یا پرجزئیاتترین فرم برای آدرسهای IPv6 استفاده میشود و در عین حال آدرسهای IPv4 بهدرستی مدیریت میشوند."
msgid "Networks as lists of Addresses"
msgstr "شبکهها بهعنوان فهرستهایی از نشانیها"
msgid "It's sometimes useful to treat networks as lists. This means it is possible to index them like this::"
msgstr "گاهی مفید است که با شبکهها مانند فهرستها رفتار کنید. این بدان معناست که میتوانید آنها را به این شکل اندیسگذاری کنید::"
msgid ""
">>> net4[1]\n"
"IPv4Address('192.0.2.1')\n"
">>> net4[-1]\n"
"IPv4Address('192.0.2.255')\n"
">>> net6[1]\n"
"IPv6Address('2001:db8::1')\n"
">>> net6[-1]\n"
"IPv6Address('2001:db8::ffff:ffff')"
msgstr ""
">>> net4[1]\n"
"IPv4Address('192.0.2.1')\n"
">>> net4[-1]\n"
"IPv4Address('192.0.2.255')\n"
">>> net6[1]\n"
"IPv6Address('2001:db8::1')\n"
">>> net6[-1]\n"
"IPv6Address('2001:db8::ffff:ffff')"
msgid "It also means that network objects lend themselves to using the list membership test syntax like this::"
msgstr "این همچنین به این معناست که اشیاء شبکهای را میتوان با سینتکس آزمون عضویت در فهرست به این صورت استفاده کرد::"
msgid ""
"if address in network:\n"
" # do something"
msgstr ""
"if address in network:\n"
" # do something"
msgid "Containment testing is done efficiently based on the network prefix::"
msgstr "آزمون دربرگیری (containment testing) بهصورت کارآمد بر اساس پیشوند شبکه انجام میشود::"
msgid ""
">>> addr4 = ipaddress.ip_address('192.0.2.1')\n"
">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n"
"True\n"
">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n"
"False"
msgstr ""
">>> addr4 = ipaddress.ip_address('192.0.2.1')\n"
">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n"
"True\n"
">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n"
"False"
msgid "Comparisons"
msgstr "مقایسهها"
msgid ":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare objects, where it makes sense::"
msgstr ":mod:`ipaddress` روشهای سادهای ارائه میدهد که امید است شهودی باشند، برای مقایسهی اشیاء در مواردی که منطقی باشد::"
msgid ""
">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n"
"True"
msgstr ""
">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n"
"True"
msgid "A :exc:`TypeError` exception is raised if you try to compare objects of different versions or different types."
msgstr "اگر سعی کنید اشیایی با نسخهها یا انواع مختلف را مقایسه کنید، استثنای :exc:`TypeError` پرتاب میشود."
msgid "Using IP Addresses with other modules"
msgstr "استفاده از آدرسهای IP با سایر ماژولها"
msgid "Other modules that use IP addresses (such as :mod:`socket`) usually won't accept objects from this module directly. Instead, they must be coerced to an integer or string that the other module will accept::"
msgstr "ماژولهای دیگری که از آدرسهای IP استفاده میکنند (مانند :mod:`socket`) معمولاً اشیاء این ماژول را مستقیماً نمیپذیرند. در عوض، باید به یک عدد صحیح یا رشتهای تبدیل شوند که ماژول دیگر بپذیرد::"
msgid ""
">>> addr4 = ipaddress.ip_address('192.0.2.1')\n"
">>> str(addr4)\n"
"'192.0.2.1'\n"
">>> int(addr4)\n"
"3221225985"
msgstr ""
">>> addr4 = ipaddress.ip_address('192.0.2.1')\n"
">>> str(addr4)\n"
"'192.0.2.1'\n"
">>> int(addr4)\n"
"3221225985"
msgid "Getting more detail when instance creation fails"
msgstr "دریافت جزئیات بیشتر در صورت شکست در ایجاد نمونه"
msgid "When creating address/network/interface objects using the version-agnostic factory functions, any errors will be reported as :exc:`ValueError` with a generic error message that simply says the passed in value was not recognized as an object of that type. The lack of a specific error is because it's necessary to know whether the value is *supposed* to be IPv4 or IPv6 in order to provide more detail on why it has been rejected."
msgstr "هنگام ایجاد اشیای نشانی/شبکه/رابط با استفاده از توابع کارخانهای مستقل از نسخه، هر خطایی بهصورت :exc:`ValueError` با پیام خطای عام گزارش میشود که صرفاً میگوید مقدار دادهشده بهعنوان شیئی از آن نوع شناسایی نشد. دلیل نبود خطای مشخص این است که برای ارائه جزئیات بیشتر دربارهی علت رد شدن مقدار، لازم است بدانیم که آیا مقدار *باید* IPv4 باشد یا IPv6."
msgid "To support use cases where it is useful to have access to this additional detail, the individual class constructors actually raise the :exc:`ValueError` subclasses :exc:`ipaddress.AddressValueError` and :exc:`ipaddress.NetmaskValueError` to indicate exactly which part of the definition failed to parse correctly."
msgstr "برای پشتیبانی از موارد استفادهای که دسترسی به این جزئیات اضافی در آنها مفید است، سازندههای هر کلاس در واقع استثناهای زیرکلاس :exc:`ValueError`، یعنی :exc:`ipaddress.AddressValueError` و :exc:`ipaddress.NetmaskValueError` را پرتاب میکنند تا دقیقاً مشخص کنند کدام بخش از تعریف بهدرستی تجزیه نشد."
msgid "The error messages are significantly more detailed when using the class constructors directly. For example::"
msgstr "پیامهای خطا هنگامی که مستقیماً از سازندههای کلاس استفاده میکنید، بهطور قابلتوجهی جزئیتر هستند. برای مثال::"
msgid ""
">>> ipaddress.ip_address(\"192.168.0.256\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n"
">>> ipaddress.IPv4Address(\"192.168.0.256\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in '192.168.0.256'\n"
"\n"
">>> ipaddress.ip_network(\"192.168.0.1/64\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n"
">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ipaddress.NetmaskValueError: '64' is not a valid netmask"
msgstr ""
">>> ipaddress.ip_address(\"192.168.0.256\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n"
">>> ipaddress.IPv4Address(\"192.168.0.256\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in '192.168.0.256'\n"
"\n"
">>> ipaddress.ip_network(\"192.168.0.1/64\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n"
">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n"
"Traceback (most recent call last):\n"
" ...\n"
"ipaddress.NetmaskValueError: '64' is not a valid netmask"
msgid "However, both of the module specific exceptions have :exc:`ValueError` as their parent class, so if you're not concerned with the particular type of error, you can still write code like the following::"
msgstr "با این حال، کلاس والد هر دو استثنای مختص ماژول، :exc:`ValueError` است، بنابراین اگر نگران نوع خاصی از خطا نیستید، همچنان میتوانید کدی مانند زیر بنویسید::"
msgid ""
"try:\n"
" network = ipaddress.IPv4Network(address)\n"
"except ValueError:\n"
" print('address/netmask is invalid for IPv4:', address)"
msgstr ""
"try:\n"
" network = ipaddress.IPv4Network(address)\n"
"except ValueError:\n"
" print('address/netmask is invalid for IPv4:', address)"