Commit Graph

30 Commits

Author SHA1 Message Date
Akuli
7d1abc962d fix master attributes (#4468) 2020-08-20 11:55:49 +02:00
Akuli
6a06ff53f0 make canvas offset option optional (#4458) 2020-08-18 16:50:09 +02:00
Rebecca Chen
61537be530 Upgrade the pytype version to one that can parse the tkinter stubs. (#4456)
The latest pytype release fixes two pyi parser bugs that allow files
affected by them to be taken off the pytype exclude list. I removed two
`total=False` declarations in tkinter/__init__ that pytype does not like
(because it checks that `total` is present only when TypedDict is a
class's immediate parent) and which shouldn't be needed because
_InMiscNonTotal already specifies totality. I double-checked that mypy
reports no errors in 3.7 on a .py file containing:

  from typing_extensions import TypedDict
  Foo = TypedDict('Foo', {'x': int}, total=False)
  class Bar(Foo): pass
  x: Foo = {}

showing that it doesn't require `total` to be repeated.
2020-08-17 19:49:58 -07:00
Akuli
e9ecea0033 Add options to tkinter widgets (#4363)
In tkinter, `widget['foo'] = bar` and `widget.config(foo=bar)` do the same thing, but they will now type-check differently: the `widget['foo'] = bar` syntax allows 'foo' to be any string (e.g. a variable, not necessarily a Literal) and bar to be any object, while `widget.config(foo=bar)` checks the existence of the option and the type of bar. Similarly, cget takes a Literal argument but __getitem__ takes a string. 

Testing script can still be found at c42a72c53e
2020-08-17 13:59:51 -07:00
Akuli
e1c4d2a713 more permissive type for tkinter fonts (#4453) 2020-08-17 15:52:16 +02:00
Akuli
0ebe4c2b65 fix eval and call return types (#4451) 2020-08-16 12:30:04 -07:00
Akuli
954ce8c703 create _tkinter stub (#4372) 2020-08-08 14:14:52 +02:00
Eric Traut
04c74640f0 Removed imported symbols that are not accessed or re-exported (#4387)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-05 22:49:17 -07:00
Akuli
8bf7efe94e add types for tkinter geometry manager (aka pack,grid,place) methods (#4379) 2020-07-31 14:34:47 +02:00
Akuli
09c91a00ac add type hints for tkinter.Variable and its subclasses (#4378) 2020-07-31 10:53:57 +02:00
Akuli
2c37551fd1 make tkinter.Event generic and add missing type hints to bind methods (#4347) 2020-07-25 14:23:26 +02:00
Akuli
9efc9d8818 add tkinter.font stub (#4350) 2020-07-22 11:46:04 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Shantanu
72c8907760 tkinter: fix version availability (#4207)
Co-authored-by: hauntsaninja <>
2020-06-09 12:20:48 +02:00
Christopher Head
51267a4b12 Add tkinter Event class (#4200) 2020-06-08 12:46:16 -07:00
Christopher Head
5b36051f77 tkinter: fix variable parameter to wait_variable (#4194)
The tkinter `wait_variable` function can be called with either the name
of a variable (a `str`) or an actual variable object (a `Variable`).
2020-06-06 14:41:42 -07:00
petsuter
95002966ec Annotations for Py3.6 tkinter additions (#3778) (#3797)
* Add tkinter.Variable.trace_add()
* Add tkinter.Variable.trace_remove()
* Add tkinter.Variable.trace_info()
https://docs.python.org/3.6/whatsnew/3.6.html#tkinter
2020-03-01 08:53:01 -08:00
Sebastian Rittau
0501e2b329 Annotations for remaining Python 3.8 additions (#3358)
* Add os.add_dll_directory()
* Add memfd_create() and flags
* Add type annotation to flags
* Add stat_result.st_reparse_tag and flags
* Add ncurses_version
* Add Path.link_to()
* Add Picker.reducer_override()
* Add plistlib.UID
* Add has_dualstack_ipv6() and create_server()
* Add shlex.join()
* Add SSL methods and fields
* Add Python 3.8 statistics functions and classes
* Remove obsolete sys.subversion
* Add sys.unraisablehook
* Add threading.excepthook
* Add get_native_id() and Thread.native_id
* Add Python 3.8 tkinter methods
* Add CLOCK_UPTIME_RAW
* Add SupportsIndex
* Add typing.get_origin() and get_args()
* Add unicodedata.is_normalized
* Add unittest.mock.AsyncMock

Currently this is just an alias for Any like Mock and MagicMock. All of
these classes should probably be sub-classing Any and add their own
methods. See also #3224.

* Add unittest cleanup methods
* Add IsolatedAsyncioTestCase
* Add ElementTree.canonicalize() and C14NWriterTarget
* cProfile.Profile can be used as a context manager
* Add asyncio task name handling
* mmap.flush() now always returns None
* Add posonlyargcount to CodeType
2019-10-14 09:53:48 +02:00
Sebastian Rittau
6507875f28 Annotate Python 3.8 removals (#3359)
* macpath
* time.clock()
* Some cgi functions
* XMLParser(html) and doctype()
* unicode_internal
* Two sqlite3 classes hidden
* fileinput bufsize arg
* Treeview.selection no longer takes arguments
2019-10-14 09:51:39 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Sebastian Rittau
cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00
Sebastian Rittau
2d3edbd348 Slightly improve annotation of tkinter.Tk (#2498)
Closes: #1767
2018-10-01 20:15:22 -07:00
Stanislav Syekirin
4e1cc807aa adding a stub for tkinter.messagebox (#2113) 2018-05-13 08:36:11 -04:00
Zabolekar
5ddff9c44a Add a stub for tkinter.filedialog and for the modules it imports (#2058) 2018-04-25 19:44:42 -07:00
Jelle Zijlstra
7cfbc7d17f more 3.7 features (#2015) 2018-04-06 11:09:11 -07:00
Martin DeMello
d389ef3d85 Remove a few files from the pytype blacklist. (#1628)
Fixes the following issues:

* Literals rather than ... for default values
* None rather than ... for default value of typed variable
* Literals rather than ... # type for top level constants
* # Foo rather than # type: Foo
* return value of init not set to None
2017-09-27 07:57:13 -07:00
Emily Morehouse
b6d08b81a3 #1286 Remove header comments from stubs (#1292)
- Updates documentation related to previously required comment headers.
- Removes all comment headers from stubs
- Occasionally included a header for stubs that were noted to be incomplete or contained todo's.
2017-05-22 15:14:15 -07:00
Lukasz Langa
82b2d8e3bc Fixing flake8 F403, F405 errors 2016-12-20 02:28:12 -08:00
Lukasz Langa
fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Tim Simpson
80a37f3f93 Initial stubs for tkinter (#242)
This is the stubgen output for tkinter, tkinter.constants and tkinter.ttk, with only a few manual fixes (#1603).
2016-06-02 10:16:01 -07:00