ENع
الدرس 24 · Idiomatic Python

Type hints

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A type hint is a note in your code that says what kind of value belongs where, such as n: int or -> int. Step through a five-line file, hints.py, to see what Python does with hints (it stores them and never checks them), why double("ha") quietly returns 'haha', and how a type checker, mypy, reads the same file without running it and flags the bug on line 5.

12 دقيقة9 خطوات5 أسئلةAdvanced
شكل 24 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.