Skip to content

🌐 Add Persian translation for docs/fa/docs/python-types.md#9553

Closed
amirbahador-hub wants to merge 4 commits into
fastapi:masterfrom
amirbahador-hub:master
Closed

🌐 Add Persian translation for docs/fa/docs/python-types.md#9553
amirbahador-hub wants to merge 4 commits into
fastapi:masterfrom
amirbahador-hub:master

Conversation

@amirbahador-hub
Copy link
Copy Markdown

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

📝 Docs preview for commit 8c4c634 at: https://6467dbc3e49d320fad6a4abb--fastapi.netlify.app

@Kludex Kludex added lang-all Translations awaiting-review lang-fa Persian translations labels Jun 2, 2023
@amirbahador-hub
Copy link
Copy Markdown
Author

@Kludex
Hi if someone reviews this
I can start translating other pages

@tiangolo
Copy link
Copy Markdown
Member

📝 Docs preview for commit 5934115 at: https://649a2fb9b14d051fa5045fc4--fastapi.netlify.app

@tiangolo tiangolo changed the title 🌐 Add Persian translation for docs/fa/docs/python-types.md 🌐 Add Persian translation for docs/fa/docs/python-types.md Jun 27, 2023

فریم ورک **FastAPI** تماما بر اساس این type hint ها می‌باشد, که کلی سود و فایده دارند.

اما اگر حتی هیچوقت **FastAPI**, استفاده نکنید . از کمی یادگیری در مورد آنها سود خواهید برد.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a better translation:

اما حتی اگر هرگز از FastAPI استفاده نمی کنید، کمی یادگیری درباره آن ها برای شما مفید خواهد بود.

اما اگر حتی هیچوقت **FastAPI**, استفاده نکنید . از کمی یادگیری در مورد آنها سود خواهید برد.

!!! توجه
اگر شما یک متخصص پایتون هستید, و شما از قبل همه چیز را در مورد type hints می‌دانید, به فصل بعدی بروید.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

اگر شما یک متخصص پایتون هستید و از قبل همه چیز را در مورد type hints می‌دانید, به فصل بعدی بروید.

!!! اطلاعات
اون type های داخلی درون کروشه ها رو "type parameters" می‌گویند.

در این حالت, `str` یک type parameter هست که `List` پاس داده شده است(یا `list` در پایتون 3.9 و بالاتر).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

به List ارسال شده است.


در پایتون 3.6 و بالاتر (شامل پایتون 3.10) شما می‌تونید از `Union` type در `typing` استفاده کنید و داخل کروشه type هایی رو که می‌تونه بپذیره رو قرار می‌دهید.

در پایتون 3.10 یک **سنتکس جدید** که می‌تونید type هایی رو که می‌تونه بپذیره اضافه شده رو با یک <abbr title='بهش "bitwise یا operator" هم می‌گویند, اما معنیش اینجا خیلی ارتباطی ندارد'>خط عمودی (`|`)</abbr> از هم جدا کنید.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

در پایتون 3.10 یک سینتکس جدید وجود دارد که در آن می توانید تایپ های ممکن را با خط عمودی (|) از هم جدا کنید.


استفاده از `Optional[str]` به جای فقط `str` به editor اجازه می‌ده که بتواند به شما کمک کند تا خطاهایی را شناسایی کنید که می توانید فرض کنید یک مقدار همیشه یک `str` است, در حالی که می‌تونه درواقع `None` هم باشد.

`Optional[یه چیزی]` در اصل کوتاه شده‌ی `Union[یه چیزی, None]`, است آنها معادل هستند.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional[یه چیزی] در اصل کوتاه شده‌ی Union[یه چیزی, None], و معادل هم هستند.

@tiangolo
Copy link
Copy Markdown
Member

As this PR had requested changes to be applied but has been inactive for a while, it's now going to be closed. But if there's anyone interested, feel free to create a new PR.

@tiangolo tiangolo closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-1 lang-all Translations lang-fa Persian translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants