summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-12-17 01:18:21 (GMT)
committerGitHub <noreply@github.com>2023-12-17 01:18:21 (GMT)
commitf7cacc43f56ae522bf18eb9019983fa664905a5e (patch)
tree73564086555501c9dcbb10fbe89c6871bf3d7388
parent3bfe2b6c2a857f987e57ae8ab7097e113f590621 (diff)
downloadcpython-f7cacc43f56ae522bf18eb9019983fa664905a5e.zip
cpython-f7cacc43f56ae522bf18eb9019983fa664905a5e.tar.gz
cpython-f7cacc43f56ae522bf18eb9019983fa664905a5e.tar.bz2
[3.12] IDLE: Add util and stub example comments (GH-113222) (#113223)
(cherry picked from commit cde1335485b7bffb12c378d230ae48ad77d76ab1) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
-rw-r--r--Lib/idlelib/idle_test/example_stub.pyi2
-rw-r--r--Lib/idlelib/util.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/Lib/idlelib/idle_test/example_stub.pyi b/Lib/idlelib/idle_test/example_stub.pyi
index a9811a7..17b5801 100644
--- a/Lib/idlelib/idle_test/example_stub.pyi
+++ b/Lib/idlelib/idle_test/example_stub.pyi
@@ -1,2 +1,4 @@
+" Example to test recognition of .pyi file as Python source code.
+
class Example:
def method(self, argument1: str, argument2: list[int]) -> None: ...
diff --git a/Lib/idlelib/util.py b/Lib/idlelib/util.py
index 5ac69a7..a7ae74b 100644
--- a/Lib/idlelib/util.py
+++ b/Lib/idlelib/util.py
@@ -13,9 +13,9 @@ TODO:
* warning stuff (pyshell, run).
"""
-# .pyw is for Windows; .pyi is for stub files.
-py_extensions = ('.py', '.pyw', '.pyi') # Order needed for open/save dialogs.
-
+# .pyw is for Windows; .pyi is for typing stub files.
+# The extension order is needed for iomenu open/save dialogs.
+py_extensions = ('.py', '.pyw', '.pyi')
if __name__ == '__main__':
from unittest import main