-
-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Also add .pyi to the python extensions in the "File-open" and "File-save" dialogues. Add util.py to contain objects that are used in multiple idlelib modules and have no dependencies on any of them. Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
- Loading branch information
1 parent
b70690b
commit 50cf499
Showing
11 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!usr/bin/env python | ||
|
||
def example_function(some_argument): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Example: | ||
def method(self, argument1: str, argument2: list[int]) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Test util, coverage 100%""" | ||
|
||
import unittest | ||
from idlelib import util | ||
|
||
|
||
class UtilTest(unittest.TestCase): | ||
def test_extensions(self): | ||
for extension in {'.pyi', '.py', '.pyw'}: | ||
self.assertIn(extension, util.py_extensions) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(verbosity=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Idlelib objects with no external idlelib dependencies | ||
which are needed in more than one idlelib module. | ||
They are included here because | ||
a) they don't particularly belong elsewhere; or | ||
b) because inclusion here simplifies the idlelib dependency graph. | ||
TODO: | ||
* Python versions (editor and help_about), | ||
* tk version and patchlevel (pyshell, help_about, maxos?, editor?), | ||
* std streams (pyshell, run), | ||
* warning stuff (pyshell, run). | ||
""" | ||
from os import path | ||
|
||
# .pyw is for Windows; .pyi is for stub files. | ||
py_extensions = ('.py', '.pyw', '.pyi') # Order needed for open/save dialogs. | ||
|
||
if __name__ == '__main__': | ||
from unittest import main | ||
main('idlelib.idle_test.test_util', verbosity=2) |
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/IDLE/2021-10-14-16-55-03.bpo-45447.FhiH5P.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Apply IDLE syntax highlighting to `.pyi` files. Patch by Alex Waygood | ||
and Terry Jan Reedy. |