Sure it does. They’re optional and not enforced at runtime, but I find them
useful when writing code in PyCharm:
import os
from os import DirEntry
de : DirEntry
for de in os.scandir('/tmp'):
print(de.name)
de = 7
print(de)
Predeclaring de allows me to do the tab completion thing with DirEntry fields /
methods
From: Python-list <[email protected]> on
behalf of [email protected] <[email protected]>
Date: Monday, October 10, 2022 at 10:11 PM
To: [email protected] <[email protected]>
Subject: RE: What to use for finding as many syntax errors as possible.
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
Michael,
A reasonable question. Python lets you initialize variables but has no
explicit declarations.
--
https://mail.python.org/mailman/listinfo/python-list