Skip to content

Commit 7ff1359

Browse files
committed
Translate Section: Appearances are deceptive
1 parent 31bc257 commit 7ff1359

1 file changed

Lines changed: 42 additions & 41 deletions

File tree

translations/fa-farsi/README.md

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@
157157
- [💡 Explanation:](#-explanation-53)
158158
- [▶ Let's mangle](#-lets-mangle)
159159
- [💡 Explanation:](#-explanation-54)
160-
- [Section: Appearances are deceptive!](#section-appearances-are-deceptive)
161-
- [Skipping lines?](#-skipping-lines)
162-
- [💡 Explanation](#-explanation-55)
163-
- [Teleportation](#-teleportation)
164-
- [💡 Explanation:](#-explanation-56)
165-
- [Well, something is fishy...](#-well-something-is-fishy)
166-
- [💡 Explanation](#-explanation-57)
160+
- [‫ بخش: ظاهرها فریبنده‌اند!](#-بخش-ظاهرها-فریبندهاند)
161+
- [‫ خطوط را رد می‌کند؟](#--خطوط-را-رد-میکند)
162+
- [‫ 💡 توضیح](#--توضیح)
163+
- [‫ تله‌پورت کردن](#--تلهپورت-کردن)
164+
- [‫ 💡 توضیح:](#--توضیح-1)
165+
- [‫ خب، یک جای کار مشکوک است...](#--خب-یک-جای-کار-مشکوک-است)
166+
- [‫ 💡 توضیح](#--توضیح-2)
167167
- [بخش: متفرقه](#بخش-متفرقه)
168-
- [`+=` سریع‌تر است](#--سریعتر-است)
168+
- [`+=` سریع‌تر است](#---سریعتر-است)
169169
- [‫ 💡 توضیح:](#---توضیح)
170170
- [‫ ▶ بیایید یک رشته‌ی بزرگ بسازیم!](#--بیایید-یک-رشتهی-بزرگ-بسازیم)
171171
- [💡 توضیحات](#-توضیحات-1)
@@ -3427,9 +3427,9 @@ AttributeError: 'A' object has no attribute '__variable'
34273427
---
34283428
---
34293429
3430-
## Section: Appearances are deceptive!
3430+
## ‫ بخش: ظاهرها فریبنده‌اند!
34313431
3432-
### ▶ Skipping lines?
3432+
### ▶ ‫ خطوط را رد می‌کند؟
34333433
<!-- Example ID: d50bbde1-fb9d-4735-9633-3444b9d2f417 --->
34343434
**Output:**
34353435
```py
@@ -3439,33 +3439,33 @@ AttributeError: 'A' object has no attribute '__variable'
34393439
11
34403440
```
34413441
3442-
Wut?
3442+
&#x202b; چی?
34433443
3444-
**Note:** The easiest way to reproduce this is to simply copy the statements from the above snippet and paste them into your file/shell.
3444+
&#x202b; **نکته:** ساده‌ترین روش برای بازتولید این رفتار، کپی کردن دستورات از کد بالا و جایگذاری (paste) آن‌ها در فایل یا محیط تعاملی (shell) خودتان است.
34453445
3446-
#### 💡 Explanation
3446+
#### &#x202b; 💡 توضیح
34473447
3448-
Some non-Western characters look identical to letters in the English alphabet but are considered distinct by the interpreter.
3448+
&#x202b; برخی از حروف غیرغربی کاملاً مشابه حروف الفبای انگلیسی به نظر می‌رسند، اما مفسر پایتون آن‌ها را متفاوت در نظر می‌گیرد.
34493449
34503450
```py
3451-
>>> ord('е') # cyrillic 'e' (Ye)
3451+
>>> ord('е') # حرف سیریلیک «е» (Ye)
34523452
1077
3453-
>>> ord('e') # latin 'e', as used in English and typed using standard keyboard
3453+
>>> ord('e') # حرف لاتین «e»، که در انگلیسی استفاده می‌شود و با صفحه‌کلید استاندارد تایپ می‌گردد
34543454
101
34553455
>>> 'е' == 'e'
34563456
False
34573457
3458-
>>> value = 42 # latin e
3459-
>>> valuе = 23 # cyrillic 'e', Python 2.x interpreter would raise a `SyntaxError` here
3458+
>>> value = 42 # حرف لاتین e
3459+
>>> valuе = 23 # حرف سیریلیک «е»؛ مفسر پایتون نسخه ۲ در اینجا خطای `SyntaxError` ایجاد می‌کند
34603460
>>> value
34613461
42
34623462
```
34633463
3464-
The built-in `ord()` function returns a character's Unicode [code point](https://en.wikipedia.org/wiki/Code_point), and different code positions of Cyrillic 'e' and Latin 'e' justify the behavior of the above example.
3464+
&#x202b; تابع داخلی `ord()`، [کدپوینت](https://fa.wikipedia.org/wiki/کدپوینت) یونیکد مربوط به یک نویسه را برمی‌گرداند. موقعیت‌های کدی متفاوت برای حرف سیریلیک «е» و حرف لاتین «e»، علت رفتار مثال بالا را توجیه می‌کنند.
34653465
34663466
---
34673467
3468-
### ▶ Teleportation
3468+
### ▶ &#x202b; تله‌پورت کردن
34693469
34703470
<!-- Example ID: edafe923-0c20-4315-b6e1-0c31abfc38f5 --->
34713471
@@ -3474,64 +3474,65 @@ The built-in `ord()` function returns a character's Unicode [code point](https:/
34743474
import numpy as np
34753475
34763476
def energy_send(x):
3477-
# Initializing a numpy array
3477+
# مقداردهی اولیه یک آرایه numpy
34783478
np.array([float(x)])
34793479
34803480
def energy_receive():
3481-
# Return an empty numpy array
3481+
# بازگرداندن یک آرایه‌ی خالی numpy
34823482
return np.empty((), dtype=np.float).tolist()
34833483
```
34843484
3485-
**Output:**
3485+
&#x202b; **خروجی:**
34863486
```py
34873487
>>> energy_send(123.456)
34883488
>>> energy_receive()
34893489
123.456
34903490
```
34913491
3492-
Where's the Nobel Prize?
3492+
&#x202b; جایزه نوبل کجاست؟
34933493
3494-
#### 💡 Explanation:
3494+
#### &#x202b; 💡 توضیح:
34953495
3496-
* Notice that the numpy array created in the `energy_send` function is not returned, so that memory space is free to reallocate.
3497-
* `numpy.empty()` returns the next free memory slot without reinitializing it. This memory spot just happens to be the same one that was just freed (usually, but not always).
3496+
* &#x202b; توجه کنید که آرایه‌ی numpy ایجادشده در تابع `energy_send` برگردانده نشده است، بنابراین فضای حافظه‌ی آن آزاد شده و مجدداً قابل استفاده است.
3497+
* &#x202b; تابع `numpy.empty()` نزدیک‌ترین فضای حافظه‌ی آزاد را بدون مقداردهی مجدد برمی‌گرداند. این فضای حافظه معمولاً همان فضایی است که به‌تازگی آزاد شده است (البته معمولاً این اتفاق می‌افتد و نه همیشه).
34983498
34993499
---
35003500
3501-
### ▶ Well, something is fishy...
3501+
### ▶ &#x202b; خب، یک جای کار مشکوک است...
35023502
<!-- Example ID: cb6a37c5-74f7-44ca-b58c-3b902419b362 --->
35033503
```py
35043504
def square(x):
35053505
"""
3506-
A simple function to calculate the square of a number by addition.
3506+
یک تابع ساده برای محاسبه‌ی مربع یک عدد با استفاده از جمع.
35073507
"""
35083508
sum_so_far = 0
35093509
for counter in range(x):
35103510
sum_so_far = sum_so_far + x
35113511
return sum_so_far
35123512
```
35133513
3514-
**Output (Python 2.x):**
3514+
&#x202b; **خروجی (پایتون 2.X):**
35153515
35163516
```py
35173517
>>> square(10)
35183518
10
35193519
```
35203520
3521-
Shouldn't that be 100?
3521+
&#x202b; آیا این نباید ۱۰۰ باشد؟
35223522
3523-
**Note:** If you're not able to reproduce this, try running the file [mixed_tabs_and_spaces.py](/mixed_tabs_and_spaces.py) via the shell.
3523+
&#x202b; **نکته:** اگر نمی‌توانید این مشکل را بازتولید کنید، سعی کنید فایل [mixed_tabs_and_spaces.py](/mixed_tabs_and_spaces.py) را از طریق شِل اجرا کنید.
35243524
3525-
#### 💡 Explanation
3525+
#### &#x202b; 💡 توضیح
35263526
3527-
* **Don't mix tabs and spaces!** The character just preceding return is a "tab", and the code is indented by multiple of "4 spaces" elsewhere in the example.
3528-
* This is how Python handles tabs:
3529-
3530-
> First, tabs are replaced (from left to right) by one to eight spaces such that the total number of characters up to and including the replacement is a multiple of eight <...>
3531-
* So the "tab" at the last line of `square` function is replaced with eight spaces, and it gets into the loop.
3532-
* Python 3 is kind enough to throw an error for such cases automatically.
3527+
* &#x202b; **تب‌ها و فاصله‌ها (space) را با هم ترکیب نکنید!** کاراکتری که دقیقاً قبل از دستور return آمده یک «تب» است، در حالی که در بقیۀ مثال، کد با مضربی از «۴ فاصله» تورفتگی دارد.
3528+
* &#x202b; نحوۀ برخورد پایتون با تب‌ها به این صورت است:
3529+
3530+
> &#x202b; ابتدا تب‌ها (از چپ به راست) با یک تا هشت فاصله جایگزین می‌شوند به‌طوری که تعداد کل کاراکترها تا انتهای آن جایگزینی، مضربی از هشت باشد <...>
3531+
* &#x202b; بنابراین «تب» در آخرین خط تابع `square` با هشت فاصله جایگزین شده و به همین دلیل داخل حلقه قرار می‌گیرد.
3532+
* &#x202b; پایتون ۳ آنقدر هوشمند هست که چنین مواردی را به‌صورت خودکار با خطا اعلام کند.
3533+
3534+
&#x202b; **خروجی (Python 3.x):**
35333535
3534-
**Output (Python 3.x):**
35353536
```py
35363537
TabError: inconsistent use of tabs and spaces in indentation
35373538
```
@@ -3542,7 +3543,7 @@ Shouldn't that be 100?
35423543
## بخش: متفرقه
35433544
35443545
3545-
### ▶ `+=` سریع‌تر است
3546+
### &#x202b; ▶ `+=` سریع‌تر است
35463547
<!-- Example ID: bfd19c60-a807-4a26-9598-4912b86ddb36 --->
35473548
35483549
```py

0 commit comments

Comments
 (0)