Python Generators Explained: Working with Yield, Return, and Delegation
Learn how to write memory-efficient Python code by mastering generator delegation, returning values from generators, and handling StopIteration exceptions effectively.
حول هذه الدورة
Many Python developers use basic generators to handle data streams but struggle when it comes to delegating generators or returning values from them. Understanding how generators communicate and manage state is key to writing clean, memory-efficient code. This text-only course guides you through the mechanics of Python generators, from foundational concepts to advanced delegation patterns. You will gain the confidence to write, debug, and optimize generator-based pipelines in your own projects.
What you'll learn:
- Understand the fundamental lifecycle of Python generators and the generator protocol.
- Implement the yield from syntax to cleanly delegate operations to sub-generators.
- Manage return values within generators and handle the resulting StopIteration exceptions.
- Apply modern Python type hints to document and validate your generator functions.
- Write memory-efficient code for data processing pipelines using nested generator structures.
You will start with core definitions and the basic generator protocol before moving step-by-step into nested generators, exception handling, and real-world code patterns. Each concept is reinforced with clear written explanations and practical code snippets that you can read and study at your own pace.
This course is designed for Python beginners who know basic syntax and want to deepen their understanding of intermediate functional programming concepts. No advanced experience is required.
Start reading today to unlock the full potential of Python's generator delegation.
ما الذي ستحصل عليه
-
📜
شهادة إتمام
أضفها إلى ملفك على LinkedIn -
💬
Personal AI tutor
Stuck on a lesson? Ask your built-in tutor anything, any time. -
🎧
النسخة الصوتية مضمَّنة
تعلَّم أثناء تنقُّلك — دون شاشة -
♾️
وصول مدى الحياة
عُد متى شئت، بلا انتهاء -
📱
الهاتف أو الكمبيوتر
يعمل في أي مكان وعلى أي جهاز -
💸
استرداد خلال 30 يومًا
دون أسئلة -
⚡
قصير ومركَّز
40 دقيقة من المحتوى التطبيقي
المراجعات
لا توجد مراجعات بعد — كن أول من يشارك تجربته.
المتعلمون أخذوا أيضًا
تعلم أساسيات لغة جو، من النحو الأساسي إلى التزامن، وبدأ في بناء تطبيقات خلفية فعالة مع هذا الدليل الخطوة بخطوة.
$4.99
فك لغز كيفية عمل لغات البرمجة تحت الغطاء وامتلك نماذج البرمجة الوظيفية لتعلم أي لغة جديدة بسهولة.
$4.99
تعلم مبادئ البرمجة الوظيفية باستخدام Scala لكتابة رمز أنظف وأأمن وأكثر قابلية للصيانة بثقة.
$4.99
معرفة الميكانيكا الداخلية للغة بايثون، نماذج البرمجة الوظيفية، الإغلاقات، والديكورات المخصصة لكتابة شفرة نظيفة وفعالة ومهنية.
$4.99
الأسئلة الشائعة
ما الذي أحتاجه لأخذ هذه الدورة؟ +
يكفي هاتف أو كمبيوتر متصل بالإنترنت. بدون تثبيتات أو أجهزة خاصة.
كيف يمكنني الدفع؟ +
بالبطاقة عبر Stripe أو بالعملات الرقمية. لا نخزن بيانات البطاقة — يتولى Stripe ذلك بأمان.
هل يمكنني استرداد المال؟ +
نعم — استرداد كامل خلال 30 يومًا، دون أسئلة.
إلى متى يستمر وصولي؟ +
إلى الأبد. بمجرد الشراء، الدورة لك تعود إليها متى شئت.
هل سأحصل على شهادة؟ +
نعم. عند الإتمام ستحصل على شهادة يمكنك إضافتها إلى ملفك في LinkedIn.
مصمَّم للعاملين في
التقنية
التصميم
المالية
التسويق
الرعاية الصحية
التعليم
الضيافة
التصنيع