mypy-dev 1.9.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1018) hide show
  1. mypy/__init__.py +1 -0
  2. mypy/__main__.py +37 -0
  3. mypy/api.py +94 -0
  4. mypy/applytype.py +156 -0
  5. mypy/argmap.py +268 -0
  6. mypy/binder.py +538 -0
  7. mypy/bogus_type.py +27 -0
  8. mypy/build.py +3562 -0
  9. mypy/checker.py +8372 -0
  10. mypy/checkexpr.py +6615 -0
  11. mypy/checkmember.py +1356 -0
  12. mypy/checkpattern.py +801 -0
  13. mypy/checkstrformat.py +1109 -0
  14. mypy/config_parser.py +670 -0
  15. mypy/constant_fold.py +187 -0
  16. mypy/constraints.py +1624 -0
  17. mypy/copytype.py +133 -0
  18. mypy/defaults.py +46 -0
  19. mypy/dmypy/__init__.py +0 -0
  20. mypy/dmypy/__main__.py +6 -0
  21. mypy/dmypy/client.py +749 -0
  22. mypy/dmypy_os.py +42 -0
  23. mypy/dmypy_server.py +1107 -0
  24. mypy/dmypy_util.py +117 -0
  25. mypy/erasetype.py +278 -0
  26. mypy/errorcodes.py +285 -0
  27. mypy/errors.py +1280 -0
  28. mypy/evalexpr.py +205 -0
  29. mypy/expandtype.py +510 -0
  30. mypy/exprtotype.py +206 -0
  31. mypy/fastparse.py +2147 -0
  32. mypy/find_sources.py +243 -0
  33. mypy/fixup.py +426 -0
  34. mypy/freetree.py +23 -0
  35. mypy/fscache.py +309 -0
  36. mypy/fswatcher.py +106 -0
  37. mypy/gclogger.py +47 -0
  38. mypy/git.py +34 -0
  39. mypy/graph_utils.py +112 -0
  40. mypy/indirection.py +121 -0
  41. mypy/infer.py +75 -0
  42. mypy/inspections.py +627 -0
  43. mypy/ipc.py +310 -0
  44. mypy/join.py +866 -0
  45. mypy/literals.py +306 -0
  46. mypy/lookup.py +61 -0
  47. mypy/main.py +1574 -0
  48. mypy/maptype.py +106 -0
  49. mypy/meet.py +1140 -0
  50. mypy/memprofile.py +121 -0
  51. mypy/message_registry.py +326 -0
  52. mypy/messages.py +3171 -0
  53. mypy/metastore.py +225 -0
  54. mypy/mixedtraverser.py +112 -0
  55. mypy/modulefinder.py +875 -0
  56. mypy/moduleinspect.py +184 -0
  57. mypy/mro.py +62 -0
  58. mypy/nodes.py +4112 -0
  59. mypy/operators.py +126 -0
  60. mypy/options.py +556 -0
  61. mypy/parse.py +30 -0
  62. mypy/partially_defined.py +675 -0
  63. mypy/patterns.py +150 -0
  64. mypy/plugin.py +901 -0
  65. mypy/plugins/__init__.py +0 -0
  66. mypy/plugins/attrs.py +1152 -0
  67. mypy/plugins/common.py +440 -0
  68. mypy/plugins/ctypes.py +245 -0
  69. mypy/plugins/dataclasses.py +1101 -0
  70. mypy/plugins/default.py +518 -0
  71. mypy/plugins/enums.py +259 -0
  72. mypy/plugins/functools.py +104 -0
  73. mypy/plugins/proper_plugin.py +175 -0
  74. mypy/plugins/singledispatch.py +224 -0
  75. mypy/py.typed +1 -0
  76. mypy/pyinfo.py +78 -0
  77. mypy/reachability.py +362 -0
  78. mypy/refinfo.py +92 -0
  79. mypy/renaming.py +568 -0
  80. mypy/report.py +924 -0
  81. mypy/scope.py +125 -0
  82. mypy/semanal.py +7023 -0
  83. mypy/semanal_classprop.py +187 -0
  84. mypy/semanal_enum.py +253 -0
  85. mypy/semanal_infer.py +128 -0
  86. mypy/semanal_main.py +511 -0
  87. mypy/semanal_namedtuple.py +670 -0
  88. mypy/semanal_newtype.py +273 -0
  89. mypy/semanal_pass1.py +156 -0
  90. mypy/semanal_shared.py +490 -0
  91. mypy/semanal_typeargs.py +265 -0
  92. mypy/semanal_typeddict.py +575 -0
  93. mypy/server/__init__.py +0 -0
  94. mypy/server/astdiff.py +518 -0
  95. mypy/server/astmerge.py +562 -0
  96. mypy/server/aststrip.py +281 -0
  97. mypy/server/deps.py +1137 -0
  98. mypy/server/mergecheck.py +83 -0
  99. mypy/server/objgraph.py +101 -0
  100. mypy/server/subexpr.py +198 -0
  101. mypy/server/target.py +11 -0
  102. mypy/server/trigger.py +26 -0
  103. mypy/server/update.py +1339 -0
  104. mypy/sharedparse.py +112 -0
  105. mypy/solve.py +562 -0
  106. mypy/split_namespace.py +35 -0
  107. mypy/state.py +28 -0
  108. mypy/stats.py +489 -0
  109. mypy/strconv.py +641 -0
  110. mypy/stubdoc.py +491 -0
  111. mypy/stubgen.py +1873 -0
  112. mypy/stubgenc.py +993 -0
  113. mypy/stubinfo.py +173 -0
  114. mypy/stubtest.py +2079 -0
  115. mypy/stubutil.py +807 -0
  116. mypy/subtypes.py +1967 -0
  117. mypy/suggestions.py +1046 -0
  118. mypy/test/__init__.py +0 -0
  119. mypy/test/config.py +28 -0
  120. mypy/test/data.py +823 -0
  121. mypy/test/helpers.py +476 -0
  122. mypy/test/meta/__init__.py +0 -0
  123. mypy/test/meta/_pytest.py +72 -0
  124. mypy/test/meta/test_diff_helper.py +47 -0
  125. mypy/test/meta/test_parse_data.py +73 -0
  126. mypy/test/meta/test_update_data.py +135 -0
  127. mypy/test/test_find_sources.py +376 -0
  128. mypy/test/test_ref_info.py +45 -0
  129. mypy/test/testapi.py +45 -0
  130. mypy/test/testargs.py +77 -0
  131. mypy/test/testcheck.py +322 -0
  132. mypy/test/testcmdline.py +152 -0
  133. mypy/test/testconstraints.py +134 -0
  134. mypy/test/testdaemon.py +132 -0
  135. mypy/test/testdeps.py +77 -0
  136. mypy/test/testdiff.py +67 -0
  137. mypy/test/testerrorstream.py +46 -0
  138. mypy/test/testfinegrained.py +438 -0
  139. mypy/test/testfinegrainedcache.py +18 -0
  140. mypy/test/testformatter.py +85 -0
  141. mypy/test/testfscache.py +101 -0
  142. mypy/test/testgraph.py +83 -0
  143. mypy/test/testinfer.py +373 -0
  144. mypy/test/testipc.py +119 -0
  145. mypy/test/testmerge.py +238 -0
  146. mypy/test/testmodulefinder.py +278 -0
  147. mypy/test/testmypyc.py +14 -0
  148. mypy/test/testparse.py +107 -0
  149. mypy/test/testpep561.py +211 -0
  150. mypy/test/testpythoneval.py +117 -0
  151. mypy/test/testreports.py +55 -0
  152. mypy/test/testsemanal.py +209 -0
  153. mypy/test/testsolve.py +285 -0
  154. mypy/test/teststubgen.py +1412 -0
  155. mypy/test/teststubinfo.py +12 -0
  156. mypy/test/teststubtest.py +2492 -0
  157. mypy/test/testsubtypes.py +303 -0
  158. mypy/test/testtransform.py +64 -0
  159. mypy/test/testtypegen.py +83 -0
  160. mypy/test/testtypes.py +1551 -0
  161. mypy/test/testutil.py +111 -0
  162. mypy/test/typefixture.py +415 -0
  163. mypy/test/update_data.py +87 -0
  164. mypy/test/visitors.py +63 -0
  165. mypy/traverser.py +961 -0
  166. mypy/treetransform.py +800 -0
  167. mypy/tvar_scope.py +147 -0
  168. mypy/type_visitor.py +564 -0
  169. mypy/typeanal.py +2510 -0
  170. mypy/typeops.py +1082 -0
  171. mypy/types.py +3686 -0
  172. mypy/types_utils.py +166 -0
  173. mypy/typeshed/LICENSE +237 -0
  174. mypy/typeshed/stdlib/VERSIONS +308 -0
  175. mypy/typeshed/stdlib/__future__.pyi +36 -0
  176. mypy/typeshed/stdlib/__main__.pyi +3 -0
  177. mypy/typeshed/stdlib/_ast.pyi +587 -0
  178. mypy/typeshed/stdlib/_bisect.pyi +84 -0
  179. mypy/typeshed/stdlib/_bootlocale.pyi +1 -0
  180. mypy/typeshed/stdlib/_codecs.pyi +133 -0
  181. mypy/typeshed/stdlib/_collections_abc.pyi +94 -0
  182. mypy/typeshed/stdlib/_compat_pickle.pyi +8 -0
  183. mypy/typeshed/stdlib/_compression.pyi +25 -0
  184. mypy/typeshed/stdlib/_csv.pyi +90 -0
  185. mypy/typeshed/stdlib/_ctypes.pyi +205 -0
  186. mypy/typeshed/stdlib/_curses.pyi +557 -0
  187. mypy/typeshed/stdlib/_decimal.pyi +281 -0
  188. mypy/typeshed/stdlib/_dummy_thread.pyi +27 -0
  189. mypy/typeshed/stdlib/_dummy_threading.pyi +164 -0
  190. mypy/typeshed/stdlib/_heapq.pyi +11 -0
  191. mypy/typeshed/stdlib/_imp.pyi +28 -0
  192. mypy/typeshed/stdlib/_json.pyi +49 -0
  193. mypy/typeshed/stdlib/_locale.pyi +100 -0
  194. mypy/typeshed/stdlib/_markupbase.pyi +16 -0
  195. mypy/typeshed/stdlib/_msi.pyi +91 -0
  196. mypy/typeshed/stdlib/_operator.pyi +147 -0
  197. mypy/typeshed/stdlib/_osx_support.pyi +34 -0
  198. mypy/typeshed/stdlib/_posixsubprocess.pyi +32 -0
  199. mypy/typeshed/stdlib/_py_abc.pyi +14 -0
  200. mypy/typeshed/stdlib/_pydecimal.pyi +43 -0
  201. mypy/typeshed/stdlib/_random.pyi +12 -0
  202. mypy/typeshed/stdlib/_sitebuiltins.pyi +16 -0
  203. mypy/typeshed/stdlib/_socket.pyi +802 -0
  204. mypy/typeshed/stdlib/_stat.pyi +103 -0
  205. mypy/typeshed/stdlib/_thread.pyi +52 -0
  206. mypy/typeshed/stdlib/_threading_local.pyi +17 -0
  207. mypy/typeshed/stdlib/_tkinter.pyi +120 -0
  208. mypy/typeshed/stdlib/_tracemalloc.pyi +17 -0
  209. mypy/typeshed/stdlib/_typeshed/__init__.pyi +347 -0
  210. mypy/typeshed/stdlib/_typeshed/dbapi.pyi +37 -0
  211. mypy/typeshed/stdlib/_typeshed/wsgi.pyi +44 -0
  212. mypy/typeshed/stdlib/_typeshed/xml.pyi +9 -0
  213. mypy/typeshed/stdlib/_warnings.pyi +55 -0
  214. mypy/typeshed/stdlib/_weakref.pyi +41 -0
  215. mypy/typeshed/stdlib/_weakrefset.pyi +51 -0
  216. mypy/typeshed/stdlib/_winapi.pyi +251 -0
  217. mypy/typeshed/stdlib/abc.pyi +49 -0
  218. mypy/typeshed/stdlib/aifc.pyi +91 -0
  219. mypy/typeshed/stdlib/antigravity.pyi +3 -0
  220. mypy/typeshed/stdlib/argparse.pyi +571 -0
  221. mypy/typeshed/stdlib/array.pyi +92 -0
  222. mypy/typeshed/stdlib/ast.pyi +277 -0
  223. mypy/typeshed/stdlib/asynchat.pyi +21 -0
  224. mypy/typeshed/stdlib/asyncio/__init__.pyi +41 -0
  225. mypy/typeshed/stdlib/asyncio/base_events.pyi +440 -0
  226. mypy/typeshed/stdlib/asyncio/base_futures.pyi +19 -0
  227. mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +63 -0
  228. mypy/typeshed/stdlib/asyncio/base_tasks.pyi +9 -0
  229. mypy/typeshed/stdlib/asyncio/constants.pyi +20 -0
  230. mypy/typeshed/stdlib/asyncio/coroutines.pyi +26 -0
  231. mypy/typeshed/stdlib/asyncio/events.pyi +574 -0
  232. mypy/typeshed/stdlib/asyncio/exceptions.pyi +43 -0
  233. mypy/typeshed/stdlib/asyncio/format_helpers.pyi +20 -0
  234. mypy/typeshed/stdlib/asyncio/futures.pyi +57 -0
  235. mypy/typeshed/stdlib/asyncio/locks.pyi +121 -0
  236. mypy/typeshed/stdlib/asyncio/log.pyi +3 -0
  237. mypy/typeshed/stdlib/asyncio/mixins.pyi +9 -0
  238. mypy/typeshed/stdlib/asyncio/proactor_events.pyi +64 -0
  239. mypy/typeshed/stdlib/asyncio/protocols.pyi +34 -0
  240. mypy/typeshed/stdlib/asyncio/queues.pyi +47 -0
  241. mypy/typeshed/stdlib/asyncio/runners.pyi +32 -0
  242. mypy/typeshed/stdlib/asyncio/selector_events.pyi +8 -0
  243. mypy/typeshed/stdlib/asyncio/sslproto.pyi +163 -0
  244. mypy/typeshed/stdlib/asyncio/staggered.pyi +10 -0
  245. mypy/typeshed/stdlib/asyncio/streams.pyi +148 -0
  246. mypy/typeshed/stdlib/asyncio/subprocess.pyi +229 -0
  247. mypy/typeshed/stdlib/asyncio/taskgroups.pyi +25 -0
  248. mypy/typeshed/stdlib/asyncio/tasks.pyi +477 -0
  249. mypy/typeshed/stdlib/asyncio/threads.pyi +9 -0
  250. mypy/typeshed/stdlib/asyncio/timeouts.pyi +19 -0
  251. mypy/typeshed/stdlib/asyncio/transports.pyi +47 -0
  252. mypy/typeshed/stdlib/asyncio/trsock.pyi +98 -0
  253. mypy/typeshed/stdlib/asyncio/unix_events.pyi +173 -0
  254. mypy/typeshed/stdlib/asyncio/windows_events.pyi +83 -0
  255. mypy/typeshed/stdlib/asyncio/windows_utils.pyi +49 -0
  256. mypy/typeshed/stdlib/asyncore.pyi +90 -0
  257. mypy/typeshed/stdlib/atexit.pyi +12 -0
  258. mypy/typeshed/stdlib/audioop.pyi +42 -0
  259. mypy/typeshed/stdlib/base64.pyi +59 -0
  260. mypy/typeshed/stdlib/bdb.pyi +102 -0
  261. mypy/typeshed/stdlib/binascii.pyi +36 -0
  262. mypy/typeshed/stdlib/binhex.pyi +45 -0
  263. mypy/typeshed/stdlib/bisect.pyi +4 -0
  264. mypy/typeshed/stdlib/builtins.pyi +1937 -0
  265. mypy/typeshed/stdlib/bz2.pyi +146 -0
  266. mypy/typeshed/stdlib/cProfile.pyi +35 -0
  267. mypy/typeshed/stdlib/calendar.pyi +206 -0
  268. mypy/typeshed/stdlib/cgi.pyi +118 -0
  269. mypy/typeshed/stdlib/cgitb.pyi +32 -0
  270. mypy/typeshed/stdlib/chunk.pyi +20 -0
  271. mypy/typeshed/stdlib/cmath.pyi +36 -0
  272. mypy/typeshed/stdlib/cmd.pyi +45 -0
  273. mypy/typeshed/stdlib/code.pyi +33 -0
  274. mypy/typeshed/stdlib/codecs.pyi +285 -0
  275. mypy/typeshed/stdlib/codeop.pyi +13 -0
  276. mypy/typeshed/stdlib/collections/__init__.pyi +477 -0
  277. mypy/typeshed/stdlib/collections/abc.pyi +2 -0
  278. mypy/typeshed/stdlib/colorsys.pyi +13 -0
  279. mypy/typeshed/stdlib/compileall.pyi +111 -0
  280. mypy/typeshed/stdlib/concurrent/__init__.pyi +0 -0
  281. mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +32 -0
  282. mypy/typeshed/stdlib/concurrent/futures/_base.pyi +120 -0
  283. mypy/typeshed/stdlib/concurrent/futures/process.pyi +233 -0
  284. mypy/typeshed/stdlib/concurrent/futures/thread.pyi +80 -0
  285. mypy/typeshed/stdlib/configparser.pyi +313 -0
  286. mypy/typeshed/stdlib/contextlib.pyi +207 -0
  287. mypy/typeshed/stdlib/contextvars.pyi +63 -0
  288. mypy/typeshed/stdlib/copy.pyi +16 -0
  289. mypy/typeshed/stdlib/copyreg.pyi +21 -0
  290. mypy/typeshed/stdlib/crypt.pyi +12 -0
  291. mypy/typeshed/stdlib/csv.pyi +147 -0
  292. mypy/typeshed/stdlib/ctypes/__init__.pyi +187 -0
  293. mypy/typeshed/stdlib/ctypes/_endian.pyi +19 -0
  294. mypy/typeshed/stdlib/ctypes/util.pyi +6 -0
  295. mypy/typeshed/stdlib/ctypes/wintypes.pyi +298 -0
  296. mypy/typeshed/stdlib/curses/__init__.pyi +21 -0
  297. mypy/typeshed/stdlib/curses/ascii.pyi +63 -0
  298. mypy/typeshed/stdlib/curses/has_key.pyi +4 -0
  299. mypy/typeshed/stdlib/curses/panel.pyi +25 -0
  300. mypy/typeshed/stdlib/curses/textpad.pyi +13 -0
  301. mypy/typeshed/stdlib/dataclasses.pyi +313 -0
  302. mypy/typeshed/stdlib/datetime.pyi +295 -0
  303. mypy/typeshed/stdlib/dbm/__init__.pyi +95 -0
  304. mypy/typeshed/stdlib/dbm/dumb.pyi +31 -0
  305. mypy/typeshed/stdlib/dbm/gnu.pyi +40 -0
  306. mypy/typeshed/stdlib/dbm/ndbm.pyi +36 -0
  307. mypy/typeshed/stdlib/decimal.pyi +2 -0
  308. mypy/typeshed/stdlib/difflib.pyi +140 -0
  309. mypy/typeshed/stdlib/dis.pyi +144 -0
  310. mypy/typeshed/stdlib/distutils/__init__.pyi +5 -0
  311. mypy/typeshed/stdlib/distutils/archive_util.pyi +20 -0
  312. mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +3 -0
  313. mypy/typeshed/stdlib/distutils/ccompiler.pyi +152 -0
  314. mypy/typeshed/stdlib/distutils/cmd.pyi +66 -0
  315. mypy/typeshed/stdlib/distutils/command/__init__.pyi +0 -0
  316. mypy/typeshed/stdlib/distutils/command/bdist.pyi +25 -0
  317. mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +21 -0
  318. mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +45 -0
  319. mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +0 -0
  320. mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +52 -0
  321. mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +16 -0
  322. mypy/typeshed/stdlib/distutils/command/build.pyi +31 -0
  323. mypy/typeshed/stdlib/distutils/command/build_clib.pyi +27 -0
  324. mypy/typeshed/stdlib/distutils/command/build_ext.pyi +50 -0
  325. mypy/typeshed/stdlib/distutils/command/build_py.pyi +44 -0
  326. mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +24 -0
  327. mypy/typeshed/stdlib/distutils/command/check.pyi +39 -0
  328. mypy/typeshed/stdlib/distutils/command/clean.pyi +17 -0
  329. mypy/typeshed/stdlib/distutils/command/config.pyi +83 -0
  330. mypy/typeshed/stdlib/distutils/command/install.pyi +63 -0
  331. mypy/typeshed/stdlib/distutils/command/install_data.pyi +19 -0
  332. mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +18 -0
  333. mypy/typeshed/stdlib/distutils/command/install_headers.pyi +16 -0
  334. mypy/typeshed/stdlib/distutils/command/install_lib.pyi +25 -0
  335. mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +18 -0
  336. mypy/typeshed/stdlib/distutils/command/register.pyi +18 -0
  337. mypy/typeshed/stdlib/distutils/command/sdist.pyi +42 -0
  338. mypy/typeshed/stdlib/distutils/command/upload.pyi +17 -0
  339. mypy/typeshed/stdlib/distutils/config.pyi +17 -0
  340. mypy/typeshed/stdlib/distutils/core.pyi +57 -0
  341. mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +20 -0
  342. mypy/typeshed/stdlib/distutils/debug.pyi +1 -0
  343. mypy/typeshed/stdlib/distutils/dep_util.pyi +3 -0
  344. mypy/typeshed/stdlib/distutils/dir_util.pyi +13 -0
  345. mypy/typeshed/stdlib/distutils/dist.pyi +146 -0
  346. mypy/typeshed/stdlib/distutils/errors.pyi +19 -0
  347. mypy/typeshed/stdlib/distutils/extension.pyi +36 -0
  348. mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +34 -0
  349. mypy/typeshed/stdlib/distutils/file_util.pyi +14 -0
  350. mypy/typeshed/stdlib/distutils/filelist.pyi +50 -0
  351. mypy/typeshed/stdlib/distutils/log.pyi +25 -0
  352. mypy/typeshed/stdlib/distutils/msvccompiler.pyi +3 -0
  353. mypy/typeshed/stdlib/distutils/spawn.pyi +2 -0
  354. mypy/typeshed/stdlib/distutils/sysconfig.pyi +22 -0
  355. mypy/typeshed/stdlib/distutils/text_file.pyi +21 -0
  356. mypy/typeshed/stdlib/distutils/unixccompiler.pyi +3 -0
  357. mypy/typeshed/stdlib/distutils/util.pyi +46 -0
  358. mypy/typeshed/stdlib/distutils/version.pyi +36 -0
  359. mypy/typeshed/stdlib/doctest.pyi +248 -0
  360. mypy/typeshed/stdlib/dummy_threading.pyi +2 -0
  361. mypy/typeshed/stdlib/email/__init__.pyi +29 -0
  362. mypy/typeshed/stdlib/email/_header_value_parser.pyi +392 -0
  363. mypy/typeshed/stdlib/email/_policybase.pyi +51 -0
  364. mypy/typeshed/stdlib/email/base64mime.pyi +13 -0
  365. mypy/typeshed/stdlib/email/charset.pyi +34 -0
  366. mypy/typeshed/stdlib/email/contentmanager.pyi +11 -0
  367. mypy/typeshed/stdlib/email/encoders.pyi +8 -0
  368. mypy/typeshed/stdlib/email/errors.pyi +39 -0
  369. mypy/typeshed/stdlib/email/feedparser.pyi +23 -0
  370. mypy/typeshed/stdlib/email/generator.pyi +40 -0
  371. mypy/typeshed/stdlib/email/header.pyi +31 -0
  372. mypy/typeshed/stdlib/email/headerregistry.pyi +178 -0
  373. mypy/typeshed/stdlib/email/iterators.pyi +12 -0
  374. mypy/typeshed/stdlib/email/message.pyi +161 -0
  375. mypy/typeshed/stdlib/email/mime/__init__.pyi +0 -0
  376. mypy/typeshed/stdlib/email/mime/application.pyi +17 -0
  377. mypy/typeshed/stdlib/email/mime/audio.pyi +17 -0
  378. mypy/typeshed/stdlib/email/mime/base.pyi +8 -0
  379. mypy/typeshed/stdlib/email/mime/image.pyi +17 -0
  380. mypy/typeshed/stdlib/email/mime/message.pyi +8 -0
  381. mypy/typeshed/stdlib/email/mime/multipart.pyi +18 -0
  382. mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +5 -0
  383. mypy/typeshed/stdlib/email/mime/text.pyi +9 -0
  384. mypy/typeshed/stdlib/email/parser.pyi +26 -0
  385. mypy/typeshed/stdlib/email/policy.pyi +38 -0
  386. mypy/typeshed/stdlib/email/quoprimime.pyi +28 -0
  387. mypy/typeshed/stdlib/email/utils.pyi +66 -0
  388. mypy/typeshed/stdlib/encodings/__init__.pyi +10 -0
  389. mypy/typeshed/stdlib/encodings/utf_8.pyi +21 -0
  390. mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +22 -0
  391. mypy/typeshed/stdlib/ensurepip/__init__.pyi +12 -0
  392. mypy/typeshed/stdlib/enum.pyi +317 -0
  393. mypy/typeshed/stdlib/errno.pyi +222 -0
  394. mypy/typeshed/stdlib/faulthandler.pyi +13 -0
  395. mypy/typeshed/stdlib/fcntl.pyi +127 -0
  396. mypy/typeshed/stdlib/filecmp.pyi +57 -0
  397. mypy/typeshed/stdlib/fileinput.pyi +213 -0
  398. mypy/typeshed/stdlib/fnmatch.pyi +9 -0
  399. mypy/typeshed/stdlib/formatter.pyi +88 -0
  400. mypy/typeshed/stdlib/fractions.pyi +150 -0
  401. mypy/typeshed/stdlib/ftplib.pyi +178 -0
  402. mypy/typeshed/stdlib/functools.pyi +200 -0
  403. mypy/typeshed/stdlib/gc.pyi +37 -0
  404. mypy/typeshed/stdlib/genericpath.pyi +52 -0
  405. mypy/typeshed/stdlib/getopt.pyi +11 -0
  406. mypy/typeshed/stdlib/getpass.pyi +8 -0
  407. mypy/typeshed/stdlib/gettext.pyi +169 -0
  408. mypy/typeshed/stdlib/glob.pyi +42 -0
  409. mypy/typeshed/stdlib/graphlib.pyi +28 -0
  410. mypy/typeshed/stdlib/grp.pyi +21 -0
  411. mypy/typeshed/stdlib/gzip.pyi +160 -0
  412. mypy/typeshed/stdlib/hashlib.pyi +165 -0
  413. mypy/typeshed/stdlib/heapq.pyi +17 -0
  414. mypy/typeshed/stdlib/hmac.pyi +38 -0
  415. mypy/typeshed/stdlib/html/__init__.pyi +6 -0
  416. mypy/typeshed/stdlib/html/entities.pyi +6 -0
  417. mypy/typeshed/stdlib/html/parser.pyi +34 -0
  418. mypy/typeshed/stdlib/http/__init__.pyi +105 -0
  419. mypy/typeshed/stdlib/http/client.pyi +259 -0
  420. mypy/typeshed/stdlib/http/cookiejar.pyi +159 -0
  421. mypy/typeshed/stdlib/http/cookies.pyi +60 -0
  422. mypy/typeshed/stdlib/http/server.pyi +83 -0
  423. mypy/typeshed/stdlib/imaplib.pyi +168 -0
  424. mypy/typeshed/stdlib/imghdr.pyi +17 -0
  425. mypy/typeshed/stdlib/imp.pyi +62 -0
  426. mypy/typeshed/stdlib/importlib/__init__.pyi +24 -0
  427. mypy/typeshed/stdlib/importlib/_abc.pyi +15 -0
  428. mypy/typeshed/stdlib/importlib/abc.pyi +172 -0
  429. mypy/typeshed/stdlib/importlib/machinery.pyi +179 -0
  430. mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +276 -0
  431. mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +40 -0
  432. mypy/typeshed/stdlib/importlib/readers.pyi +68 -0
  433. mypy/typeshed/stdlib/importlib/resources/__init__.pyi +46 -0
  434. mypy/typeshed/stdlib/importlib/resources/abc.pyi +12 -0
  435. mypy/typeshed/stdlib/importlib/resources/readers.pyi +14 -0
  436. mypy/typeshed/stdlib/importlib/resources/simple.pyi +49 -0
  437. mypy/typeshed/stdlib/importlib/simple.pyi +11 -0
  438. mypy/typeshed/stdlib/importlib/util.pyi +43 -0
  439. mypy/typeshed/stdlib/inspect.pyi +631 -0
  440. mypy/typeshed/stdlib/io.pyi +204 -0
  441. mypy/typeshed/stdlib/ipaddress.pyi +208 -0
  442. mypy/typeshed/stdlib/itertools.pyi +293 -0
  443. mypy/typeshed/stdlib/json/__init__.pyi +61 -0
  444. mypy/typeshed/stdlib/json/decoder.pyi +32 -0
  445. mypy/typeshed/stdlib/json/encoder.pyi +38 -0
  446. mypy/typeshed/stdlib/json/tool.pyi +1 -0
  447. mypy/typeshed/stdlib/keyword.pyi +21 -0
  448. mypy/typeshed/stdlib/lib2to3/__init__.pyi +0 -0
  449. mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +28 -0
  450. mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +42 -0
  451. mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +0 -0
  452. mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +8 -0
  453. mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -0
  454. mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -0
  455. mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -0
  456. mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +16 -0
  457. mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +14 -0
  458. mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +8 -0
  459. mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -0
  460. mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -0
  461. mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +9 -0
  462. mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -0
  463. mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +8 -0
  464. mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -0
  465. mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -0
  466. mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -0
  467. mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +16 -0
  468. mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +21 -0
  469. mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +6 -0
  470. mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +11 -0
  471. mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +9 -0
  472. mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -0
  473. mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -0
  474. mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -0
  475. mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +7 -0
  476. mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +9 -0
  477. mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -0
  478. mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -0
  479. mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +8 -0
  480. mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +19 -0
  481. mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -0
  482. mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -0
  483. mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +12 -0
  484. mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +8 -0
  485. mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +12 -0
  486. mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +8 -0
  487. mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -0
  488. mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -0
  489. mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +9 -0
  490. mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +17 -0
  491. mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +8 -0
  492. mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -0
  493. mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -0
  494. mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -0
  495. mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +8 -0
  496. mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +17 -0
  497. mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +8 -0
  498. mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -0
  499. mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -0
  500. mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -0
  501. mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -0
  502. mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -0
  503. mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +9 -0
  504. mypy/typeshed/stdlib/lib2to3/main.pyi +42 -0
  505. mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +9 -0
  506. mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +27 -0
  507. mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +24 -0
  508. mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +7 -0
  509. mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +30 -0
  510. mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +50 -0
  511. mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +67 -0
  512. mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +96 -0
  513. mypy/typeshed/stdlib/lib2to3/pygram.pyi +114 -0
  514. mypy/typeshed/stdlib/lib2to3/pytree.pyi +117 -0
  515. mypy/typeshed/stdlib/lib2to3/refactor.pyi +82 -0
  516. mypy/typeshed/stdlib/linecache.pyi +23 -0
  517. mypy/typeshed/stdlib/locale.pyi +152 -0
  518. mypy/typeshed/stdlib/logging/__init__.pyi +655 -0
  519. mypy/typeshed/stdlib/logging/config.pyi +134 -0
  520. mypy/typeshed/stdlib/logging/handlers.pyi +275 -0
  521. mypy/typeshed/stdlib/lzma.pyi +197 -0
  522. mypy/typeshed/stdlib/mailbox.pyi +256 -0
  523. mypy/typeshed/stdlib/mailcap.pyi +11 -0
  524. mypy/typeshed/stdlib/marshal.pyi +33 -0
  525. mypy/typeshed/stdlib/math.pyi +125 -0
  526. mypy/typeshed/stdlib/mimetypes.pyi +46 -0
  527. mypy/typeshed/stdlib/mmap.pyi +113 -0
  528. mypy/typeshed/stdlib/modulefinder.pyi +66 -0
  529. mypy/typeshed/stdlib/msilib/__init__.pyi +176 -0
  530. mypy/typeshed/stdlib/msilib/schema.pyi +94 -0
  531. mypy/typeshed/stdlib/msilib/sequence.pyi +13 -0
  532. mypy/typeshed/stdlib/msilib/text.pyi +7 -0
  533. mypy/typeshed/stdlib/msvcrt.pyi +32 -0
  534. mypy/typeshed/stdlib/multiprocessing/__init__.pyi +90 -0
  535. mypy/typeshed/stdlib/multiprocessing/connection.pyi +75 -0
  536. mypy/typeshed/stdlib/multiprocessing/context.pyi +187 -0
  537. mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +77 -0
  538. mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +39 -0
  539. mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +31 -0
  540. mypy/typeshed/stdlib/multiprocessing/heap.pyi +36 -0
  541. mypy/typeshed/stdlib/multiprocessing/managers.pyi +212 -0
  542. mypy/typeshed/stdlib/multiprocessing/pool.pyi +103 -0
  543. mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +23 -0
  544. mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +16 -0
  545. mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +20 -0
  546. mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -0
  547. mypy/typeshed/stdlib/multiprocessing/process.pyi +39 -0
  548. mypy/typeshed/stdlib/multiprocessing/queues.pyi +41 -0
  549. mypy/typeshed/stdlib/multiprocessing/reduction.pyi +89 -0
  550. mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +20 -0
  551. mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +18 -0
  552. mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +40 -0
  553. mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +101 -0
  554. mypy/typeshed/stdlib/multiprocessing/spawn.pyi +32 -0
  555. mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +54 -0
  556. mypy/typeshed/stdlib/multiprocessing/util.pyi +79 -0
  557. mypy/typeshed/stdlib/netrc.pyi +23 -0
  558. mypy/typeshed/stdlib/nis.pyi +9 -0
  559. mypy/typeshed/stdlib/nntplib.pyi +125 -0
  560. mypy/typeshed/stdlib/nt.pyi +111 -0
  561. mypy/typeshed/stdlib/ntpath.pyi +119 -0
  562. mypy/typeshed/stdlib/nturl2path.pyi +2 -0
  563. mypy/typeshed/stdlib/numbers.pyi +154 -0
  564. mypy/typeshed/stdlib/opcode.pyi +59 -0
  565. mypy/typeshed/stdlib/operator.pyi +110 -0
  566. mypy/typeshed/stdlib/optparse.pyi +252 -0
  567. mypy/typeshed/stdlib/os/__init__.pyi +1139 -0
  568. mypy/typeshed/stdlib/os/path.pyi +8 -0
  569. mypy/typeshed/stdlib/ossaudiodev.pyi +131 -0
  570. mypy/typeshed/stdlib/parser.pyi +24 -0
  571. mypy/typeshed/stdlib/pathlib.pyi +232 -0
  572. mypy/typeshed/stdlib/pdb.pyi +181 -0
  573. mypy/typeshed/stdlib/pickle.pyi +270 -0
  574. mypy/typeshed/stdlib/pickletools.pyi +167 -0
  575. mypy/typeshed/stdlib/pipes.pyi +16 -0
  576. mypy/typeshed/stdlib/pkgutil.pyi +53 -0
  577. mypy/typeshed/stdlib/platform.pyi +42 -0
  578. mypy/typeshed/stdlib/plistlib.pyi +113 -0
  579. mypy/typeshed/stdlib/poplib.pyi +71 -0
  580. mypy/typeshed/stdlib/posix.pyi +359 -0
  581. mypy/typeshed/stdlib/posixpath.pyi +161 -0
  582. mypy/typeshed/stdlib/pprint.pyi +112 -0
  583. mypy/typeshed/stdlib/profile.pyi +31 -0
  584. mypy/typeshed/stdlib/pstats.pyi +78 -0
  585. mypy/typeshed/stdlib/pty.pyi +19 -0
  586. mypy/typeshed/stdlib/pwd.pyi +27 -0
  587. mypy/typeshed/stdlib/py_compile.pyi +34 -0
  588. mypy/typeshed/stdlib/pyclbr.pyi +74 -0
  589. mypy/typeshed/stdlib/pydoc.pyi +261 -0
  590. mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
  591. mypy/typeshed/stdlib/pydoc_data/topics.pyi +1 -0
  592. mypy/typeshed/stdlib/pyexpat/__init__.pyi +80 -0
  593. mypy/typeshed/stdlib/pyexpat/errors.pyi +49 -0
  594. mypy/typeshed/stdlib/pyexpat/model.pyi +11 -0
  595. mypy/typeshed/stdlib/queue.pyi +58 -0
  596. mypy/typeshed/stdlib/quopri.pyi +11 -0
  597. mypy/typeshed/stdlib/random.pyi +138 -0
  598. mypy/typeshed/stdlib/re.pyi +290 -0
  599. mypy/typeshed/stdlib/readline.pyi +36 -0
  600. mypy/typeshed/stdlib/reprlib.pyi +65 -0
  601. mypy/typeshed/stdlib/resource.pyi +92 -0
  602. mypy/typeshed/stdlib/rlcompleter.pyi +9 -0
  603. mypy/typeshed/stdlib/runpy.pyi +24 -0
  604. mypy/typeshed/stdlib/sched.pyi +42 -0
  605. mypy/typeshed/stdlib/secrets.pyi +15 -0
  606. mypy/typeshed/stdlib/select.pyi +151 -0
  607. mypy/typeshed/stdlib/selectors.pyi +67 -0
  608. mypy/typeshed/stdlib/shelve.pyi +46 -0
  609. mypy/typeshed/stdlib/shlex.pyi +43 -0
  610. mypy/typeshed/stdlib/shutil.pyi +189 -0
  611. mypy/typeshed/stdlib/signal.pyi +189 -0
  612. mypy/typeshed/stdlib/site.pyi +27 -0
  613. mypy/typeshed/stdlib/smtpd.pyi +91 -0
  614. mypy/typeshed/stdlib/smtplib.pyi +204 -0
  615. mypy/typeshed/stdlib/sndhdr.pyi +14 -0
  616. mypy/typeshed/stdlib/socket.pyi +825 -0
  617. mypy/typeshed/stdlib/socketserver.pyi +168 -0
  618. mypy/typeshed/stdlib/spwd.pyi +40 -0
  619. mypy/typeshed/stdlib/sqlite3/__init__.pyi +1 -0
  620. mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +469 -0
  621. mypy/typeshed/stdlib/sre_compile.pyi +11 -0
  622. mypy/typeshed/stdlib/sre_constants.pyi +130 -0
  623. mypy/typeshed/stdlib/sre_parse.pyi +104 -0
  624. mypy/typeshed/stdlib/ssl.pyi +529 -0
  625. mypy/typeshed/stdlib/stat.pyi +1 -0
  626. mypy/typeshed/stdlib/statistics.pyi +132 -0
  627. mypy/typeshed/stdlib/string.pyi +83 -0
  628. mypy/typeshed/stdlib/stringprep.pyi +27 -0
  629. mypy/typeshed/stdlib/struct.pyi +26 -0
  630. mypy/typeshed/stdlib/subprocess.pyi +2614 -0
  631. mypy/typeshed/stdlib/sunau.pyi +86 -0
  632. mypy/typeshed/stdlib/symbol.pyi +93 -0
  633. mypy/typeshed/stdlib/symtable.pyi +58 -0
  634. mypy/typeshed/stdlib/sys/__init__.pyi +373 -0
  635. mypy/typeshed/stdlib/sys/_monitoring.pyi +52 -0
  636. mypy/typeshed/stdlib/sysconfig.pyi +43 -0
  637. mypy/typeshed/stdlib/syslog.pyi +46 -0
  638. mypy/typeshed/stdlib/tabnanny.pyi +16 -0
  639. mypy/typeshed/stdlib/tarfile.pyi +438 -0
  640. mypy/typeshed/stdlib/telnetlib.pyi +122 -0
  641. mypy/typeshed/stdlib/tempfile.pyi +477 -0
  642. mypy/typeshed/stdlib/termios.pyi +267 -0
  643. mypy/typeshed/stdlib/textwrap.pyi +103 -0
  644. mypy/typeshed/stdlib/this.pyi +2 -0
  645. mypy/typeshed/stdlib/threading.pyi +187 -0
  646. mypy/typeshed/stdlib/time.pyi +107 -0
  647. mypy/typeshed/stdlib/timeit.pyi +32 -0
  648. mypy/typeshed/stdlib/tkinter/__init__.pyi +3641 -0
  649. mypy/typeshed/stdlib/tkinter/colorchooser.pyi +20 -0
  650. mypy/typeshed/stdlib/tkinter/commondialog.pyi +14 -0
  651. mypy/typeshed/stdlib/tkinter/constants.pyi +80 -0
  652. mypy/typeshed/stdlib/tkinter/dialog.pyi +16 -0
  653. mypy/typeshed/stdlib/tkinter/dnd.pyi +20 -0
  654. mypy/typeshed/stdlib/tkinter/filedialog.pyi +151 -0
  655. mypy/typeshed/stdlib/tkinter/font.pyi +116 -0
  656. mypy/typeshed/stdlib/tkinter/messagebox.pyi +44 -0
  657. mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +10 -0
  658. mypy/typeshed/stdlib/tkinter/simpledialog.pyi +54 -0
  659. mypy/typeshed/stdlib/tkinter/tix.pyi +299 -0
  660. mypy/typeshed/stdlib/tkinter/ttk.pyi +1191 -0
  661. mypy/typeshed/stdlib/token.pyi +159 -0
  662. mypy/typeshed/stdlib/tokenize.pyi +177 -0
  663. mypy/typeshed/stdlib/tomllib.pyi +10 -0
  664. mypy/typeshed/stdlib/trace.pyi +79 -0
  665. mypy/typeshed/stdlib/traceback.pyi +260 -0
  666. mypy/typeshed/stdlib/tracemalloc.pyi +124 -0
  667. mypy/typeshed/stdlib/tty.pyi +30 -0
  668. mypy/typeshed/stdlib/turtle.pyi +713 -0
  669. mypy/typeshed/stdlib/types.pyi +605 -0
  670. mypy/typeshed/stdlib/typing.pyi +968 -0
  671. mypy/typeshed/stdlib/typing_extensions.pyi +503 -0
  672. mypy/typeshed/stdlib/unicodedata.pyi +71 -0
  673. mypy/typeshed/stdlib/unittest/__init__.pyi +67 -0
  674. mypy/typeshed/stdlib/unittest/_log.pyi +27 -0
  675. mypy/typeshed/stdlib/unittest/async_case.pyi +21 -0
  676. mypy/typeshed/stdlib/unittest/case.pyi +342 -0
  677. mypy/typeshed/stdlib/unittest/loader.pyi +51 -0
  678. mypy/typeshed/stdlib/unittest/main.pyi +69 -0
  679. mypy/typeshed/stdlib/unittest/mock.pyi +430 -0
  680. mypy/typeshed/stdlib/unittest/result.pyi +46 -0
  681. mypy/typeshed/stdlib/unittest/runner.pyi +72 -0
  682. mypy/typeshed/stdlib/unittest/signals.pyi +15 -0
  683. mypy/typeshed/stdlib/unittest/suite.pyi +22 -0
  684. mypy/typeshed/stdlib/unittest/util.pyi +23 -0
  685. mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
  686. mypy/typeshed/stdlib/urllib/error.pyi +23 -0
  687. mypy/typeshed/stdlib/urllib/parse.pyi +210 -0
  688. mypy/typeshed/stdlib/urllib/request.pyi +399 -0
  689. mypy/typeshed/stdlib/urllib/response.pyi +43 -0
  690. mypy/typeshed/stdlib/urllib/robotparser.pyi +20 -0
  691. mypy/typeshed/stdlib/uu.pyi +13 -0
  692. mypy/typeshed/stdlib/uuid.pyi +100 -0
  693. mypy/typeshed/stdlib/venv/__init__.pyi +79 -0
  694. mypy/typeshed/stdlib/warnings.pyi +112 -0
  695. mypy/typeshed/stdlib/wave.pyi +85 -0
  696. mypy/typeshed/stdlib/weakref.pyi +150 -0
  697. mypy/typeshed/stdlib/webbrowser.pyi +74 -0
  698. mypy/typeshed/stdlib/winreg.pyi +103 -0
  699. mypy/typeshed/stdlib/winsound.pyi +28 -0
  700. mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
  701. mypy/typeshed/stdlib/wsgiref/handlers.pyi +91 -0
  702. mypy/typeshed/stdlib/wsgiref/headers.pyi +26 -0
  703. mypy/typeshed/stdlib/wsgiref/simple_server.pyi +37 -0
  704. mypy/typeshed/stdlib/wsgiref/types.pyi +32 -0
  705. mypy/typeshed/stdlib/wsgiref/util.pyi +24 -0
  706. mypy/typeshed/stdlib/wsgiref/validate.pyi +50 -0
  707. mypy/typeshed/stdlib/xdrlib.pyi +57 -0
  708. mypy/typeshed/stdlib/xml/__init__.pyi +1 -0
  709. mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +19 -0
  710. mypy/typeshed/stdlib/xml/dom/__init__.pyi +69 -0
  711. mypy/typeshed/stdlib/xml/dom/domreg.pyi +8 -0
  712. mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +100 -0
  713. mypy/typeshed/stdlib/xml/dom/minicompat.pyi +22 -0
  714. mypy/typeshed/stdlib/xml/dom/minidom.pyi +404 -0
  715. mypy/typeshed/stdlib/xml/dom/pulldom.pyi +94 -0
  716. mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +108 -0
  717. mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +28 -0
  718. mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +34 -0
  719. mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +321 -0
  720. mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
  721. mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +1 -0
  722. mypy/typeshed/stdlib/xml/parsers/__init__.pyi +1 -0
  723. mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +1 -0
  724. mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +1 -0
  725. mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +1 -0
  726. mypy/typeshed/stdlib/xml/sax/__init__.pyi +25 -0
  727. mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +19 -0
  728. mypy/typeshed/stdlib/xml/sax/handler.pyi +55 -0
  729. mypy/typeshed/stdlib/xml/sax/saxutils.pyi +60 -0
  730. mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +87 -0
  731. mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
  732. mypy/typeshed/stdlib/xmlrpc/client.pyi +296 -0
  733. mypy/typeshed/stdlib/xmlrpc/server.pyi +143 -0
  734. mypy/typeshed/stdlib/xxlimited.pyi +22 -0
  735. mypy/typeshed/stdlib/zipapp.pyi +20 -0
  736. mypy/typeshed/stdlib/zipfile/__init__.pyi +306 -0
  737. mypy/typeshed/stdlib/zipfile/_path.pyi +95 -0
  738. mypy/typeshed/stdlib/zipimport.pyi +32 -0
  739. mypy/typeshed/stdlib/zlib.pyi +56 -0
  740. mypy/typeshed/stdlib/zoneinfo/__init__.pyi +38 -0
  741. mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +218 -0
  742. mypy/typestate.py +323 -0
  743. mypy/typetraverser.py +142 -0
  744. mypy/typevars.py +93 -0
  745. mypy/typevartuples.py +32 -0
  746. mypy/util.py +869 -0
  747. mypy/version.py +1 -0
  748. mypy/visitor.py +621 -0
  749. mypy/xml/mypy-html.css +104 -0
  750. mypy/xml/mypy-html.xslt +81 -0
  751. mypy/xml/mypy-txt.xslt +100 -0
  752. mypy/xml/mypy.xsd +50 -0
  753. mypy_dev-1.9.0.dev0.dist-info/LICENSE +229 -0
  754. mypy_dev-1.9.0.dev0.dist-info/METADATA +39 -0
  755. mypy_dev-1.9.0.dev0.dist-info/RECORD +1018 -0
  756. mypy_dev-1.9.0.dev0.dist-info/WHEEL +5 -0
  757. mypy_dev-1.9.0.dev0.dist-info/entry_points.txt +6 -0
  758. mypy_dev-1.9.0.dev0.dist-info/top_level.txt +2 -0
  759. mypyc/README.md +133 -0
  760. mypyc/__init__.py +0 -0
  761. mypyc/__main__.py +57 -0
  762. mypyc/analysis/__init__.py +0 -0
  763. mypyc/analysis/attrdefined.py +436 -0
  764. mypyc/analysis/blockfreq.py +32 -0
  765. mypyc/analysis/dataflow.py +624 -0
  766. mypyc/analysis/ircheck.py +429 -0
  767. mypyc/analysis/selfleaks.py +207 -0
  768. mypyc/build.py +616 -0
  769. mypyc/codegen/__init__.py +0 -0
  770. mypyc/codegen/cstring.py +54 -0
  771. mypyc/codegen/emit.py +1193 -0
  772. mypyc/codegen/emitclass.py +1060 -0
  773. mypyc/codegen/emitfunc.py +846 -0
  774. mypyc/codegen/emitmodule.py +1131 -0
  775. mypyc/codegen/emitwrapper.py +979 -0
  776. mypyc/codegen/literals.py +302 -0
  777. mypyc/common.py +136 -0
  778. mypyc/crash.py +31 -0
  779. mypyc/doc/Makefile +20 -0
  780. mypyc/doc/bool_operations.rst +27 -0
  781. mypyc/doc/compilation_units.rst +20 -0
  782. mypyc/doc/conf.py +59 -0
  783. mypyc/doc/cpython-timings.md +25 -0
  784. mypyc/doc/dev-intro.md +548 -0
  785. mypyc/doc/dict_operations.rst +59 -0
  786. mypyc/doc/differences_from_python.rst +332 -0
  787. mypyc/doc/float_operations.rst +50 -0
  788. mypyc/doc/future.md +42 -0
  789. mypyc/doc/getting_started.rst +240 -0
  790. mypyc/doc/index.rst +61 -0
  791. mypyc/doc/int_operations.rst +162 -0
  792. mypyc/doc/introduction.rst +150 -0
  793. mypyc/doc/list_operations.rst +65 -0
  794. mypyc/doc/make.bat +35 -0
  795. mypyc/doc/native_classes.rst +206 -0
  796. mypyc/doc/native_operations.rst +55 -0
  797. mypyc/doc/performance_tips_and_tricks.rst +244 -0
  798. mypyc/doc/set_operations.rst +47 -0
  799. mypyc/doc/str_operations.rst +35 -0
  800. mypyc/doc/tuple_operations.rst +33 -0
  801. mypyc/doc/using_type_annotations.rst +398 -0
  802. mypyc/errors.py +29 -0
  803. mypyc/external/googletest/LICENSE +28 -0
  804. mypyc/external/googletest/README.md +280 -0
  805. mypyc/external/googletest/include/gtest/gtest-death-test.h +294 -0
  806. mypyc/external/googletest/include/gtest/gtest-message.h +250 -0
  807. mypyc/external/googletest/include/gtest/gtest-param-test.h +1444 -0
  808. mypyc/external/googletest/include/gtest/gtest-param-test.h.pump +510 -0
  809. mypyc/external/googletest/include/gtest/gtest-printers.h +993 -0
  810. mypyc/external/googletest/include/gtest/gtest-spi.h +232 -0
  811. mypyc/external/googletest/include/gtest/gtest-test-part.h +179 -0
  812. mypyc/external/googletest/include/gtest/gtest-typed-test.h +263 -0
  813. mypyc/external/googletest/include/gtest/gtest.h +2236 -0
  814. mypyc/external/googletest/include/gtest/gtest_pred_impl.h +358 -0
  815. mypyc/external/googletest/include/gtest/gtest_prod.h +58 -0
  816. mypyc/external/googletest/include/gtest/internal/custom/gtest-port.h +69 -0
  817. mypyc/external/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  818. mypyc/external/googletest/include/gtest/internal/custom/gtest.h +41 -0
  819. mypyc/external/googletest/include/gtest/internal/gtest-death-test-internal.h +319 -0
  820. mypyc/external/googletest/include/gtest/internal/gtest-filepath.h +206 -0
  821. mypyc/external/googletest/include/gtest/internal/gtest-internal.h +1238 -0
  822. mypyc/external/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  823. mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h +5146 -0
  824. mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +286 -0
  825. mypyc/external/googletest/include/gtest/internal/gtest-param-util.h +731 -0
  826. mypyc/external/googletest/include/gtest/internal/gtest-port-arch.h +93 -0
  827. mypyc/external/googletest/include/gtest/internal/gtest-port.h +2560 -0
  828. mypyc/external/googletest/include/gtest/internal/gtest-string.h +167 -0
  829. mypyc/external/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  830. mypyc/external/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  831. mypyc/external/googletest/include/gtest/internal/gtest-type-util.h +3331 -0
  832. mypyc/external/googletest/include/gtest/internal/gtest-type-util.h.pump +297 -0
  833. mypyc/external/googletest/make/Makefile +61 -0
  834. mypyc/external/googletest/src/gtest-all.cc +48 -0
  835. mypyc/external/googletest/src/gtest-death-test.cc +1342 -0
  836. mypyc/external/googletest/src/gtest-filepath.cc +387 -0
  837. mypyc/external/googletest/src/gtest-internal-inl.h +1183 -0
  838. mypyc/external/googletest/src/gtest-port.cc +1259 -0
  839. mypyc/external/googletest/src/gtest-printers.cc +373 -0
  840. mypyc/external/googletest/src/gtest-test-part.cc +110 -0
  841. mypyc/external/googletest/src/gtest-typed-test.cc +118 -0
  842. mypyc/external/googletest/src/gtest.cc +5388 -0
  843. mypyc/external/googletest/src/gtest_main.cc +38 -0
  844. mypyc/ir/__init__.py +0 -0
  845. mypyc/ir/class_ir.py +499 -0
  846. mypyc/ir/func_ir.py +370 -0
  847. mypyc/ir/module_ir.py +88 -0
  848. mypyc/ir/ops.py +1642 -0
  849. mypyc/ir/pprint.py +496 -0
  850. mypyc/ir/rtypes.py +1038 -0
  851. mypyc/irbuild/__init__.py +0 -0
  852. mypyc/irbuild/ast_helpers.py +120 -0
  853. mypyc/irbuild/builder.py +1398 -0
  854. mypyc/irbuild/callable_class.py +173 -0
  855. mypyc/irbuild/classdef.py +850 -0
  856. mypyc/irbuild/constant_fold.py +95 -0
  857. mypyc/irbuild/context.py +186 -0
  858. mypyc/irbuild/env_class.py +223 -0
  859. mypyc/irbuild/expression.py +1067 -0
  860. mypyc/irbuild/for_helpers.py +1046 -0
  861. mypyc/irbuild/format_str_tokenizer.py +250 -0
  862. mypyc/irbuild/function.py +1089 -0
  863. mypyc/irbuild/generator.py +346 -0
  864. mypyc/irbuild/ll_builder.py +2407 -0
  865. mypyc/irbuild/main.py +153 -0
  866. mypyc/irbuild/mapper.py +221 -0
  867. mypyc/irbuild/match.py +355 -0
  868. mypyc/irbuild/nonlocalcontrol.py +197 -0
  869. mypyc/irbuild/prebuildvisitor.py +203 -0
  870. mypyc/irbuild/prepare.py +609 -0
  871. mypyc/irbuild/specialize.py +822 -0
  872. mypyc/irbuild/statement.py +1017 -0
  873. mypyc/irbuild/targets.py +57 -0
  874. mypyc/irbuild/util.py +189 -0
  875. mypyc/irbuild/visitor.py +401 -0
  876. mypyc/irbuild/vtable.py +82 -0
  877. mypyc/lib-rt/CPy.h +643 -0
  878. mypyc/lib-rt/bytes_ops.c +143 -0
  879. mypyc/lib-rt/dict_ops.c +446 -0
  880. mypyc/lib-rt/exc_ops.c +259 -0
  881. mypyc/lib-rt/float_ops.c +192 -0
  882. mypyc/lib-rt/generic_ops.c +64 -0
  883. mypyc/lib-rt/getargs.c +450 -0
  884. mypyc/lib-rt/getargsfast.c +569 -0
  885. mypyc/lib-rt/init.c +13 -0
  886. mypyc/lib-rt/int_ops.c +803 -0
  887. mypyc/lib-rt/list_ops.c +335 -0
  888. mypyc/lib-rt/misc_ops.c +942 -0
  889. mypyc/lib-rt/module_shim.tmpl +18 -0
  890. mypyc/lib-rt/mypyc_util.h +118 -0
  891. mypyc/lib-rt/pythoncapi_compat.h +497 -0
  892. mypyc/lib-rt/pythonsupport.h +548 -0
  893. mypyc/lib-rt/set_ops.c +17 -0
  894. mypyc/lib-rt/setup.py +70 -0
  895. mypyc/lib-rt/str_ops.c +241 -0
  896. mypyc/lib-rt/test_capi.cc +585 -0
  897. mypyc/lib-rt/tuple_ops.c +61 -0
  898. mypyc/namegen.py +115 -0
  899. mypyc/options.py +32 -0
  900. mypyc/primitives/__init__.py +0 -0
  901. mypyc/primitives/bytes_ops.py +101 -0
  902. mypyc/primitives/dict_ops.py +325 -0
  903. mypyc/primitives/exc_ops.py +101 -0
  904. mypyc/primitives/float_ops.py +168 -0
  905. mypyc/primitives/generic_ops.py +384 -0
  906. mypyc/primitives/int_ops.py +304 -0
  907. mypyc/primitives/list_ops.py +300 -0
  908. mypyc/primitives/misc_ops.py +241 -0
  909. mypyc/primitives/registry.py +323 -0
  910. mypyc/primitives/set_ops.py +121 -0
  911. mypyc/primitives/str_ops.py +229 -0
  912. mypyc/primitives/tuple_ops.py +83 -0
  913. mypyc/rt_subtype.py +77 -0
  914. mypyc/sametype.py +83 -0
  915. mypyc/subtype.py +88 -0
  916. mypyc/test/__init__.py +0 -0
  917. mypyc/test/config.py +13 -0
  918. mypyc/test/test_alwaysdefined.py +46 -0
  919. mypyc/test/test_analysis.py +77 -0
  920. mypyc/test/test_cheader.py +45 -0
  921. mypyc/test/test_commandline.py +82 -0
  922. mypyc/test/test_emit.py +69 -0
  923. mypyc/test/test_emitclass.py +35 -0
  924. mypyc/test/test_emitfunc.py +926 -0
  925. mypyc/test/test_emitwrapper.py +60 -0
  926. mypyc/test/test_exceptions.py +56 -0
  927. mypyc/test/test_external.py +49 -0
  928. mypyc/test/test_irbuild.py +87 -0
  929. mypyc/test/test_ircheck.py +199 -0
  930. mypyc/test/test_literals.py +90 -0
  931. mypyc/test/test_namegen.py +48 -0
  932. mypyc/test/test_pprint.py +42 -0
  933. mypyc/test/test_rarray.py +48 -0
  934. mypyc/test/test_refcount.py +59 -0
  935. mypyc/test/test_run.py +426 -0
  936. mypyc/test/test_serialization.py +108 -0
  937. mypyc/test/test_struct.py +112 -0
  938. mypyc/test/test_tuplename.py +33 -0
  939. mypyc/test/test_typeops.py +97 -0
  940. mypyc/test/testutil.py +283 -0
  941. mypyc/test-data/alwaysdefined.test +732 -0
  942. mypyc/test-data/analysis.test +603 -0
  943. mypyc/test-data/commandline.test +245 -0
  944. mypyc/test-data/driver/driver.py +48 -0
  945. mypyc/test-data/exceptions-freq.test +125 -0
  946. mypyc/test-data/exceptions.test +713 -0
  947. mypyc/test-data/fixtures/ir.py +373 -0
  948. mypyc/test-data/fixtures/testutil.py +103 -0
  949. mypyc/test-data/fixtures/typing-full.pyi +169 -0
  950. mypyc/test-data/irbuild-any.test +238 -0
  951. mypyc/test-data/irbuild-basic.test +3690 -0
  952. mypyc/test-data/irbuild-bool.test +463 -0
  953. mypyc/test-data/irbuild-bytes.test +184 -0
  954. mypyc/test-data/irbuild-classes.test +1303 -0
  955. mypyc/test-data/irbuild-constant-fold.test +480 -0
  956. mypyc/test-data/irbuild-dict.test +585 -0
  957. mypyc/test-data/irbuild-dunders.test +223 -0
  958. mypyc/test-data/irbuild-float.test +497 -0
  959. mypyc/test-data/irbuild-generics.test +151 -0
  960. mypyc/test-data/irbuild-glue-methods.test +437 -0
  961. mypyc/test-data/irbuild-i16.test +526 -0
  962. mypyc/test-data/irbuild-i32.test +598 -0
  963. mypyc/test-data/irbuild-i64.test +2164 -0
  964. mypyc/test-data/irbuild-int.test +235 -0
  965. mypyc/test-data/irbuild-isinstance.test +109 -0
  966. mypyc/test-data/irbuild-lists.test +547 -0
  967. mypyc/test-data/irbuild-match.test +1708 -0
  968. mypyc/test-data/irbuild-math.test +64 -0
  969. mypyc/test-data/irbuild-nested.test +807 -0
  970. mypyc/test-data/irbuild-optional.test +536 -0
  971. mypyc/test-data/irbuild-set.test +838 -0
  972. mypyc/test-data/irbuild-singledispatch.test +257 -0
  973. mypyc/test-data/irbuild-statements.test +1149 -0
  974. mypyc/test-data/irbuild-str.test +314 -0
  975. mypyc/test-data/irbuild-strip-asserts.test +12 -0
  976. mypyc/test-data/irbuild-try.test +523 -0
  977. mypyc/test-data/irbuild-tuple.test +462 -0
  978. mypyc/test-data/irbuild-u8.test +543 -0
  979. mypyc/test-data/irbuild-unreachable.test +241 -0
  980. mypyc/test-data/irbuild-vectorcall.test +153 -0
  981. mypyc/test-data/refcount.test +1588 -0
  982. mypyc/test-data/run-async.test +145 -0
  983. mypyc/test-data/run-attrs.test +318 -0
  984. mypyc/test-data/run-bench.test +196 -0
  985. mypyc/test-data/run-bools.test +229 -0
  986. mypyc/test-data/run-bytes.test +302 -0
  987. mypyc/test-data/run-classes.test +2505 -0
  988. mypyc/test-data/run-dicts.test +334 -0
  989. mypyc/test-data/run-dunders.test +945 -0
  990. mypyc/test-data/run-exceptions.test +448 -0
  991. mypyc/test-data/run-floats.test +516 -0
  992. mypyc/test-data/run-functions.test +1310 -0
  993. mypyc/test-data/run-generators.test +681 -0
  994. mypyc/test-data/run-i16.test +338 -0
  995. mypyc/test-data/run-i32.test +336 -0
  996. mypyc/test-data/run-i64.test +1519 -0
  997. mypyc/test-data/run-imports.test +265 -0
  998. mypyc/test-data/run-integers.test +540 -0
  999. mypyc/test-data/run-lists.test +411 -0
  1000. mypyc/test-data/run-loops.test +485 -0
  1001. mypyc/test-data/run-match.test +283 -0
  1002. mypyc/test-data/run-math.test +106 -0
  1003. mypyc/test-data/run-misc.test +1168 -0
  1004. mypyc/test-data/run-multimodule.test +887 -0
  1005. mypyc/test-data/run-mypy-sim.test +138 -0
  1006. mypyc/test-data/run-primitives.test +375 -0
  1007. mypyc/test-data/run-python37.test +159 -0
  1008. mypyc/test-data/run-python38.test +88 -0
  1009. mypyc/test-data/run-sets.test +150 -0
  1010. mypyc/test-data/run-singledispatch.test +698 -0
  1011. mypyc/test-data/run-strings.test +641 -0
  1012. mypyc/test-data/run-traits.test +411 -0
  1013. mypyc/test-data/run-tuples.test +258 -0
  1014. mypyc/test-data/run-u8.test +303 -0
  1015. mypyc/transform/__init__.py +0 -0
  1016. mypyc/transform/exceptions.py +182 -0
  1017. mypyc/transform/refcount.py +294 -0
  1018. mypyc/transform/uninit.py +190 -0
@@ -0,0 +1,3641 @@
1
+ import _tkinter
2
+ import sys
3
+ from _typeshed import Incomplete, StrEnum, StrOrBytesPath
4
+ from collections.abc import Callable, Mapping, Sequence
5
+ from tkinter.constants import *
6
+ from tkinter.font import _FontDescription
7
+ from types import TracebackType
8
+ from typing import Any, Generic, Literal, NamedTuple, TypedDict, TypeVar, overload, type_check_only
9
+ from typing_extensions import TypeAlias, TypeVarTuple, Unpack, deprecated
10
+
11
+ if sys.version_info >= (3, 9):
12
+ __all__ = [
13
+ "TclError",
14
+ "NO",
15
+ "FALSE",
16
+ "OFF",
17
+ "YES",
18
+ "TRUE",
19
+ "ON",
20
+ "N",
21
+ "S",
22
+ "W",
23
+ "E",
24
+ "NW",
25
+ "SW",
26
+ "NE",
27
+ "SE",
28
+ "NS",
29
+ "EW",
30
+ "NSEW",
31
+ "CENTER",
32
+ "NONE",
33
+ "X",
34
+ "Y",
35
+ "BOTH",
36
+ "LEFT",
37
+ "TOP",
38
+ "RIGHT",
39
+ "BOTTOM",
40
+ "RAISED",
41
+ "SUNKEN",
42
+ "FLAT",
43
+ "RIDGE",
44
+ "GROOVE",
45
+ "SOLID",
46
+ "HORIZONTAL",
47
+ "VERTICAL",
48
+ "NUMERIC",
49
+ "CHAR",
50
+ "WORD",
51
+ "BASELINE",
52
+ "INSIDE",
53
+ "OUTSIDE",
54
+ "SEL",
55
+ "SEL_FIRST",
56
+ "SEL_LAST",
57
+ "END",
58
+ "INSERT",
59
+ "CURRENT",
60
+ "ANCHOR",
61
+ "ALL",
62
+ "NORMAL",
63
+ "DISABLED",
64
+ "ACTIVE",
65
+ "HIDDEN",
66
+ "CASCADE",
67
+ "CHECKBUTTON",
68
+ "COMMAND",
69
+ "RADIOBUTTON",
70
+ "SEPARATOR",
71
+ "SINGLE",
72
+ "BROWSE",
73
+ "MULTIPLE",
74
+ "EXTENDED",
75
+ "DOTBOX",
76
+ "UNDERLINE",
77
+ "PIESLICE",
78
+ "CHORD",
79
+ "ARC",
80
+ "FIRST",
81
+ "LAST",
82
+ "BUTT",
83
+ "PROJECTING",
84
+ "ROUND",
85
+ "BEVEL",
86
+ "MITER",
87
+ "MOVETO",
88
+ "SCROLL",
89
+ "UNITS",
90
+ "PAGES",
91
+ "TkVersion",
92
+ "TclVersion",
93
+ "READABLE",
94
+ "WRITABLE",
95
+ "EXCEPTION",
96
+ "EventType",
97
+ "Event",
98
+ "NoDefaultRoot",
99
+ "Variable",
100
+ "StringVar",
101
+ "IntVar",
102
+ "DoubleVar",
103
+ "BooleanVar",
104
+ "mainloop",
105
+ "getint",
106
+ "getdouble",
107
+ "getboolean",
108
+ "Misc",
109
+ "CallWrapper",
110
+ "XView",
111
+ "YView",
112
+ "Wm",
113
+ "Tk",
114
+ "Tcl",
115
+ "Pack",
116
+ "Place",
117
+ "Grid",
118
+ "BaseWidget",
119
+ "Widget",
120
+ "Toplevel",
121
+ "Button",
122
+ "Canvas",
123
+ "Checkbutton",
124
+ "Entry",
125
+ "Frame",
126
+ "Label",
127
+ "Listbox",
128
+ "Menu",
129
+ "Menubutton",
130
+ "Message",
131
+ "Radiobutton",
132
+ "Scale",
133
+ "Scrollbar",
134
+ "Text",
135
+ "OptionMenu",
136
+ "Image",
137
+ "PhotoImage",
138
+ "BitmapImage",
139
+ "image_names",
140
+ "image_types",
141
+ "Spinbox",
142
+ "LabelFrame",
143
+ "PanedWindow",
144
+ ]
145
+
146
+ # Using anything from tkinter.font in this file means that 'import tkinter'
147
+ # seems to also load tkinter.font. That's not how it actually works, but
148
+ # unfortunately not much can be done about it. https://github.com/python/typeshed/pull/4346
149
+
150
+ TclError = _tkinter.TclError
151
+ wantobjects: int
152
+ TkVersion: float
153
+ TclVersion: float
154
+ READABLE = _tkinter.READABLE
155
+ WRITABLE = _tkinter.WRITABLE
156
+ EXCEPTION = _tkinter.EXCEPTION
157
+
158
+ # Quick guide for figuring out which widget class to choose:
159
+ # - Misc: any widget (don't use BaseWidget because Tk doesn't inherit from BaseWidget)
160
+ # - Widget: anything that is meant to be put into another widget with e.g. pack or grid
161
+ #
162
+ # Don't trust tkinter's docstrings, because they have been created by copy/pasting from
163
+ # Tk's manual pages more than 10 years ago. Use the latest manual pages instead:
164
+ #
165
+ # $ sudo apt install tk-doc tcl-doc
166
+ # $ man 3tk label # tkinter.Label
167
+ # $ man 3tk ttk_label # tkinter.ttk.Label
168
+ # $ man 3tcl after # tkinter.Misc.after
169
+ #
170
+ # You can also read the manual pages online: https://www.tcl.tk/doc/
171
+
172
+ # Some widgets have an option named -compound that accepts different values
173
+ # than the _Compound defined here. Many other options have similar things.
174
+ _Anchor: TypeAlias = Literal["nw", "n", "ne", "w", "center", "e", "sw", "s", "se"] # manual page: Tk_GetAnchor
175
+ _ButtonCommand: TypeAlias = str | Callable[[], Any] # accepts string of tcl code, return value is returned from Button.invoke()
176
+ _Compound: TypeAlias = Literal["top", "left", "center", "right", "bottom", "none"] # -compound in manual page named 'options'
177
+ # manual page: Tk_GetCursor
178
+ _Cursor: TypeAlias = str | tuple[str] | tuple[str, str] | tuple[str, str, str] | tuple[str, str, str, str]
179
+ # example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P']
180
+ _EntryValidateCommand: TypeAlias = str | list[str] | tuple[str, ...] | Callable[[], bool]
181
+ _GridIndex: TypeAlias = int | str
182
+ _ImageSpec: TypeAlias = _Image | str # str can be from e.g. tkinter.image_names()
183
+ _Relief: TypeAlias = Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] # manual page: Tk_GetRelief
184
+ _ScreenUnits: TypeAlias = str | float # Often the right type instead of int. Manual page: Tk_GetPixels
185
+ # -xscrollcommand and -yscrollcommand in 'options' manual page
186
+ _XYScrollCommand: TypeAlias = str | Callable[[float, float], object]
187
+ _TakeFocusValue: TypeAlias = int | Literal[""] | Callable[[str], bool | None] # -takefocus in manual page named 'options'
188
+
189
+ if sys.version_info >= (3, 11):
190
+ class _VersionInfoType(NamedTuple):
191
+ major: int
192
+ minor: int
193
+ micro: int
194
+ releaselevel: str
195
+ serial: int
196
+
197
+ class EventType(StrEnum):
198
+ Activate: str
199
+ ButtonPress: str
200
+ Button = ButtonPress
201
+ ButtonRelease: str
202
+ Circulate: str
203
+ CirculateRequest: str
204
+ ClientMessage: str
205
+ Colormap: str
206
+ Configure: str
207
+ ConfigureRequest: str
208
+ Create: str
209
+ Deactivate: str
210
+ Destroy: str
211
+ Enter: str
212
+ Expose: str
213
+ FocusIn: str
214
+ FocusOut: str
215
+ GraphicsExpose: str
216
+ Gravity: str
217
+ KeyPress: str
218
+ Key = KeyPress
219
+ KeyRelease: str
220
+ Keymap: str
221
+ Leave: str
222
+ Map: str
223
+ MapRequest: str
224
+ Mapping: str
225
+ Motion: str
226
+ MouseWheel: str
227
+ NoExpose: str
228
+ Property: str
229
+ Reparent: str
230
+ ResizeRequest: str
231
+ Selection: str
232
+ SelectionClear: str
233
+ SelectionRequest: str
234
+ Unmap: str
235
+ VirtualEvent: str
236
+ Visibility: str
237
+
238
+ _W = TypeVar("_W", bound=Misc)
239
+ # Events considered covariant because you should never assign to event.widget.
240
+ _W_co = TypeVar("_W_co", covariant=True, bound=Misc)
241
+
242
+ class Event(Generic[_W_co]):
243
+ serial: int
244
+ num: int
245
+ focus: bool
246
+ height: int
247
+ width: int
248
+ keycode: int
249
+ state: int | str
250
+ time: int
251
+ x: int
252
+ y: int
253
+ x_root: int
254
+ y_root: int
255
+ char: str
256
+ send_event: bool
257
+ keysym: str
258
+ keysym_num: int
259
+ type: EventType
260
+ widget: _W_co
261
+ delta: int
262
+
263
+ def NoDefaultRoot() -> None: ...
264
+
265
+ _TraceMode: TypeAlias = Literal["array", "read", "write", "unset"]
266
+
267
+ class Variable:
268
+ def __init__(self, master: Misc | None = None, value: Incomplete | None = None, name: str | None = None) -> None: ...
269
+ def set(self, value) -> None: ...
270
+ initialize = set
271
+ def get(self): ...
272
+ def trace_add(self, mode: _TraceMode, callback: Callable[[str, str, str], object]) -> str: ...
273
+ def trace_remove(self, mode: _TraceMode, cbname: str) -> None: ...
274
+ def trace_info(self) -> list[tuple[tuple[_TraceMode, ...], str]]: ...
275
+ @deprecated("use trace_add() instead of trace()")
276
+ def trace(self, mode, callback): ...
277
+ @deprecated("use trace_add() instead of trace_variable()")
278
+ def trace_variable(self, mode, callback): ...
279
+ @deprecated("use trace_remove() instead of trace_vdelete()")
280
+ def trace_vdelete(self, mode, cbname) -> None: ...
281
+ @deprecated("use trace_info() instead of trace_vinfo()")
282
+ def trace_vinfo(self): ...
283
+ def __eq__(self, other: object) -> bool: ...
284
+ def __del__(self) -> None: ...
285
+
286
+ class StringVar(Variable):
287
+ def __init__(self, master: Misc | None = None, value: str | None = None, name: str | None = None) -> None: ...
288
+ def set(self, value: str) -> None: ...
289
+ initialize = set
290
+ def get(self) -> str: ...
291
+
292
+ class IntVar(Variable):
293
+ def __init__(self, master: Misc | None = None, value: int | None = None, name: str | None = None) -> None: ...
294
+ def set(self, value: int) -> None: ...
295
+ initialize = set
296
+ def get(self) -> int: ...
297
+
298
+ class DoubleVar(Variable):
299
+ def __init__(self, master: Misc | None = None, value: float | None = None, name: str | None = None) -> None: ...
300
+ def set(self, value: float) -> None: ...
301
+ initialize = set
302
+ def get(self) -> float: ...
303
+
304
+ class BooleanVar(Variable):
305
+ def __init__(self, master: Misc | None = None, value: bool | None = None, name: str | None = None) -> None: ...
306
+ def set(self, value: bool) -> None: ...
307
+ initialize = set
308
+ def get(self) -> bool: ...
309
+
310
+ def mainloop(n: int = 0) -> None: ...
311
+
312
+ getint: Incomplete
313
+ getdouble: Incomplete
314
+
315
+ def getboolean(s): ...
316
+
317
+ _Ts = TypeVarTuple("_Ts")
318
+
319
+ class _GridIndexInfo(TypedDict, total=False):
320
+ minsize: _ScreenUnits
321
+ pad: _ScreenUnits
322
+ uniform: str | None
323
+ weight: int
324
+
325
+ class Misc:
326
+ master: Misc | None
327
+ tk: _tkinter.TkappType
328
+ children: dict[str, Widget]
329
+ def destroy(self) -> None: ...
330
+ def deletecommand(self, name: str) -> None: ...
331
+ def tk_strictMotif(self, boolean: Incomplete | None = None): ...
332
+ def tk_bisque(self) -> None: ...
333
+ def tk_setPalette(self, *args, **kw) -> None: ...
334
+ def wait_variable(self, name: str | Variable = "PY_VAR") -> None: ...
335
+ waitvar = wait_variable
336
+ def wait_window(self, window: Misc | None = None) -> None: ...
337
+ def wait_visibility(self, window: Misc | None = None) -> None: ...
338
+ def setvar(self, name: str = "PY_VAR", value: str = "1") -> None: ...
339
+ def getvar(self, name: str = "PY_VAR"): ...
340
+ def getint(self, s): ...
341
+ def getdouble(self, s): ...
342
+ def getboolean(self, s): ...
343
+ def focus_set(self) -> None: ...
344
+ focus = focus_set
345
+ def focus_force(self) -> None: ...
346
+ def focus_get(self) -> Misc | None: ...
347
+ def focus_displayof(self) -> Misc | None: ...
348
+ def focus_lastfor(self) -> Misc | None: ...
349
+ def tk_focusFollowsMouse(self) -> None: ...
350
+ def tk_focusNext(self) -> Misc | None: ...
351
+ def tk_focusPrev(self) -> Misc | None: ...
352
+ # .after() can be called without the "func" argument, but it is basically never what you want.
353
+ # It behaves like time.sleep() and freezes the GUI app.
354
+ def after(self, ms: int | Literal["idle"], func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ...
355
+ # after_idle is essentially partialmethod(after, "idle")
356
+ def after_idle(self, func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ...
357
+ def after_cancel(self, id: str) -> None: ...
358
+ def bell(self, displayof: Literal[0] | Misc | None = 0) -> None: ...
359
+ def clipboard_get(self, *, displayof: Misc = ..., type: str = ...) -> str: ...
360
+ def clipboard_clear(self, *, displayof: Misc = ...) -> None: ...
361
+ def clipboard_append(self, string: str, *, displayof: Misc = ..., format: str = ..., type: str = ...) -> None: ...
362
+ def grab_current(self): ...
363
+ def grab_release(self) -> None: ...
364
+ def grab_set(self) -> None: ...
365
+ def grab_set_global(self) -> None: ...
366
+ def grab_status(self) -> Literal["local", "global"] | None: ...
367
+ def option_add(
368
+ self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = None
369
+ ) -> None: ...
370
+ def option_clear(self) -> None: ...
371
+ def option_get(self, name, className): ...
372
+ def option_readfile(self, fileName, priority: Incomplete | None = None) -> None: ...
373
+ def selection_clear(self, **kw) -> None: ...
374
+ def selection_get(self, **kw): ...
375
+ def selection_handle(self, command, **kw) -> None: ...
376
+ def selection_own(self, **kw) -> None: ...
377
+ def selection_own_get(self, **kw): ...
378
+ def send(self, interp, cmd, *args): ...
379
+ def lower(self, belowThis: Incomplete | None = None) -> None: ...
380
+ def tkraise(self, aboveThis: Incomplete | None = None) -> None: ...
381
+ lift = tkraise
382
+ if sys.version_info >= (3, 11):
383
+ def info_patchlevel(self) -> _VersionInfoType: ...
384
+
385
+ def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = 0) -> int: ...
386
+ def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = 0) -> str: ...
387
+ def winfo_cells(self) -> int: ...
388
+ def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk
389
+ def winfo_class(self) -> str: ...
390
+ def winfo_colormapfull(self) -> bool: ...
391
+ def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = 0) -> Misc | None: ...
392
+ def winfo_depth(self) -> int: ...
393
+ def winfo_exists(self) -> bool: ...
394
+ def winfo_fpixels(self, number: _ScreenUnits) -> float: ...
395
+ def winfo_geometry(self) -> str: ...
396
+ def winfo_height(self) -> int: ...
397
+ def winfo_id(self) -> int: ...
398
+ def winfo_interps(self, displayof: Literal[0] | Misc | None = 0) -> tuple[str, ...]: ...
399
+ def winfo_ismapped(self) -> bool: ...
400
+ def winfo_manager(self) -> str: ...
401
+ def winfo_name(self) -> str: ...
402
+ def winfo_parent(self) -> str: ... # return value needs nametowidget()
403
+ def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = 0): ...
404
+ def winfo_pixels(self, number: _ScreenUnits) -> int: ...
405
+ def winfo_pointerx(self) -> int: ...
406
+ def winfo_pointerxy(self) -> tuple[int, int]: ...
407
+ def winfo_pointery(self) -> int: ...
408
+ def winfo_reqheight(self) -> int: ...
409
+ def winfo_reqwidth(self) -> int: ...
410
+ def winfo_rgb(self, color: str) -> tuple[int, int, int]: ...
411
+ def winfo_rootx(self) -> int: ...
412
+ def winfo_rooty(self) -> int: ...
413
+ def winfo_screen(self) -> str: ...
414
+ def winfo_screencells(self) -> int: ...
415
+ def winfo_screendepth(self) -> int: ...
416
+ def winfo_screenheight(self) -> int: ...
417
+ def winfo_screenmmheight(self) -> int: ...
418
+ def winfo_screenmmwidth(self) -> int: ...
419
+ def winfo_screenvisual(self) -> str: ...
420
+ def winfo_screenwidth(self) -> int: ...
421
+ def winfo_server(self) -> str: ...
422
+ def winfo_toplevel(self) -> Tk | Toplevel: ...
423
+ def winfo_viewable(self) -> bool: ...
424
+ def winfo_visual(self) -> str: ...
425
+ def winfo_visualid(self) -> str: ...
426
+ def winfo_visualsavailable(self, includeids: bool = False) -> list[tuple[str, int]]: ...
427
+ def winfo_vrootheight(self) -> int: ...
428
+ def winfo_vrootwidth(self) -> int: ...
429
+ def winfo_vrootx(self) -> int: ...
430
+ def winfo_vrooty(self) -> int: ...
431
+ def winfo_width(self) -> int: ...
432
+ def winfo_x(self) -> int: ...
433
+ def winfo_y(self) -> int: ...
434
+ def update(self) -> None: ...
435
+ def update_idletasks(self) -> None: ...
436
+ @overload
437
+ def bindtags(self, tagList: None = None) -> tuple[str, ...]: ...
438
+ @overload
439
+ def bindtags(self, tagList: list[str] | tuple[str, ...]) -> None: ...
440
+ # bind with isinstance(func, str) doesn't return anything, but all other
441
+ # binds do. The default value of func is not str.
442
+ @overload
443
+ def bind(
444
+ self,
445
+ sequence: str | None = None,
446
+ func: Callable[[Event[Misc]], object] | None = None,
447
+ add: Literal["", "+"] | bool | None = None,
448
+ ) -> str: ...
449
+ @overload
450
+ def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
451
+ @overload
452
+ def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
453
+ # There's no way to know what type of widget bind_all and bind_class
454
+ # callbacks will get, so those are Misc.
455
+ @overload
456
+ def bind_all(
457
+ self,
458
+ sequence: str | None = None,
459
+ func: Callable[[Event[Misc]], object] | None = None,
460
+ add: Literal["", "+"] | bool | None = None,
461
+ ) -> str: ...
462
+ @overload
463
+ def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
464
+ @overload
465
+ def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
466
+ @overload
467
+ def bind_class(
468
+ self,
469
+ className: str,
470
+ sequence: str | None = None,
471
+ func: Callable[[Event[Misc]], object] | None = None,
472
+ add: Literal["", "+"] | bool | None = None,
473
+ ) -> str: ...
474
+ @overload
475
+ def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
476
+ @overload
477
+ def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
478
+ def unbind(self, sequence: str, funcid: str | None = None) -> None: ...
479
+ def unbind_all(self, sequence: str) -> None: ...
480
+ def unbind_class(self, className: str, sequence: str) -> None: ...
481
+ def mainloop(self, n: int = 0) -> None: ...
482
+ def quit(self) -> None: ...
483
+ @property
484
+ def _windowingsystem(self) -> Literal["win32", "aqua", "x11"]: ...
485
+ def nametowidget(self, name: str | Misc | _tkinter.Tcl_Obj) -> Any: ...
486
+ def register(
487
+ self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = None, needcleanup: int = 1
488
+ ) -> str: ...
489
+ def keys(self) -> list[str]: ...
490
+ @overload
491
+ def pack_propagate(self, flag: bool) -> bool | None: ...
492
+ @overload
493
+ def pack_propagate(self) -> None: ...
494
+ propagate = pack_propagate
495
+ def grid_anchor(self, anchor: _Anchor | None = None) -> None: ...
496
+ anchor = grid_anchor
497
+ @overload
498
+ def grid_bbox(
499
+ self, column: None = None, row: None = None, col2: None = None, row2: None = None
500
+ ) -> tuple[int, int, int, int] | None: ...
501
+ @overload
502
+ def grid_bbox(self, column: int, row: int, col2: None = None, row2: None = None) -> tuple[int, int, int, int] | None: ...
503
+ @overload
504
+ def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> tuple[int, int, int, int] | None: ...
505
+ bbox = grid_bbox
506
+ def grid_columnconfigure(
507
+ self,
508
+ index: _GridIndex | list[int] | tuple[int, ...],
509
+ cnf: _GridIndexInfo = {},
510
+ *,
511
+ minsize: _ScreenUnits = ...,
512
+ pad: _ScreenUnits = ...,
513
+ uniform: str = ...,
514
+ weight: int = ...,
515
+ ) -> _GridIndexInfo | Any: ... # can be None but annoying to check
516
+ def grid_rowconfigure(
517
+ self,
518
+ index: _GridIndex | list[int] | tuple[int, ...],
519
+ cnf: _GridIndexInfo = {},
520
+ *,
521
+ minsize: _ScreenUnits = ...,
522
+ pad: _ScreenUnits = ...,
523
+ uniform: str = ...,
524
+ weight: int = ...,
525
+ ) -> _GridIndexInfo | Any: ... # can be None but annoying to check
526
+ columnconfigure = grid_columnconfigure
527
+ rowconfigure = grid_rowconfigure
528
+ def grid_location(self, x: _ScreenUnits, y: _ScreenUnits) -> tuple[int, int]: ...
529
+ @overload
530
+ def grid_propagate(self, flag: bool) -> None: ...
531
+ @overload
532
+ def grid_propagate(self) -> bool: ...
533
+ def grid_size(self) -> tuple[int, int]: ...
534
+ size = grid_size
535
+ # Widget because Toplevel or Tk is never a slave
536
+ def pack_slaves(self) -> list[Widget]: ...
537
+ def grid_slaves(self, row: int | None = None, column: int | None = None) -> list[Widget]: ...
538
+ def place_slaves(self) -> list[Widget]: ...
539
+ slaves = pack_slaves
540
+ def event_add(self, virtual: str, *sequences: str) -> None: ...
541
+ def event_delete(self, virtual: str, *sequences: str) -> None: ...
542
+ def event_generate(
543
+ self,
544
+ sequence: str,
545
+ *,
546
+ above: Misc | int = ...,
547
+ borderwidth: _ScreenUnits = ...,
548
+ button: int = ...,
549
+ count: int = ...,
550
+ data: Any = ..., # anything with usable str() value
551
+ delta: int = ...,
552
+ detail: str = ...,
553
+ focus: bool = ...,
554
+ height: _ScreenUnits = ...,
555
+ keycode: int = ...,
556
+ keysym: str = ...,
557
+ mode: str = ...,
558
+ override: bool = ...,
559
+ place: Literal["PlaceOnTop", "PlaceOnBottom"] = ...,
560
+ root: Misc | int = ...,
561
+ rootx: _ScreenUnits = ...,
562
+ rooty: _ScreenUnits = ...,
563
+ sendevent: bool = ...,
564
+ serial: int = ...,
565
+ state: int | str = ...,
566
+ subwindow: Misc | int = ...,
567
+ time: int = ...,
568
+ warp: bool = ...,
569
+ width: _ScreenUnits = ...,
570
+ when: Literal["now", "tail", "head", "mark"] = ...,
571
+ x: _ScreenUnits = ...,
572
+ y: _ScreenUnits = ...,
573
+ ) -> None: ...
574
+ def event_info(self, virtual: str | None = None) -> tuple[str, ...]: ...
575
+ def image_names(self) -> tuple[str, ...]: ...
576
+ def image_types(self) -> tuple[str, ...]: ...
577
+ # See #4363 and #4891
578
+ def __setitem__(self, key: str, value: Any) -> None: ...
579
+ def __getitem__(self, key: str) -> Any: ...
580
+ def cget(self, key: str) -> Any: ...
581
+ def configure(self, cnf: Any = None) -> Any: ...
582
+ # TODO: config is an alias of configure, but adding that here creates lots of mypy errors
583
+
584
+ class CallWrapper:
585
+ func: Incomplete
586
+ subst: Incomplete
587
+ widget: Incomplete
588
+ def __init__(self, func, subst, widget) -> None: ...
589
+ def __call__(self, *args): ...
590
+
591
+ class XView:
592
+ @overload
593
+ def xview(self) -> tuple[float, float]: ...
594
+ @overload
595
+ def xview(self, *args): ...
596
+ def xview_moveto(self, fraction: float) -> None: ...
597
+ @overload
598
+ def xview_scroll(self, number: int, what: Literal["units", "pages"]) -> None: ...
599
+ @overload
600
+ def xview_scroll(self, number: _ScreenUnits, what: Literal["pixels"]) -> None: ...
601
+
602
+ class YView:
603
+ @overload
604
+ def yview(self) -> tuple[float, float]: ...
605
+ @overload
606
+ def yview(self, *args): ...
607
+ def yview_moveto(self, fraction: float) -> None: ...
608
+ @overload
609
+ def yview_scroll(self, number: int, what: Literal["units", "pages"]) -> None: ...
610
+ @overload
611
+ def yview_scroll(self, number: _ScreenUnits, what: Literal["pixels"]) -> None: ...
612
+
613
+ class Wm:
614
+ @overload
615
+ def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ...
616
+ @overload
617
+ def wm_aspect(
618
+ self, minNumer: None = None, minDenom: None = None, maxNumer: None = None, maxDenom: None = None
619
+ ) -> tuple[int, int, int, int] | None: ...
620
+ aspect = wm_aspect
621
+ @overload
622
+ def wm_attributes(self) -> tuple[Any, ...]: ...
623
+ @overload
624
+ def wm_attributes(self, __option: str): ...
625
+ @overload
626
+ def wm_attributes(self, __option: str, __value, *__other_option_value_pairs: Any) -> None: ...
627
+ attributes = wm_attributes
628
+ def wm_client(self, name: str | None = None) -> str: ...
629
+ client = wm_client
630
+ @overload
631
+ def wm_colormapwindows(self) -> list[Misc]: ...
632
+ @overload
633
+ def wm_colormapwindows(self, __wlist: list[Misc] | tuple[Misc, ...]) -> None: ...
634
+ @overload
635
+ def wm_colormapwindows(self, __first_wlist_item: Misc, *other_wlist_items: Misc) -> None: ...
636
+ colormapwindows = wm_colormapwindows
637
+ def wm_command(self, value: str | None = None) -> str: ...
638
+ command = wm_command
639
+ # Some of these always return empty string, but return type is set to None to prevent accidentally using it
640
+ def wm_deiconify(self) -> None: ...
641
+ deiconify = wm_deiconify
642
+ def wm_focusmodel(self, model: Literal["active", "passive"] | None = None) -> Literal["active", "passive", ""]: ...
643
+ focusmodel = wm_focusmodel
644
+ def wm_forget(self, window: Wm) -> None: ...
645
+ forget = wm_forget
646
+ def wm_frame(self) -> str: ...
647
+ frame = wm_frame
648
+ @overload
649
+ def wm_geometry(self, newGeometry: None = None) -> str: ...
650
+ @overload
651
+ def wm_geometry(self, newGeometry: str) -> None: ...
652
+ geometry = wm_geometry
653
+ def wm_grid(
654
+ self,
655
+ baseWidth: Incomplete | None = None,
656
+ baseHeight: Incomplete | None = None,
657
+ widthInc: Incomplete | None = None,
658
+ heightInc: Incomplete | None = None,
659
+ ): ...
660
+ grid = wm_grid
661
+ def wm_group(self, pathName: Incomplete | None = None): ...
662
+ group = wm_group
663
+ def wm_iconbitmap(self, bitmap: Incomplete | None = None, default: Incomplete | None = None): ...
664
+ iconbitmap = wm_iconbitmap
665
+ def wm_iconify(self) -> None: ...
666
+ iconify = wm_iconify
667
+ def wm_iconmask(self, bitmap: Incomplete | None = None): ...
668
+ iconmask = wm_iconmask
669
+ def wm_iconname(self, newName: Incomplete | None = None) -> str: ...
670
+ iconname = wm_iconname
671
+ def wm_iconphoto(self, default: bool, __image1: _PhotoImageLike | str, *args: _PhotoImageLike | str) -> None: ...
672
+ iconphoto = wm_iconphoto
673
+ def wm_iconposition(self, x: int | None = None, y: int | None = None) -> tuple[int, int] | None: ...
674
+ iconposition = wm_iconposition
675
+ def wm_iconwindow(self, pathName: Incomplete | None = None): ...
676
+ iconwindow = wm_iconwindow
677
+ def wm_manage(self, widget) -> None: ...
678
+ manage = wm_manage
679
+ @overload
680
+ def wm_maxsize(self, width: None = None, height: None = None) -> tuple[int, int]: ...
681
+ @overload
682
+ def wm_maxsize(self, width: int, height: int) -> None: ...
683
+ maxsize = wm_maxsize
684
+ @overload
685
+ def wm_minsize(self, width: None = None, height: None = None) -> tuple[int, int]: ...
686
+ @overload
687
+ def wm_minsize(self, width: int, height: int) -> None: ...
688
+ minsize = wm_minsize
689
+ @overload
690
+ def wm_overrideredirect(self, boolean: None = None) -> bool | None: ... # returns True or None
691
+ @overload
692
+ def wm_overrideredirect(self, boolean: bool) -> None: ...
693
+ overrideredirect = wm_overrideredirect
694
+ def wm_positionfrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ...
695
+ positionfrom = wm_positionfrom
696
+ @overload
697
+ def wm_protocol(self, name: str, func: Callable[[], object] | str) -> None: ...
698
+ @overload
699
+ def wm_protocol(self, name: str, func: None = None) -> str: ...
700
+ @overload
701
+ def wm_protocol(self, name: None = None, func: None = None) -> tuple[str, ...]: ...
702
+ protocol = wm_protocol
703
+ @overload
704
+ def wm_resizable(self, width: None = None, height: None = None) -> tuple[bool, bool]: ...
705
+ @overload
706
+ def wm_resizable(self, width: bool, height: bool) -> None: ...
707
+ resizable = wm_resizable
708
+ def wm_sizefrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ...
709
+ sizefrom = wm_sizefrom
710
+ @overload
711
+ def wm_state(self, newstate: None = None) -> str: ...
712
+ @overload
713
+ def wm_state(self, newstate: str) -> None: ...
714
+ state = wm_state
715
+ @overload
716
+ def wm_title(self, string: None = None) -> str: ...
717
+ @overload
718
+ def wm_title(self, string: str) -> None: ...
719
+ title = wm_title
720
+ @overload
721
+ def wm_transient(self, master: None = None) -> _tkinter.Tcl_Obj: ...
722
+ @overload
723
+ def wm_transient(self, master: Wm | _tkinter.Tcl_Obj) -> None: ...
724
+ transient = wm_transient
725
+ def wm_withdraw(self) -> None: ...
726
+ withdraw = wm_withdraw
727
+
728
+ class Tk(Misc, Wm):
729
+ master: None
730
+ def __init__(
731
+ # Make sure to keep in sync with other functions that use the same
732
+ # args.
733
+ # use `git grep screenName` to find them
734
+ self,
735
+ screenName: str | None = None,
736
+ baseName: str | None = None,
737
+ className: str = "Tk",
738
+ useTk: bool = True,
739
+ sync: bool = False,
740
+ use: str | None = None,
741
+ ) -> None: ...
742
+ @overload
743
+ def configure(
744
+ self,
745
+ cnf: dict[str, Any] | None = None,
746
+ *,
747
+ background: str = ...,
748
+ bd: _ScreenUnits = ...,
749
+ bg: str = ...,
750
+ border: _ScreenUnits = ...,
751
+ borderwidth: _ScreenUnits = ...,
752
+ cursor: _Cursor = ...,
753
+ height: _ScreenUnits = ...,
754
+ highlightbackground: str = ...,
755
+ highlightcolor: str = ...,
756
+ highlightthickness: _ScreenUnits = ...,
757
+ menu: Menu = ...,
758
+ padx: _ScreenUnits = ...,
759
+ pady: _ScreenUnits = ...,
760
+ relief: _Relief = ...,
761
+ takefocus: _TakeFocusValue = ...,
762
+ width: _ScreenUnits = ...,
763
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
764
+ @overload
765
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
766
+ config = configure
767
+ def destroy(self) -> None: ...
768
+ def readprofile(self, baseName: str, className: str) -> None: ...
769
+ report_callback_exception: Callable[[type[BaseException], BaseException, TracebackType | None], object]
770
+ # Tk has __getattr__ so that tk_instance.foo falls back to tk_instance.tk.foo
771
+ # Please keep in sync with _tkinter.TkappType.
772
+ # Some methods are intentionally missing because they are inherited from Misc instead.
773
+ def adderrorinfo(self, __msg): ...
774
+ def call(self, __command: Any, *args: Any) -> Any: ...
775
+ def createcommand(self, __name, __func): ...
776
+ if sys.platform != "win32":
777
+ def createfilehandler(self, __file, __mask, __func): ...
778
+ def deletefilehandler(self, __file): ...
779
+
780
+ def createtimerhandler(self, __milliseconds, __func): ...
781
+ def dooneevent(self, __flags: int = ...): ...
782
+ def eval(self, __script: str) -> str: ...
783
+ def evalfile(self, __fileName): ...
784
+ def exprboolean(self, __s): ...
785
+ def exprdouble(self, __s): ...
786
+ def exprlong(self, __s): ...
787
+ def exprstring(self, __s): ...
788
+ def globalgetvar(self, *args, **kwargs): ...
789
+ def globalsetvar(self, *args, **kwargs): ...
790
+ def globalunsetvar(self, *args, **kwargs): ...
791
+ def interpaddr(self): ...
792
+ def loadtk(self) -> None: ...
793
+ def record(self, __script): ...
794
+ if sys.version_info < (3, 11):
795
+ def split(self, __arg): ...
796
+
797
+ def splitlist(self, __arg): ...
798
+ def unsetvar(self, *args, **kwargs): ...
799
+ def wantobjects(self, *args, **kwargs): ...
800
+ def willdispatch(self): ...
801
+
802
+ def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = "Tk", useTk: bool = False) -> Tk: ...
803
+
804
+ _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc})
805
+ _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False)
806
+
807
+ class _PackInfo(_InMiscTotal):
808
+ # 'before' and 'after' never appear in _PackInfo
809
+ anchor: _Anchor
810
+ expand: bool
811
+ fill: Literal["none", "x", "y", "both"]
812
+ side: Literal["left", "right", "top", "bottom"]
813
+ # Paddings come out as int or tuple of int, even though any _ScreenUnits
814
+ # can be specified in pack().
815
+ ipadx: int
816
+ ipady: int
817
+ padx: int | tuple[int, int]
818
+ pady: int | tuple[int, int]
819
+
820
+ class Pack:
821
+ # _PackInfo is not the valid type for cnf because pad stuff accepts any
822
+ # _ScreenUnits instead of int only. I didn't bother to create another
823
+ # TypedDict for cnf because it appears to be a legacy thing that was
824
+ # replaced by **kwargs.
825
+ def pack_configure(
826
+ self,
827
+ cnf: Mapping[str, Any] | None = {},
828
+ *,
829
+ after: Misc = ...,
830
+ anchor: _Anchor = ...,
831
+ before: Misc = ...,
832
+ expand: int = ...,
833
+ fill: Literal["none", "x", "y", "both"] = ...,
834
+ side: Literal["left", "right", "top", "bottom"] = ...,
835
+ ipadx: _ScreenUnits = ...,
836
+ ipady: _ScreenUnits = ...,
837
+ padx: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
838
+ pady: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
839
+ in_: Misc = ...,
840
+ **kw: Any, # allow keyword argument named 'in', see #4836
841
+ ) -> None: ...
842
+ def pack_forget(self) -> None: ...
843
+ def pack_info(self) -> _PackInfo: ... # errors if widget hasn't been packed
844
+ pack = pack_configure
845
+ forget = pack_forget
846
+ propagate = Misc.pack_propagate
847
+
848
+ class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed
849
+ anchor: _Anchor
850
+ bordermode: Literal["inside", "outside", "ignore"]
851
+ width: str # can be int()ed (even after e.g. widget.place(height='2.3c') or similar)
852
+ height: str # can be int()ed
853
+ x: str # can be int()ed
854
+ y: str # can be int()ed
855
+ relheight: str # can be float()ed if not empty string
856
+ relwidth: str # can be float()ed if not empty string
857
+ relx: str # can be float()ed if not empty string
858
+ rely: str # can be float()ed if not empty string
859
+
860
+ class Place:
861
+ def place_configure(
862
+ self,
863
+ cnf: Mapping[str, Any] | None = {},
864
+ *,
865
+ anchor: _Anchor = ...,
866
+ bordermode: Literal["inside", "outside", "ignore"] = ...,
867
+ width: _ScreenUnits = ...,
868
+ height: _ScreenUnits = ...,
869
+ x: _ScreenUnits = ...,
870
+ y: _ScreenUnits = ...,
871
+ # str allowed for compatibility with place_info()
872
+ relheight: str | float = ...,
873
+ relwidth: str | float = ...,
874
+ relx: str | float = ...,
875
+ rely: str | float = ...,
876
+ in_: Misc = ...,
877
+ **kw: Any, # allow keyword argument named 'in', see #4836
878
+ ) -> None: ...
879
+ def place_forget(self) -> None: ...
880
+ def place_info(self) -> _PlaceInfo: ...
881
+ place = place_configure
882
+ info = place_info
883
+
884
+ class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded
885
+ column: int
886
+ columnspan: int
887
+ row: int
888
+ rowspan: int
889
+ ipadx: int
890
+ ipady: int
891
+ padx: int | tuple[int, int]
892
+ pady: int | tuple[int, int]
893
+ sticky: str # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty
894
+
895
+ class Grid:
896
+ def grid_configure(
897
+ self,
898
+ cnf: Mapping[str, Any] | None = {},
899
+ *,
900
+ column: int = ...,
901
+ columnspan: int = ...,
902
+ row: int = ...,
903
+ rowspan: int = ...,
904
+ ipadx: _ScreenUnits = ...,
905
+ ipady: _ScreenUnits = ...,
906
+ padx: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
907
+ pady: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ...,
908
+ sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty
909
+ in_: Misc = ...,
910
+ **kw: Any, # allow keyword argument named 'in', see #4836
911
+ ) -> None: ...
912
+ def grid_forget(self) -> None: ...
913
+ def grid_remove(self) -> None: ...
914
+ def grid_info(self) -> _GridInfo: ...
915
+ grid = grid_configure
916
+ location = Misc.grid_location
917
+ size = Misc.grid_size
918
+
919
+ class BaseWidget(Misc):
920
+ master: Misc
921
+ widgetName: Incomplete
922
+ def __init__(self, master, widgetName, cnf={}, kw={}, extra=()) -> None: ...
923
+ def destroy(self) -> None: ...
924
+
925
+ # This class represents any widget except Toplevel or Tk.
926
+ class Widget(BaseWidget, Pack, Place, Grid):
927
+ # Allow bind callbacks to take e.g. Event[Label] instead of Event[Misc].
928
+ # Tk and Toplevel get notified for their child widgets' events, but other
929
+ # widgets don't.
930
+ @overload
931
+ def bind(
932
+ self: _W,
933
+ sequence: str | None = None,
934
+ func: Callable[[Event[_W]], object] | None = None,
935
+ add: Literal["", "+"] | bool | None = None,
936
+ ) -> str: ...
937
+ @overload
938
+ def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
939
+ @overload
940
+ def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
941
+
942
+ class Toplevel(BaseWidget, Wm):
943
+ # Toplevel and Tk have the same options because they correspond to the same
944
+ # Tcl/Tk toplevel widget. For some reason, config and configure must be
945
+ # copy/pasted here instead of aliasing as 'config = Tk.config'.
946
+ def __init__(
947
+ self,
948
+ master: Misc | None = None,
949
+ cnf: dict[str, Any] | None = {},
950
+ *,
951
+ background: str = ...,
952
+ bd: _ScreenUnits = ...,
953
+ bg: str = ...,
954
+ border: _ScreenUnits = ...,
955
+ borderwidth: _ScreenUnits = ...,
956
+ class_: str = ...,
957
+ colormap: Literal["new", ""] | Misc = ...,
958
+ container: bool = ...,
959
+ cursor: _Cursor = ...,
960
+ height: _ScreenUnits = ...,
961
+ highlightbackground: str = ...,
962
+ highlightcolor: str = ...,
963
+ highlightthickness: _ScreenUnits = ...,
964
+ menu: Menu = ...,
965
+ name: str = ...,
966
+ padx: _ScreenUnits = ...,
967
+ pady: _ScreenUnits = ...,
968
+ relief: _Relief = ...,
969
+ screen: str = ..., # can't be changed after creating widget
970
+ takefocus: _TakeFocusValue = ...,
971
+ use: int = ...,
972
+ visual: str | tuple[str, int] = ...,
973
+ width: _ScreenUnits = ...,
974
+ ) -> None: ...
975
+ @overload
976
+ def configure(
977
+ self,
978
+ cnf: dict[str, Any] | None = None,
979
+ *,
980
+ background: str = ...,
981
+ bd: _ScreenUnits = ...,
982
+ bg: str = ...,
983
+ border: _ScreenUnits = ...,
984
+ borderwidth: _ScreenUnits = ...,
985
+ cursor: _Cursor = ...,
986
+ height: _ScreenUnits = ...,
987
+ highlightbackground: str = ...,
988
+ highlightcolor: str = ...,
989
+ highlightthickness: _ScreenUnits = ...,
990
+ menu: Menu = ...,
991
+ padx: _ScreenUnits = ...,
992
+ pady: _ScreenUnits = ...,
993
+ relief: _Relief = ...,
994
+ takefocus: _TakeFocusValue = ...,
995
+ width: _ScreenUnits = ...,
996
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
997
+ @overload
998
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
999
+ config = configure
1000
+
1001
+ class Button(Widget):
1002
+ def __init__(
1003
+ self,
1004
+ master: Misc | None = None,
1005
+ cnf: dict[str, Any] | None = {},
1006
+ *,
1007
+ activebackground: str = ...,
1008
+ activeforeground: str = ...,
1009
+ anchor: _Anchor = ...,
1010
+ background: str = ...,
1011
+ bd: _ScreenUnits = ..., # same as borderwidth
1012
+ bg: str = ..., # same as background
1013
+ bitmap: str = ...,
1014
+ border: _ScreenUnits = ..., # same as borderwidth
1015
+ borderwidth: _ScreenUnits = ...,
1016
+ command: _ButtonCommand = ...,
1017
+ compound: _Compound = ...,
1018
+ cursor: _Cursor = ...,
1019
+ default: Literal["normal", "active", "disabled"] = ...,
1020
+ disabledforeground: str = ...,
1021
+ fg: str = ..., # same as foreground
1022
+ font: _FontDescription = ...,
1023
+ foreground: str = ...,
1024
+ # width and height must be int for buttons containing just text, but
1025
+ # ints are also valid _ScreenUnits
1026
+ height: _ScreenUnits = ...,
1027
+ highlightbackground: str = ...,
1028
+ highlightcolor: str = ...,
1029
+ highlightthickness: _ScreenUnits = ...,
1030
+ image: _ImageSpec = ...,
1031
+ justify: Literal["left", "center", "right"] = ...,
1032
+ name: str = ...,
1033
+ overrelief: _Relief = ...,
1034
+ padx: _ScreenUnits = ...,
1035
+ pady: _ScreenUnits = ...,
1036
+ relief: _Relief = ...,
1037
+ repeatdelay: int = ...,
1038
+ repeatinterval: int = ...,
1039
+ state: Literal["normal", "active", "disabled"] = ...,
1040
+ takefocus: _TakeFocusValue = ...,
1041
+ text: float | str = ...,
1042
+ # We allow the textvariable to be any Variable, not necessarily
1043
+ # StringVar. This is useful for e.g. a button that displays the value
1044
+ # of an IntVar.
1045
+ textvariable: Variable = ...,
1046
+ underline: int = ...,
1047
+ width: _ScreenUnits = ...,
1048
+ wraplength: _ScreenUnits = ...,
1049
+ ) -> None: ...
1050
+ @overload
1051
+ def configure(
1052
+ self,
1053
+ cnf: dict[str, Any] | None = None,
1054
+ *,
1055
+ activebackground: str = ...,
1056
+ activeforeground: str = ...,
1057
+ anchor: _Anchor = ...,
1058
+ background: str = ...,
1059
+ bd: _ScreenUnits = ...,
1060
+ bg: str = ...,
1061
+ bitmap: str = ...,
1062
+ border: _ScreenUnits = ...,
1063
+ borderwidth: _ScreenUnits = ...,
1064
+ command: _ButtonCommand = ...,
1065
+ compound: _Compound = ...,
1066
+ cursor: _Cursor = ...,
1067
+ default: Literal["normal", "active", "disabled"] = ...,
1068
+ disabledforeground: str = ...,
1069
+ fg: str = ...,
1070
+ font: _FontDescription = ...,
1071
+ foreground: str = ...,
1072
+ height: _ScreenUnits = ...,
1073
+ highlightbackground: str = ...,
1074
+ highlightcolor: str = ...,
1075
+ highlightthickness: _ScreenUnits = ...,
1076
+ image: _ImageSpec = ...,
1077
+ justify: Literal["left", "center", "right"] = ...,
1078
+ overrelief: _Relief = ...,
1079
+ padx: _ScreenUnits = ...,
1080
+ pady: _ScreenUnits = ...,
1081
+ relief: _Relief = ...,
1082
+ repeatdelay: int = ...,
1083
+ repeatinterval: int = ...,
1084
+ state: Literal["normal", "active", "disabled"] = ...,
1085
+ takefocus: _TakeFocusValue = ...,
1086
+ text: float | str = ...,
1087
+ textvariable: Variable = ...,
1088
+ underline: int = ...,
1089
+ width: _ScreenUnits = ...,
1090
+ wraplength: _ScreenUnits = ...,
1091
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1092
+ @overload
1093
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1094
+ config = configure
1095
+ def flash(self) -> None: ...
1096
+ def invoke(self) -> Any: ...
1097
+
1098
+ class Canvas(Widget, XView, YView):
1099
+ def __init__(
1100
+ self,
1101
+ master: Misc | None = None,
1102
+ cnf: dict[str, Any] | None = {},
1103
+ *,
1104
+ background: str = ...,
1105
+ bd: _ScreenUnits = ...,
1106
+ bg: str = ...,
1107
+ border: _ScreenUnits = ...,
1108
+ borderwidth: _ScreenUnits = ...,
1109
+ closeenough: float = ...,
1110
+ confine: bool = ...,
1111
+ cursor: _Cursor = ...,
1112
+ # canvas manual page has a section named COORDINATES, and the first
1113
+ # part of it describes _ScreenUnits.
1114
+ height: _ScreenUnits = ...,
1115
+ highlightbackground: str = ...,
1116
+ highlightcolor: str = ...,
1117
+ highlightthickness: _ScreenUnits = ...,
1118
+ insertbackground: str = ...,
1119
+ insertborderwidth: _ScreenUnits = ...,
1120
+ insertofftime: int = ...,
1121
+ insertontime: int = ...,
1122
+ insertwidth: _ScreenUnits = ...,
1123
+ name: str = ...,
1124
+ offset=..., # undocumented
1125
+ relief: _Relief = ...,
1126
+ # Setting scrollregion to None doesn't reset it back to empty,
1127
+ # but setting it to () does.
1128
+ scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = ...,
1129
+ selectbackground: str = ...,
1130
+ selectborderwidth: _ScreenUnits = ...,
1131
+ selectforeground: str = ...,
1132
+ # man page says that state can be 'hidden', but it can't
1133
+ state: Literal["normal", "disabled"] = ...,
1134
+ takefocus: _TakeFocusValue = ...,
1135
+ width: _ScreenUnits = ...,
1136
+ xscrollcommand: _XYScrollCommand = ...,
1137
+ xscrollincrement: _ScreenUnits = ...,
1138
+ yscrollcommand: _XYScrollCommand = ...,
1139
+ yscrollincrement: _ScreenUnits = ...,
1140
+ ) -> None: ...
1141
+ @overload
1142
+ def configure(
1143
+ self,
1144
+ cnf: dict[str, Any] | None = None,
1145
+ *,
1146
+ background: str = ...,
1147
+ bd: _ScreenUnits = ...,
1148
+ bg: str = ...,
1149
+ border: _ScreenUnits = ...,
1150
+ borderwidth: _ScreenUnits = ...,
1151
+ closeenough: float = ...,
1152
+ confine: bool = ...,
1153
+ cursor: _Cursor = ...,
1154
+ height: _ScreenUnits = ...,
1155
+ highlightbackground: str = ...,
1156
+ highlightcolor: str = ...,
1157
+ highlightthickness: _ScreenUnits = ...,
1158
+ insertbackground: str = ...,
1159
+ insertborderwidth: _ScreenUnits = ...,
1160
+ insertofftime: int = ...,
1161
+ insertontime: int = ...,
1162
+ insertwidth: _ScreenUnits = ...,
1163
+ offset=..., # undocumented
1164
+ relief: _Relief = ...,
1165
+ scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = ...,
1166
+ selectbackground: str = ...,
1167
+ selectborderwidth: _ScreenUnits = ...,
1168
+ selectforeground: str = ...,
1169
+ state: Literal["normal", "disabled"] = ...,
1170
+ takefocus: _TakeFocusValue = ...,
1171
+ width: _ScreenUnits = ...,
1172
+ xscrollcommand: _XYScrollCommand = ...,
1173
+ xscrollincrement: _ScreenUnits = ...,
1174
+ yscrollcommand: _XYScrollCommand = ...,
1175
+ yscrollincrement: _ScreenUnits = ...,
1176
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1177
+ @overload
1178
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1179
+ config = configure
1180
+ def addtag(self, *args): ... # internal method
1181
+ def addtag_above(self, newtag: str, tagOrId: str | int) -> None: ...
1182
+ def addtag_all(self, newtag: str) -> None: ...
1183
+ def addtag_below(self, newtag: str, tagOrId: str | int) -> None: ...
1184
+ def addtag_closest(
1185
+ self, newtag: str, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | int | None = None
1186
+ ) -> None: ...
1187
+ def addtag_enclosed(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ...
1188
+ def addtag_overlapping(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ...
1189
+ def addtag_withtag(self, newtag: str, tagOrId: str | int) -> None: ...
1190
+ def find(self, *args): ... # internal method
1191
+ def find_above(self, tagOrId: str | int) -> tuple[int, ...]: ...
1192
+ def find_all(self) -> tuple[int, ...]: ...
1193
+ def find_below(self, tagOrId: str | int) -> tuple[int, ...]: ...
1194
+ def find_closest(
1195
+ self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | int | None = None
1196
+ ) -> tuple[int, ...]: ...
1197
+ def find_enclosed(self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> tuple[int, ...]: ...
1198
+ def find_overlapping(self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: float) -> tuple[int, ...]: ...
1199
+ def find_withtag(self, tagOrId: str | int) -> tuple[int, ...]: ...
1200
+ # Incompatible with Misc.bbox(), tkinter violates LSP
1201
+ def bbox(self, *args: str | int) -> tuple[int, int, int, int]: ... # type: ignore[override]
1202
+ @overload
1203
+ def tag_bind(
1204
+ self,
1205
+ tagOrId: str | int,
1206
+ sequence: str | None = None,
1207
+ func: Callable[[Event[Canvas]], object] | None = None,
1208
+ add: Literal["", "+"] | bool | None = None,
1209
+ ) -> str: ...
1210
+ @overload
1211
+ def tag_bind(
1212
+ self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None
1213
+ ) -> None: ...
1214
+ @overload
1215
+ def tag_bind(self, tagOrId: str | int, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
1216
+ def tag_unbind(self, tagOrId: str | int, sequence: str, funcid: str | None = None) -> None: ...
1217
+ def canvasx(self, screenx, gridspacing: Incomplete | None = None): ...
1218
+ def canvasy(self, screeny, gridspacing: Incomplete | None = None): ...
1219
+ @overload
1220
+ def coords(self, __tagOrId: str | int) -> list[float]: ...
1221
+ @overload
1222
+ def coords(self, __tagOrId: str | int, __args: list[int] | list[float] | tuple[float, ...]) -> None: ...
1223
+ @overload
1224
+ def coords(self, __tagOrId: str | int, __x1: float, __y1: float, *args: float) -> None: ...
1225
+ # create_foo() methods accept coords as a list or tuple, or as separate arguments.
1226
+ # Lists and tuples can be flat as in [1, 2, 3, 4], or nested as in [(1, 2), (3, 4)].
1227
+ # Keyword arguments should be the same in all overloads of each method.
1228
+ def create_arc(self, *args, **kw) -> int: ...
1229
+ def create_bitmap(self, *args, **kw) -> int: ...
1230
+ def create_image(self, *args, **kw) -> int: ...
1231
+ @overload
1232
+ def create_line(
1233
+ self,
1234
+ __x0: float,
1235
+ __y0: float,
1236
+ __x1: float,
1237
+ __y1: float,
1238
+ *,
1239
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1240
+ activefill: str = ...,
1241
+ activestipple: str = ...,
1242
+ activewidth: _ScreenUnits = ...,
1243
+ arrow: Literal["first", "last", "both"] = ...,
1244
+ arrowshape: tuple[float, float, float] = ...,
1245
+ capstyle: Literal["round", "projecting", "butt"] = ...,
1246
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1247
+ dashoffset: _ScreenUnits = ...,
1248
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1249
+ disabledfill: str = ...,
1250
+ disabledstipple: str = ...,
1251
+ disabledwidth: _ScreenUnits = ...,
1252
+ fill: str = ...,
1253
+ joinstyle: Literal["round", "bevel", "miter"] = ...,
1254
+ offset: _ScreenUnits = ...,
1255
+ smooth: bool = ...,
1256
+ splinesteps: float = ...,
1257
+ state: Literal["normal", "hidden", "disabled"] = ...,
1258
+ stipple: str = ...,
1259
+ tags: str | list[str] | tuple[str, ...] = ...,
1260
+ width: _ScreenUnits = ...,
1261
+ ) -> int: ...
1262
+ @overload
1263
+ def create_line(
1264
+ self,
1265
+ __xy_pair_0: tuple[float, float],
1266
+ __xy_pair_1: tuple[float, float],
1267
+ *,
1268
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1269
+ activefill: str = ...,
1270
+ activestipple: str = ...,
1271
+ activewidth: _ScreenUnits = ...,
1272
+ arrow: Literal["first", "last", "both"] = ...,
1273
+ arrowshape: tuple[float, float, float] = ...,
1274
+ capstyle: Literal["round", "projecting", "butt"] = ...,
1275
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1276
+ dashoffset: _ScreenUnits = ...,
1277
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1278
+ disabledfill: str = ...,
1279
+ disabledstipple: str = ...,
1280
+ disabledwidth: _ScreenUnits = ...,
1281
+ fill: str = ...,
1282
+ joinstyle: Literal["round", "bevel", "miter"] = ...,
1283
+ offset: _ScreenUnits = ...,
1284
+ smooth: bool = ...,
1285
+ splinesteps: float = ...,
1286
+ state: Literal["normal", "hidden", "disabled"] = ...,
1287
+ stipple: str = ...,
1288
+ tags: str | list[str] | tuple[str, ...] = ...,
1289
+ width: _ScreenUnits = ...,
1290
+ ) -> int: ...
1291
+ @overload
1292
+ def create_line(
1293
+ self,
1294
+ __coords: (
1295
+ tuple[float, float, float, float]
1296
+ | tuple[tuple[float, float], tuple[float, float]]
1297
+ | list[int]
1298
+ | list[float]
1299
+ | list[tuple[int, int]]
1300
+ | list[tuple[float, float]]
1301
+ ),
1302
+ *,
1303
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1304
+ activefill: str = ...,
1305
+ activestipple: str = ...,
1306
+ activewidth: _ScreenUnits = ...,
1307
+ arrow: Literal["first", "last", "both"] = ...,
1308
+ arrowshape: tuple[float, float, float] = ...,
1309
+ capstyle: Literal["round", "projecting", "butt"] = ...,
1310
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1311
+ dashoffset: _ScreenUnits = ...,
1312
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1313
+ disabledfill: str = ...,
1314
+ disabledstipple: str = ...,
1315
+ disabledwidth: _ScreenUnits = ...,
1316
+ fill: str = ...,
1317
+ joinstyle: Literal["round", "bevel", "miter"] = ...,
1318
+ offset: _ScreenUnits = ...,
1319
+ smooth: bool = ...,
1320
+ splinesteps: float = ...,
1321
+ state: Literal["normal", "hidden", "disabled"] = ...,
1322
+ stipple: str = ...,
1323
+ tags: str | list[str] | tuple[str, ...] = ...,
1324
+ width: _ScreenUnits = ...,
1325
+ ) -> int: ...
1326
+ @overload
1327
+ def create_oval(
1328
+ self,
1329
+ __x0: float,
1330
+ __y0: float,
1331
+ __x1: float,
1332
+ __y1: float,
1333
+ *,
1334
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1335
+ activefill: str = ...,
1336
+ activeoutline: str = ...,
1337
+ activeoutlinestipple: str = ...,
1338
+ activestipple: str = ...,
1339
+ activewidth: _ScreenUnits = ...,
1340
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1341
+ dashoffset: _ScreenUnits = ...,
1342
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1343
+ disabledfill: str = ...,
1344
+ disabledoutline: str = ...,
1345
+ disabledoutlinestipple: str = ...,
1346
+ disabledstipple: str = ...,
1347
+ disabledwidth: _ScreenUnits = ...,
1348
+ fill: str = ...,
1349
+ offset: _ScreenUnits = ...,
1350
+ outline: str = ...,
1351
+ outlineoffset: _ScreenUnits = ...,
1352
+ outlinestipple: str = ...,
1353
+ state: Literal["normal", "hidden", "disabled"] = ...,
1354
+ stipple: str = ...,
1355
+ tags: str | list[str] | tuple[str, ...] = ...,
1356
+ width: _ScreenUnits = ...,
1357
+ ) -> int: ...
1358
+ @overload
1359
+ def create_oval(
1360
+ self,
1361
+ __xy_pair_0: tuple[float, float],
1362
+ __xy_pair_1: tuple[float, float],
1363
+ *,
1364
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1365
+ activefill: str = ...,
1366
+ activeoutline: str = ...,
1367
+ activeoutlinestipple: str = ...,
1368
+ activestipple: str = ...,
1369
+ activewidth: _ScreenUnits = ...,
1370
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1371
+ dashoffset: _ScreenUnits = ...,
1372
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1373
+ disabledfill: str = ...,
1374
+ disabledoutline: str = ...,
1375
+ disabledoutlinestipple: str = ...,
1376
+ disabledstipple: str = ...,
1377
+ disabledwidth: _ScreenUnits = ...,
1378
+ fill: str = ...,
1379
+ offset: _ScreenUnits = ...,
1380
+ outline: str = ...,
1381
+ outlineoffset: _ScreenUnits = ...,
1382
+ outlinestipple: str = ...,
1383
+ state: Literal["normal", "hidden", "disabled"] = ...,
1384
+ stipple: str = ...,
1385
+ tags: str | list[str] | tuple[str, ...] = ...,
1386
+ width: _ScreenUnits = ...,
1387
+ ) -> int: ...
1388
+ @overload
1389
+ def create_oval(
1390
+ self,
1391
+ __coords: (
1392
+ tuple[float, float, float, float]
1393
+ | tuple[tuple[float, float], tuple[float, float]]
1394
+ | list[int]
1395
+ | list[float]
1396
+ | list[tuple[int, int]]
1397
+ | list[tuple[float, float]]
1398
+ ),
1399
+ *,
1400
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1401
+ activefill: str = ...,
1402
+ activeoutline: str = ...,
1403
+ activeoutlinestipple: str = ...,
1404
+ activestipple: str = ...,
1405
+ activewidth: _ScreenUnits = ...,
1406
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1407
+ dashoffset: _ScreenUnits = ...,
1408
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1409
+ disabledfill: str = ...,
1410
+ disabledoutline: str = ...,
1411
+ disabledoutlinestipple: str = ...,
1412
+ disabledstipple: str = ...,
1413
+ disabledwidth: _ScreenUnits = ...,
1414
+ fill: str = ...,
1415
+ offset: _ScreenUnits = ...,
1416
+ outline: str = ...,
1417
+ outlineoffset: _ScreenUnits = ...,
1418
+ outlinestipple: str = ...,
1419
+ state: Literal["normal", "hidden", "disabled"] = ...,
1420
+ stipple: str = ...,
1421
+ tags: str | list[str] | tuple[str, ...] = ...,
1422
+ width: _ScreenUnits = ...,
1423
+ ) -> int: ...
1424
+ @overload
1425
+ def create_polygon(
1426
+ self,
1427
+ __x0: float,
1428
+ __y0: float,
1429
+ __x1: float,
1430
+ __y1: float,
1431
+ *xy_pairs: float,
1432
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1433
+ activefill: str = ...,
1434
+ activeoutline: str = ...,
1435
+ activeoutlinestipple: str = ...,
1436
+ activestipple: str = ...,
1437
+ activewidth: _ScreenUnits = ...,
1438
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1439
+ dashoffset: _ScreenUnits = ...,
1440
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1441
+ disabledfill: str = ...,
1442
+ disabledoutline: str = ...,
1443
+ disabledoutlinestipple: str = ...,
1444
+ disabledstipple: str = ...,
1445
+ disabledwidth: _ScreenUnits = ...,
1446
+ fill: str = ...,
1447
+ joinstyle: Literal["round", "bevel", "miter"] = ...,
1448
+ offset: _ScreenUnits = ...,
1449
+ outline: str = ...,
1450
+ outlineoffset: _ScreenUnits = ...,
1451
+ outlinestipple: str = ...,
1452
+ smooth: bool = ...,
1453
+ splinesteps: float = ...,
1454
+ state: Literal["normal", "hidden", "disabled"] = ...,
1455
+ stipple: str = ...,
1456
+ tags: str | list[str] | tuple[str, ...] = ...,
1457
+ width: _ScreenUnits = ...,
1458
+ ) -> int: ...
1459
+ @overload
1460
+ def create_polygon(
1461
+ self,
1462
+ __xy_pair_0: tuple[float, float],
1463
+ __xy_pair_1: tuple[float, float],
1464
+ *xy_pairs: tuple[float, float],
1465
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1466
+ activefill: str = ...,
1467
+ activeoutline: str = ...,
1468
+ activeoutlinestipple: str = ...,
1469
+ activestipple: str = ...,
1470
+ activewidth: _ScreenUnits = ...,
1471
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1472
+ dashoffset: _ScreenUnits = ...,
1473
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1474
+ disabledfill: str = ...,
1475
+ disabledoutline: str = ...,
1476
+ disabledoutlinestipple: str = ...,
1477
+ disabledstipple: str = ...,
1478
+ disabledwidth: _ScreenUnits = ...,
1479
+ fill: str = ...,
1480
+ joinstyle: Literal["round", "bevel", "miter"] = ...,
1481
+ offset: _ScreenUnits = ...,
1482
+ outline: str = ...,
1483
+ outlineoffset: _ScreenUnits = ...,
1484
+ outlinestipple: str = ...,
1485
+ smooth: bool = ...,
1486
+ splinesteps: float = ...,
1487
+ state: Literal["normal", "hidden", "disabled"] = ...,
1488
+ stipple: str = ...,
1489
+ tags: str | list[str] | tuple[str, ...] = ...,
1490
+ width: _ScreenUnits = ...,
1491
+ ) -> int: ...
1492
+ @overload
1493
+ def create_polygon(
1494
+ self,
1495
+ __coords: (
1496
+ tuple[float, ...]
1497
+ | tuple[tuple[float, float], ...]
1498
+ | list[int]
1499
+ | list[float]
1500
+ | list[tuple[int, int]]
1501
+ | list[tuple[float, float]]
1502
+ ),
1503
+ *,
1504
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1505
+ activefill: str = ...,
1506
+ activeoutline: str = ...,
1507
+ activeoutlinestipple: str = ...,
1508
+ activestipple: str = ...,
1509
+ activewidth: _ScreenUnits = ...,
1510
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1511
+ dashoffset: _ScreenUnits = ...,
1512
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1513
+ disabledfill: str = ...,
1514
+ disabledoutline: str = ...,
1515
+ disabledoutlinestipple: str = ...,
1516
+ disabledstipple: str = ...,
1517
+ disabledwidth: _ScreenUnits = ...,
1518
+ fill: str = ...,
1519
+ joinstyle: Literal["round", "bevel", "miter"] = ...,
1520
+ offset: _ScreenUnits = ...,
1521
+ outline: str = ...,
1522
+ outlineoffset: _ScreenUnits = ...,
1523
+ outlinestipple: str = ...,
1524
+ smooth: bool = ...,
1525
+ splinesteps: float = ...,
1526
+ state: Literal["normal", "hidden", "disabled"] = ...,
1527
+ stipple: str = ...,
1528
+ tags: str | list[str] | tuple[str, ...] = ...,
1529
+ width: _ScreenUnits = ...,
1530
+ ) -> int: ...
1531
+ @overload
1532
+ def create_rectangle(
1533
+ self,
1534
+ __x0: float,
1535
+ __y0: float,
1536
+ __x1: float,
1537
+ __y1: float,
1538
+ *,
1539
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1540
+ activefill: str = ...,
1541
+ activeoutline: str = ...,
1542
+ activeoutlinestipple: str = ...,
1543
+ activestipple: str = ...,
1544
+ activewidth: _ScreenUnits = ...,
1545
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1546
+ dashoffset: _ScreenUnits = ...,
1547
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1548
+ disabledfill: str = ...,
1549
+ disabledoutline: str = ...,
1550
+ disabledoutlinestipple: str = ...,
1551
+ disabledstipple: str = ...,
1552
+ disabledwidth: _ScreenUnits = ...,
1553
+ fill: str = ...,
1554
+ offset: _ScreenUnits = ...,
1555
+ outline: str = ...,
1556
+ outlineoffset: _ScreenUnits = ...,
1557
+ outlinestipple: str = ...,
1558
+ state: Literal["normal", "hidden", "disabled"] = ...,
1559
+ stipple: str = ...,
1560
+ tags: str | list[str] | tuple[str, ...] = ...,
1561
+ width: _ScreenUnits = ...,
1562
+ ) -> int: ...
1563
+ @overload
1564
+ def create_rectangle(
1565
+ self,
1566
+ __xy_pair_0: tuple[float, float],
1567
+ __xy_pair_1: tuple[float, float],
1568
+ *,
1569
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1570
+ activefill: str = ...,
1571
+ activeoutline: str = ...,
1572
+ activeoutlinestipple: str = ...,
1573
+ activestipple: str = ...,
1574
+ activewidth: _ScreenUnits = ...,
1575
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1576
+ dashoffset: _ScreenUnits = ...,
1577
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1578
+ disabledfill: str = ...,
1579
+ disabledoutline: str = ...,
1580
+ disabledoutlinestipple: str = ...,
1581
+ disabledstipple: str = ...,
1582
+ disabledwidth: _ScreenUnits = ...,
1583
+ fill: str = ...,
1584
+ offset: _ScreenUnits = ...,
1585
+ outline: str = ...,
1586
+ outlineoffset: _ScreenUnits = ...,
1587
+ outlinestipple: str = ...,
1588
+ state: Literal["normal", "hidden", "disabled"] = ...,
1589
+ stipple: str = ...,
1590
+ tags: str | list[str] | tuple[str, ...] = ...,
1591
+ width: _ScreenUnits = ...,
1592
+ ) -> int: ...
1593
+ @overload
1594
+ def create_rectangle(
1595
+ self,
1596
+ __coords: (
1597
+ tuple[float, float, float, float]
1598
+ | tuple[tuple[float, float], tuple[float, float]]
1599
+ | list[int]
1600
+ | list[float]
1601
+ | list[tuple[int, int]]
1602
+ | list[tuple[float, float]]
1603
+ ),
1604
+ *,
1605
+ activedash: str | int | list[int] | tuple[int, ...] = ...,
1606
+ activefill: str = ...,
1607
+ activeoutline: str = ...,
1608
+ activeoutlinestipple: str = ...,
1609
+ activestipple: str = ...,
1610
+ activewidth: _ScreenUnits = ...,
1611
+ dash: str | int | list[int] | tuple[int, ...] = ...,
1612
+ dashoffset: _ScreenUnits = ...,
1613
+ disableddash: str | int | list[int] | tuple[int, ...] = ...,
1614
+ disabledfill: str = ...,
1615
+ disabledoutline: str = ...,
1616
+ disabledoutlinestipple: str = ...,
1617
+ disabledstipple: str = ...,
1618
+ disabledwidth: _ScreenUnits = ...,
1619
+ fill: str = ...,
1620
+ offset: _ScreenUnits = ...,
1621
+ outline: str = ...,
1622
+ outlineoffset: _ScreenUnits = ...,
1623
+ outlinestipple: str = ...,
1624
+ state: Literal["normal", "hidden", "disabled"] = ...,
1625
+ stipple: str = ...,
1626
+ tags: str | list[str] | tuple[str, ...] = ...,
1627
+ width: _ScreenUnits = ...,
1628
+ ) -> int: ...
1629
+ @overload
1630
+ def create_text(
1631
+ self,
1632
+ __x: float,
1633
+ __y: float,
1634
+ *,
1635
+ activefill: str = ...,
1636
+ activestipple: str = ...,
1637
+ anchor: _Anchor = ...,
1638
+ angle: float | str = ...,
1639
+ disabledfill: str = ...,
1640
+ disabledstipple: str = ...,
1641
+ fill: str = ...,
1642
+ font: _FontDescription = ...,
1643
+ justify: Literal["left", "center", "right"] = ...,
1644
+ offset: _ScreenUnits = ...,
1645
+ state: Literal["normal", "hidden", "disabled"] = ...,
1646
+ stipple: str = ...,
1647
+ tags: str | list[str] | tuple[str, ...] = ...,
1648
+ text: float | str = ...,
1649
+ width: _ScreenUnits = ...,
1650
+ ) -> int: ...
1651
+ @overload
1652
+ def create_text(
1653
+ self,
1654
+ __coords: tuple[float, float] | list[int] | list[float],
1655
+ *,
1656
+ activefill: str = ...,
1657
+ activestipple: str = ...,
1658
+ anchor: _Anchor = ...,
1659
+ angle: float | str = ...,
1660
+ disabledfill: str = ...,
1661
+ disabledstipple: str = ...,
1662
+ fill: str = ...,
1663
+ font: _FontDescription = ...,
1664
+ justify: Literal["left", "center", "right"] = ...,
1665
+ offset: _ScreenUnits = ...,
1666
+ state: Literal["normal", "hidden", "disabled"] = ...,
1667
+ stipple: str = ...,
1668
+ tags: str | list[str] | tuple[str, ...] = ...,
1669
+ text: float | str = ...,
1670
+ width: _ScreenUnits = ...,
1671
+ ) -> int: ...
1672
+ @overload
1673
+ def create_window(
1674
+ self,
1675
+ __x: float,
1676
+ __y: float,
1677
+ *,
1678
+ anchor: _Anchor = ...,
1679
+ height: _ScreenUnits = ...,
1680
+ state: Literal["normal", "hidden", "disabled"] = ...,
1681
+ tags: str | list[str] | tuple[str, ...] = ...,
1682
+ width: _ScreenUnits = ...,
1683
+ window: Widget = ...,
1684
+ ) -> int: ...
1685
+ @overload
1686
+ def create_window(
1687
+ self,
1688
+ __coords: tuple[float, float] | list[int] | list[float],
1689
+ *,
1690
+ anchor: _Anchor = ...,
1691
+ height: _ScreenUnits = ...,
1692
+ state: Literal["normal", "hidden", "disabled"] = ...,
1693
+ tags: str | list[str] | tuple[str, ...] = ...,
1694
+ width: _ScreenUnits = ...,
1695
+ window: Widget = ...,
1696
+ ) -> int: ...
1697
+ def dchars(self, *args) -> None: ...
1698
+ def delete(self, *tagsOrCanvasIds: str | int) -> None: ...
1699
+ @overload
1700
+ def dtag(self, __tag: str, __tag_to_delete: str | None = ...) -> None: ...
1701
+ @overload
1702
+ def dtag(self, __id: int, __tag_to_delete: str) -> None: ...
1703
+ def focus(self, *args): ...
1704
+ def gettags(self, __tagOrId: str | int) -> tuple[str, ...]: ...
1705
+ def icursor(self, *args) -> None: ...
1706
+ def index(self, *args): ...
1707
+ def insert(self, *args) -> None: ...
1708
+ def itemcget(self, tagOrId, option): ...
1709
+ # itemconfigure kwargs depend on item type, which is not known when type checking
1710
+ def itemconfigure(
1711
+ self, tagOrId: str | int, cnf: dict[str, Any] | None = None, **kw: Any
1712
+ ) -> dict[str, tuple[str, str, str, str, str]] | None: ...
1713
+ itemconfig = itemconfigure
1714
+ def move(self, *args) -> None: ...
1715
+ def moveto(self, tagOrId: str | int, x: Literal[""] | float = "", y: Literal[""] | float = "") -> None: ...
1716
+ def postscript(self, cnf={}, **kw): ...
1717
+ # tkinter does:
1718
+ # lower = tag_lower
1719
+ # lift = tkraise = tag_raise
1720
+ #
1721
+ # But mypy doesn't like aliasing here (maybe because Misc defines the same names)
1722
+ def tag_lower(self, __first: str | int, __second: str | int | None = ...) -> None: ...
1723
+ def lower(self, __first: str | int, __second: str | int | None = ...) -> None: ... # type: ignore[override]
1724
+ def tag_raise(self, __first: str | int, __second: str | int | None = ...) -> None: ...
1725
+ def tkraise(self, __first: str | int, __second: str | int | None = ...) -> None: ... # type: ignore[override]
1726
+ def lift(self, __first: str | int, __second: str | int | None = ...) -> None: ... # type: ignore[override]
1727
+ def scale(self, *args) -> None: ...
1728
+ def scan_mark(self, x, y) -> None: ...
1729
+ def scan_dragto(self, x, y, gain: int = 10) -> None: ...
1730
+ def select_adjust(self, tagOrId, index) -> None: ...
1731
+ def select_clear(self) -> None: ...
1732
+ def select_from(self, tagOrId, index) -> None: ...
1733
+ def select_item(self): ...
1734
+ def select_to(self, tagOrId, index) -> None: ...
1735
+ def type(self, tagOrId): ...
1736
+
1737
+ class Checkbutton(Widget):
1738
+ def __init__(
1739
+ self,
1740
+ master: Misc | None = None,
1741
+ cnf: dict[str, Any] | None = {},
1742
+ *,
1743
+ activebackground: str = ...,
1744
+ activeforeground: str = ...,
1745
+ anchor: _Anchor = ...,
1746
+ background: str = ...,
1747
+ bd: _ScreenUnits = ...,
1748
+ bg: str = ...,
1749
+ bitmap: str = ...,
1750
+ border: _ScreenUnits = ...,
1751
+ borderwidth: _ScreenUnits = ...,
1752
+ command: _ButtonCommand = ...,
1753
+ compound: _Compound = ...,
1754
+ cursor: _Cursor = ...,
1755
+ disabledforeground: str = ...,
1756
+ fg: str = ...,
1757
+ font: _FontDescription = ...,
1758
+ foreground: str = ...,
1759
+ height: _ScreenUnits = ...,
1760
+ highlightbackground: str = ...,
1761
+ highlightcolor: str = ...,
1762
+ highlightthickness: _ScreenUnits = ...,
1763
+ image: _ImageSpec = ...,
1764
+ indicatoron: bool = ...,
1765
+ justify: Literal["left", "center", "right"] = ...,
1766
+ name: str = ...,
1767
+ offrelief: _Relief = ...,
1768
+ # The checkbutton puts a value to its variable when it's checked or
1769
+ # unchecked. We don't restrict the type of that value here, so
1770
+ # Any-typing is fine.
1771
+ #
1772
+ # I think Checkbutton shouldn't be generic, because then specifying
1773
+ # "any checkbutton regardless of what variable it uses" would be
1774
+ # difficult, and we might run into issues just like how list[float]
1775
+ # and list[int] are incompatible. Also, we would need a way to
1776
+ # specify "Checkbutton not associated with any variable", which is
1777
+ # done by setting variable to empty string (the default).
1778
+ offvalue: Any = ...,
1779
+ onvalue: Any = ...,
1780
+ overrelief: _Relief = ...,
1781
+ padx: _ScreenUnits = ...,
1782
+ pady: _ScreenUnits = ...,
1783
+ relief: _Relief = ...,
1784
+ selectcolor: str = ...,
1785
+ selectimage: _ImageSpec = ...,
1786
+ state: Literal["normal", "active", "disabled"] = ...,
1787
+ takefocus: _TakeFocusValue = ...,
1788
+ text: float | str = ...,
1789
+ textvariable: Variable = ...,
1790
+ tristateimage: _ImageSpec = ...,
1791
+ tristatevalue: Any = ...,
1792
+ underline: int = ...,
1793
+ variable: Variable | Literal[""] = ...,
1794
+ width: _ScreenUnits = ...,
1795
+ wraplength: _ScreenUnits = ...,
1796
+ ) -> None: ...
1797
+ @overload
1798
+ def configure(
1799
+ self,
1800
+ cnf: dict[str, Any] | None = None,
1801
+ *,
1802
+ activebackground: str = ...,
1803
+ activeforeground: str = ...,
1804
+ anchor: _Anchor = ...,
1805
+ background: str = ...,
1806
+ bd: _ScreenUnits = ...,
1807
+ bg: str = ...,
1808
+ bitmap: str = ...,
1809
+ border: _ScreenUnits = ...,
1810
+ borderwidth: _ScreenUnits = ...,
1811
+ command: _ButtonCommand = ...,
1812
+ compound: _Compound = ...,
1813
+ cursor: _Cursor = ...,
1814
+ disabledforeground: str = ...,
1815
+ fg: str = ...,
1816
+ font: _FontDescription = ...,
1817
+ foreground: str = ...,
1818
+ height: _ScreenUnits = ...,
1819
+ highlightbackground: str = ...,
1820
+ highlightcolor: str = ...,
1821
+ highlightthickness: _ScreenUnits = ...,
1822
+ image: _ImageSpec = ...,
1823
+ indicatoron: bool = ...,
1824
+ justify: Literal["left", "center", "right"] = ...,
1825
+ offrelief: _Relief = ...,
1826
+ offvalue: Any = ...,
1827
+ onvalue: Any = ...,
1828
+ overrelief: _Relief = ...,
1829
+ padx: _ScreenUnits = ...,
1830
+ pady: _ScreenUnits = ...,
1831
+ relief: _Relief = ...,
1832
+ selectcolor: str = ...,
1833
+ selectimage: _ImageSpec = ...,
1834
+ state: Literal["normal", "active", "disabled"] = ...,
1835
+ takefocus: _TakeFocusValue = ...,
1836
+ text: float | str = ...,
1837
+ textvariable: Variable = ...,
1838
+ tristateimage: _ImageSpec = ...,
1839
+ tristatevalue: Any = ...,
1840
+ underline: int = ...,
1841
+ variable: Variable | Literal[""] = ...,
1842
+ width: _ScreenUnits = ...,
1843
+ wraplength: _ScreenUnits = ...,
1844
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1845
+ @overload
1846
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1847
+ config = configure
1848
+ def deselect(self) -> None: ...
1849
+ def flash(self) -> None: ...
1850
+ def invoke(self) -> Any: ...
1851
+ def select(self) -> None: ...
1852
+ def toggle(self) -> None: ...
1853
+
1854
+ _EntryIndex: TypeAlias = str | int # "INDICES" in manual page
1855
+
1856
+ class Entry(Widget, XView):
1857
+ def __init__(
1858
+ self,
1859
+ master: Misc | None = None,
1860
+ cnf: dict[str, Any] | None = {},
1861
+ *,
1862
+ background: str = ...,
1863
+ bd: _ScreenUnits = ...,
1864
+ bg: str = ...,
1865
+ border: _ScreenUnits = ...,
1866
+ borderwidth: _ScreenUnits = ...,
1867
+ cursor: _Cursor = ...,
1868
+ disabledbackground: str = ...,
1869
+ disabledforeground: str = ...,
1870
+ exportselection: bool = ...,
1871
+ fg: str = ...,
1872
+ font: _FontDescription = ...,
1873
+ foreground: str = ...,
1874
+ highlightbackground: str = ...,
1875
+ highlightcolor: str = ...,
1876
+ highlightthickness: _ScreenUnits = ...,
1877
+ insertbackground: str = ...,
1878
+ insertborderwidth: _ScreenUnits = ...,
1879
+ insertofftime: int = ...,
1880
+ insertontime: int = ...,
1881
+ insertwidth: _ScreenUnits = ...,
1882
+ invalidcommand: _EntryValidateCommand = ...,
1883
+ invcmd: _EntryValidateCommand = ..., # same as invalidcommand
1884
+ justify: Literal["left", "center", "right"] = ...,
1885
+ name: str = ...,
1886
+ readonlybackground: str = ...,
1887
+ relief: _Relief = ...,
1888
+ selectbackground: str = ...,
1889
+ selectborderwidth: _ScreenUnits = ...,
1890
+ selectforeground: str = ...,
1891
+ show: str = ...,
1892
+ state: Literal["normal", "disabled", "readonly"] = ...,
1893
+ takefocus: _TakeFocusValue = ...,
1894
+ textvariable: Variable = ...,
1895
+ validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
1896
+ validatecommand: _EntryValidateCommand = ...,
1897
+ vcmd: _EntryValidateCommand = ..., # same as validatecommand
1898
+ width: int = ...,
1899
+ xscrollcommand: _XYScrollCommand = ...,
1900
+ ) -> None: ...
1901
+ @overload
1902
+ def configure(
1903
+ self,
1904
+ cnf: dict[str, Any] | None = None,
1905
+ *,
1906
+ background: str = ...,
1907
+ bd: _ScreenUnits = ...,
1908
+ bg: str = ...,
1909
+ border: _ScreenUnits = ...,
1910
+ borderwidth: _ScreenUnits = ...,
1911
+ cursor: _Cursor = ...,
1912
+ disabledbackground: str = ...,
1913
+ disabledforeground: str = ...,
1914
+ exportselection: bool = ...,
1915
+ fg: str = ...,
1916
+ font: _FontDescription = ...,
1917
+ foreground: str = ...,
1918
+ highlightbackground: str = ...,
1919
+ highlightcolor: str = ...,
1920
+ highlightthickness: _ScreenUnits = ...,
1921
+ insertbackground: str = ...,
1922
+ insertborderwidth: _ScreenUnits = ...,
1923
+ insertofftime: int = ...,
1924
+ insertontime: int = ...,
1925
+ insertwidth: _ScreenUnits = ...,
1926
+ invalidcommand: _EntryValidateCommand = ...,
1927
+ invcmd: _EntryValidateCommand = ...,
1928
+ justify: Literal["left", "center", "right"] = ...,
1929
+ readonlybackground: str = ...,
1930
+ relief: _Relief = ...,
1931
+ selectbackground: str = ...,
1932
+ selectborderwidth: _ScreenUnits = ...,
1933
+ selectforeground: str = ...,
1934
+ show: str = ...,
1935
+ state: Literal["normal", "disabled", "readonly"] = ...,
1936
+ takefocus: _TakeFocusValue = ...,
1937
+ textvariable: Variable = ...,
1938
+ validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
1939
+ validatecommand: _EntryValidateCommand = ...,
1940
+ vcmd: _EntryValidateCommand = ...,
1941
+ width: int = ...,
1942
+ xscrollcommand: _XYScrollCommand = ...,
1943
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
1944
+ @overload
1945
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
1946
+ config = configure
1947
+ def delete(self, first: _EntryIndex, last: _EntryIndex | None = None) -> None: ...
1948
+ def get(self) -> str: ...
1949
+ def icursor(self, index: _EntryIndex) -> None: ...
1950
+ def index(self, index: _EntryIndex) -> int: ...
1951
+ def insert(self, index: _EntryIndex, string: str) -> None: ...
1952
+ def scan_mark(self, x) -> None: ...
1953
+ def scan_dragto(self, x) -> None: ...
1954
+ def selection_adjust(self, index: _EntryIndex) -> None: ...
1955
+ def selection_clear(self) -> None: ... # type: ignore[override]
1956
+ def selection_from(self, index: _EntryIndex) -> None: ...
1957
+ def selection_present(self) -> bool: ...
1958
+ def selection_range(self, start: _EntryIndex, end: _EntryIndex) -> None: ...
1959
+ def selection_to(self, index: _EntryIndex) -> None: ...
1960
+ select_adjust = selection_adjust
1961
+ select_clear = selection_clear
1962
+ select_from = selection_from
1963
+ select_present = selection_present
1964
+ select_range = selection_range
1965
+ select_to = selection_to
1966
+
1967
+ class Frame(Widget):
1968
+ def __init__(
1969
+ self,
1970
+ master: Misc | None = None,
1971
+ cnf: dict[str, Any] | None = {},
1972
+ *,
1973
+ background: str = ...,
1974
+ bd: _ScreenUnits = ...,
1975
+ bg: str = ...,
1976
+ border: _ScreenUnits = ...,
1977
+ borderwidth: _ScreenUnits = ...,
1978
+ class_: str = ..., # can't be changed with configure()
1979
+ colormap: Literal["new", ""] | Misc = ..., # can't be changed with configure()
1980
+ container: bool = ..., # can't be changed with configure()
1981
+ cursor: _Cursor = ...,
1982
+ height: _ScreenUnits = ...,
1983
+ highlightbackground: str = ...,
1984
+ highlightcolor: str = ...,
1985
+ highlightthickness: _ScreenUnits = ...,
1986
+ name: str = ...,
1987
+ padx: _ScreenUnits = ...,
1988
+ pady: _ScreenUnits = ...,
1989
+ relief: _Relief = ...,
1990
+ takefocus: _TakeFocusValue = ...,
1991
+ visual: str | tuple[str, int] = ..., # can't be changed with configure()
1992
+ width: _ScreenUnits = ...,
1993
+ ) -> None: ...
1994
+ @overload
1995
+ def configure(
1996
+ self,
1997
+ cnf: dict[str, Any] | None = None,
1998
+ *,
1999
+ background: str = ...,
2000
+ bd: _ScreenUnits = ...,
2001
+ bg: str = ...,
2002
+ border: _ScreenUnits = ...,
2003
+ borderwidth: _ScreenUnits = ...,
2004
+ cursor: _Cursor = ...,
2005
+ height: _ScreenUnits = ...,
2006
+ highlightbackground: str = ...,
2007
+ highlightcolor: str = ...,
2008
+ highlightthickness: _ScreenUnits = ...,
2009
+ padx: _ScreenUnits = ...,
2010
+ pady: _ScreenUnits = ...,
2011
+ relief: _Relief = ...,
2012
+ takefocus: _TakeFocusValue = ...,
2013
+ width: _ScreenUnits = ...,
2014
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2015
+ @overload
2016
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2017
+ config = configure
2018
+
2019
+ class Label(Widget):
2020
+ def __init__(
2021
+ self,
2022
+ master: Misc | None = None,
2023
+ cnf: dict[str, Any] | None = {},
2024
+ *,
2025
+ activebackground: str = ...,
2026
+ activeforeground: str = ...,
2027
+ anchor: _Anchor = ...,
2028
+ background: str = ...,
2029
+ bd: _ScreenUnits = ...,
2030
+ bg: str = ...,
2031
+ bitmap: str = ...,
2032
+ border: _ScreenUnits = ...,
2033
+ borderwidth: _ScreenUnits = ...,
2034
+ compound: _Compound = ...,
2035
+ cursor: _Cursor = ...,
2036
+ disabledforeground: str = ...,
2037
+ fg: str = ...,
2038
+ font: _FontDescription = ...,
2039
+ foreground: str = ...,
2040
+ height: _ScreenUnits = ...,
2041
+ highlightbackground: str = ...,
2042
+ highlightcolor: str = ...,
2043
+ highlightthickness: _ScreenUnits = ...,
2044
+ image: _ImageSpec = ...,
2045
+ justify: Literal["left", "center", "right"] = ...,
2046
+ name: str = ...,
2047
+ padx: _ScreenUnits = ...,
2048
+ pady: _ScreenUnits = ...,
2049
+ relief: _Relief = ...,
2050
+ state: Literal["normal", "active", "disabled"] = ...,
2051
+ takefocus: _TakeFocusValue = ...,
2052
+ text: float | str = ...,
2053
+ textvariable: Variable = ...,
2054
+ underline: int = ...,
2055
+ width: _ScreenUnits = ...,
2056
+ wraplength: _ScreenUnits = ...,
2057
+ ) -> None: ...
2058
+ @overload
2059
+ def configure(
2060
+ self,
2061
+ cnf: dict[str, Any] | None = None,
2062
+ *,
2063
+ activebackground: str = ...,
2064
+ activeforeground: str = ...,
2065
+ anchor: _Anchor = ...,
2066
+ background: str = ...,
2067
+ bd: _ScreenUnits = ...,
2068
+ bg: str = ...,
2069
+ bitmap: str = ...,
2070
+ border: _ScreenUnits = ...,
2071
+ borderwidth: _ScreenUnits = ...,
2072
+ compound: _Compound = ...,
2073
+ cursor: _Cursor = ...,
2074
+ disabledforeground: str = ...,
2075
+ fg: str = ...,
2076
+ font: _FontDescription = ...,
2077
+ foreground: str = ...,
2078
+ height: _ScreenUnits = ...,
2079
+ highlightbackground: str = ...,
2080
+ highlightcolor: str = ...,
2081
+ highlightthickness: _ScreenUnits = ...,
2082
+ image: _ImageSpec = ...,
2083
+ justify: Literal["left", "center", "right"] = ...,
2084
+ padx: _ScreenUnits = ...,
2085
+ pady: _ScreenUnits = ...,
2086
+ relief: _Relief = ...,
2087
+ state: Literal["normal", "active", "disabled"] = ...,
2088
+ takefocus: _TakeFocusValue = ...,
2089
+ text: float | str = ...,
2090
+ textvariable: Variable = ...,
2091
+ underline: int = ...,
2092
+ width: _ScreenUnits = ...,
2093
+ wraplength: _ScreenUnits = ...,
2094
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2095
+ @overload
2096
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2097
+ config = configure
2098
+
2099
+ class Listbox(Widget, XView, YView):
2100
+ def __init__(
2101
+ self,
2102
+ master: Misc | None = None,
2103
+ cnf: dict[str, Any] | None = {},
2104
+ *,
2105
+ activestyle: Literal["dotbox", "none", "underline"] = ...,
2106
+ background: str = ...,
2107
+ bd: _ScreenUnits = ...,
2108
+ bg: str = ...,
2109
+ border: _ScreenUnits = ...,
2110
+ borderwidth: _ScreenUnits = ...,
2111
+ cursor: _Cursor = ...,
2112
+ disabledforeground: str = ...,
2113
+ exportselection: int = ...,
2114
+ fg: str = ...,
2115
+ font: _FontDescription = ...,
2116
+ foreground: str = ...,
2117
+ height: int = ...,
2118
+ highlightbackground: str = ...,
2119
+ highlightcolor: str = ...,
2120
+ highlightthickness: _ScreenUnits = ...,
2121
+ justify: Literal["left", "center", "right"] = ...,
2122
+ # There's no tkinter.ListVar, but seems like bare tkinter.Variable
2123
+ # actually works for this:
2124
+ #
2125
+ # >>> import tkinter
2126
+ # >>> lb = tkinter.Listbox()
2127
+ # >>> var = lb['listvariable'] = tkinter.Variable()
2128
+ # >>> var.set(['foo', 'bar', 'baz'])
2129
+ # >>> lb.get(0, 'end')
2130
+ # ('foo', 'bar', 'baz')
2131
+ listvariable: Variable = ...,
2132
+ name: str = ...,
2133
+ relief: _Relief = ...,
2134
+ selectbackground: str = ...,
2135
+ selectborderwidth: _ScreenUnits = ...,
2136
+ selectforeground: str = ...,
2137
+ # from listbox man page: "The value of the [selectmode] option may be
2138
+ # arbitrary, but the default bindings expect it to be ..."
2139
+ #
2140
+ # I have never seen anyone setting this to something else than what
2141
+ # "the default bindings expect", but let's support it anyway.
2142
+ selectmode: str = ...,
2143
+ setgrid: bool = ...,
2144
+ state: Literal["normal", "disabled"] = ...,
2145
+ takefocus: _TakeFocusValue = ...,
2146
+ width: int = ...,
2147
+ xscrollcommand: _XYScrollCommand = ...,
2148
+ yscrollcommand: _XYScrollCommand = ...,
2149
+ ) -> None: ...
2150
+ @overload
2151
+ def configure(
2152
+ self,
2153
+ cnf: dict[str, Any] | None = None,
2154
+ *,
2155
+ activestyle: Literal["dotbox", "none", "underline"] = ...,
2156
+ background: str = ...,
2157
+ bd: _ScreenUnits = ...,
2158
+ bg: str = ...,
2159
+ border: _ScreenUnits = ...,
2160
+ borderwidth: _ScreenUnits = ...,
2161
+ cursor: _Cursor = ...,
2162
+ disabledforeground: str = ...,
2163
+ exportselection: bool = ...,
2164
+ fg: str = ...,
2165
+ font: _FontDescription = ...,
2166
+ foreground: str = ...,
2167
+ height: int = ...,
2168
+ highlightbackground: str = ...,
2169
+ highlightcolor: str = ...,
2170
+ highlightthickness: _ScreenUnits = ...,
2171
+ justify: Literal["left", "center", "right"] = ...,
2172
+ listvariable: Variable = ...,
2173
+ relief: _Relief = ...,
2174
+ selectbackground: str = ...,
2175
+ selectborderwidth: _ScreenUnits = ...,
2176
+ selectforeground: str = ...,
2177
+ selectmode: str = ...,
2178
+ setgrid: bool = ...,
2179
+ state: Literal["normal", "disabled"] = ...,
2180
+ takefocus: _TakeFocusValue = ...,
2181
+ width: int = ...,
2182
+ xscrollcommand: _XYScrollCommand = ...,
2183
+ yscrollcommand: _XYScrollCommand = ...,
2184
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2185
+ @overload
2186
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2187
+ config = configure
2188
+ def activate(self, index: str | int) -> None: ...
2189
+ def bbox(self, index: str | int) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
2190
+ def curselection(self): ...
2191
+ def delete(self, first: str | int, last: str | int | None = None) -> None: ...
2192
+ def get(self, first: str | int, last: str | int | None = None): ...
2193
+ def index(self, index: str | int) -> int: ...
2194
+ def insert(self, index: str | int, *elements: str | float) -> None: ...
2195
+ def nearest(self, y): ...
2196
+ def scan_mark(self, x, y) -> None: ...
2197
+ def scan_dragto(self, x, y) -> None: ...
2198
+ def see(self, index: str | int) -> None: ...
2199
+ def selection_anchor(self, index: str | int) -> None: ...
2200
+ select_anchor = selection_anchor
2201
+ def selection_clear(self, first: str | int, last: str | int | None = None) -> None: ... # type: ignore[override]
2202
+ select_clear = selection_clear
2203
+ def selection_includes(self, index: str | int): ...
2204
+ select_includes = selection_includes
2205
+ def selection_set(self, first: str | int, last: str | int | None = None) -> None: ...
2206
+ select_set = selection_set
2207
+ def size(self) -> int: ... # type: ignore[override]
2208
+ def itemcget(self, index: str | int, option): ...
2209
+ def itemconfigure(self, index: str | int, cnf: Incomplete | None = None, **kw): ...
2210
+ itemconfig = itemconfigure
2211
+
2212
+ class Menu(Widget):
2213
+ def __init__(
2214
+ self,
2215
+ master: Misc | None = None,
2216
+ cnf: dict[str, Any] | None = {},
2217
+ *,
2218
+ activebackground: str = ...,
2219
+ activeborderwidth: _ScreenUnits = ...,
2220
+ activeforeground: str = ...,
2221
+ background: str = ...,
2222
+ bd: _ScreenUnits = ...,
2223
+ bg: str = ...,
2224
+ border: _ScreenUnits = ...,
2225
+ borderwidth: _ScreenUnits = ...,
2226
+ cursor: _Cursor = ...,
2227
+ disabledforeground: str = ...,
2228
+ fg: str = ...,
2229
+ font: _FontDescription = ...,
2230
+ foreground: str = ...,
2231
+ name: str = ...,
2232
+ postcommand: Callable[[], object] | str = ...,
2233
+ relief: _Relief = ...,
2234
+ selectcolor: str = ...,
2235
+ takefocus: _TakeFocusValue = ...,
2236
+ tearoff: int = ...,
2237
+ # I guess tearoffcommand arguments are supposed to be widget objects,
2238
+ # but they are widget name strings. Use nametowidget() to handle the
2239
+ # arguments of tearoffcommand.
2240
+ tearoffcommand: Callable[[str, str], object] | str = ...,
2241
+ title: str = ...,
2242
+ type: Literal["menubar", "tearoff", "normal"] = ...,
2243
+ ) -> None: ...
2244
+ @overload
2245
+ def configure(
2246
+ self,
2247
+ cnf: dict[str, Any] | None = None,
2248
+ *,
2249
+ activebackground: str = ...,
2250
+ activeborderwidth: _ScreenUnits = ...,
2251
+ activeforeground: str = ...,
2252
+ background: str = ...,
2253
+ bd: _ScreenUnits = ...,
2254
+ bg: str = ...,
2255
+ border: _ScreenUnits = ...,
2256
+ borderwidth: _ScreenUnits = ...,
2257
+ cursor: _Cursor = ...,
2258
+ disabledforeground: str = ...,
2259
+ fg: str = ...,
2260
+ font: _FontDescription = ...,
2261
+ foreground: str = ...,
2262
+ postcommand: Callable[[], object] | str = ...,
2263
+ relief: _Relief = ...,
2264
+ selectcolor: str = ...,
2265
+ takefocus: _TakeFocusValue = ...,
2266
+ tearoff: bool = ...,
2267
+ tearoffcommand: Callable[[str, str], object] | str = ...,
2268
+ title: str = ...,
2269
+ type: Literal["menubar", "tearoff", "normal"] = ...,
2270
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2271
+ @overload
2272
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2273
+ config = configure
2274
+ def tk_popup(self, x: int, y: int, entry: str | int = "") -> None: ...
2275
+ def activate(self, index: str | int) -> None: ...
2276
+ def add(self, itemType, cnf={}, **kw): ... # docstring says "Internal function."
2277
+ def insert(self, index, itemType, cnf={}, **kw): ... # docstring says "Internal function."
2278
+ def add_cascade(
2279
+ self,
2280
+ cnf: dict[str, Any] | None = {},
2281
+ *,
2282
+ accelerator: str = ...,
2283
+ activebackground: str = ...,
2284
+ activeforeground: str = ...,
2285
+ background: str = ...,
2286
+ bitmap: str = ...,
2287
+ columnbreak: int = ...,
2288
+ command: Callable[[], object] | str = ...,
2289
+ compound: _Compound = ...,
2290
+ font: _FontDescription = ...,
2291
+ foreground: str = ...,
2292
+ hidemargin: bool = ...,
2293
+ image: _ImageSpec = ...,
2294
+ label: str = ...,
2295
+ menu: Menu = ...,
2296
+ state: Literal["normal", "active", "disabled"] = ...,
2297
+ underline: int = ...,
2298
+ ) -> None: ...
2299
+ def add_checkbutton(
2300
+ self,
2301
+ cnf: dict[str, Any] | None = {},
2302
+ *,
2303
+ accelerator: str = ...,
2304
+ activebackground: str = ...,
2305
+ activeforeground: str = ...,
2306
+ background: str = ...,
2307
+ bitmap: str = ...,
2308
+ columnbreak: int = ...,
2309
+ command: Callable[[], object] | str = ...,
2310
+ compound: _Compound = ...,
2311
+ font: _FontDescription = ...,
2312
+ foreground: str = ...,
2313
+ hidemargin: bool = ...,
2314
+ image: _ImageSpec = ...,
2315
+ indicatoron: bool = ...,
2316
+ label: str = ...,
2317
+ offvalue: Any = ...,
2318
+ onvalue: Any = ...,
2319
+ selectcolor: str = ...,
2320
+ selectimage: _ImageSpec = ...,
2321
+ state: Literal["normal", "active", "disabled"] = ...,
2322
+ underline: int = ...,
2323
+ variable: Variable = ...,
2324
+ ) -> None: ...
2325
+ def add_command(
2326
+ self,
2327
+ cnf: dict[str, Any] | None = {},
2328
+ *,
2329
+ accelerator: str = ...,
2330
+ activebackground: str = ...,
2331
+ activeforeground: str = ...,
2332
+ background: str = ...,
2333
+ bitmap: str = ...,
2334
+ columnbreak: int = ...,
2335
+ command: Callable[[], object] | str = ...,
2336
+ compound: _Compound = ...,
2337
+ font: _FontDescription = ...,
2338
+ foreground: str = ...,
2339
+ hidemargin: bool = ...,
2340
+ image: _ImageSpec = ...,
2341
+ label: str = ...,
2342
+ state: Literal["normal", "active", "disabled"] = ...,
2343
+ underline: int = ...,
2344
+ ) -> None: ...
2345
+ def add_radiobutton(
2346
+ self,
2347
+ cnf: dict[str, Any] | None = {},
2348
+ *,
2349
+ accelerator: str = ...,
2350
+ activebackground: str = ...,
2351
+ activeforeground: str = ...,
2352
+ background: str = ...,
2353
+ bitmap: str = ...,
2354
+ columnbreak: int = ...,
2355
+ command: Callable[[], object] | str = ...,
2356
+ compound: _Compound = ...,
2357
+ font: _FontDescription = ...,
2358
+ foreground: str = ...,
2359
+ hidemargin: bool = ...,
2360
+ image: _ImageSpec = ...,
2361
+ indicatoron: bool = ...,
2362
+ label: str = ...,
2363
+ selectcolor: str = ...,
2364
+ selectimage: _ImageSpec = ...,
2365
+ state: Literal["normal", "active", "disabled"] = ...,
2366
+ underline: int = ...,
2367
+ value: Any = ...,
2368
+ variable: Variable = ...,
2369
+ ) -> None: ...
2370
+ def add_separator(self, cnf: dict[str, Any] | None = {}, *, background: str = ...) -> None: ...
2371
+ def insert_cascade(
2372
+ self,
2373
+ index: str | int,
2374
+ cnf: dict[str, Any] | None = {},
2375
+ *,
2376
+ accelerator: str = ...,
2377
+ activebackground: str = ...,
2378
+ activeforeground: str = ...,
2379
+ background: str = ...,
2380
+ bitmap: str = ...,
2381
+ columnbreak: int = ...,
2382
+ command: Callable[[], object] | str = ...,
2383
+ compound: _Compound = ...,
2384
+ font: _FontDescription = ...,
2385
+ foreground: str = ...,
2386
+ hidemargin: bool = ...,
2387
+ image: _ImageSpec = ...,
2388
+ label: str = ...,
2389
+ menu: Menu = ...,
2390
+ state: Literal["normal", "active", "disabled"] = ...,
2391
+ underline: int = ...,
2392
+ ) -> None: ...
2393
+ def insert_checkbutton(
2394
+ self,
2395
+ index: str | int,
2396
+ cnf: dict[str, Any] | None = {},
2397
+ *,
2398
+ accelerator: str = ...,
2399
+ activebackground: str = ...,
2400
+ activeforeground: str = ...,
2401
+ background: str = ...,
2402
+ bitmap: str = ...,
2403
+ columnbreak: int = ...,
2404
+ command: Callable[[], object] | str = ...,
2405
+ compound: _Compound = ...,
2406
+ font: _FontDescription = ...,
2407
+ foreground: str = ...,
2408
+ hidemargin: bool = ...,
2409
+ image: _ImageSpec = ...,
2410
+ indicatoron: bool = ...,
2411
+ label: str = ...,
2412
+ offvalue: Any = ...,
2413
+ onvalue: Any = ...,
2414
+ selectcolor: str = ...,
2415
+ selectimage: _ImageSpec = ...,
2416
+ state: Literal["normal", "active", "disabled"] = ...,
2417
+ underline: int = ...,
2418
+ variable: Variable = ...,
2419
+ ) -> None: ...
2420
+ def insert_command(
2421
+ self,
2422
+ index: str | int,
2423
+ cnf: dict[str, Any] | None = {},
2424
+ *,
2425
+ accelerator: str = ...,
2426
+ activebackground: str = ...,
2427
+ activeforeground: str = ...,
2428
+ background: str = ...,
2429
+ bitmap: str = ...,
2430
+ columnbreak: int = ...,
2431
+ command: Callable[[], object] | str = ...,
2432
+ compound: _Compound = ...,
2433
+ font: _FontDescription = ...,
2434
+ foreground: str = ...,
2435
+ hidemargin: bool = ...,
2436
+ image: _ImageSpec = ...,
2437
+ label: str = ...,
2438
+ state: Literal["normal", "active", "disabled"] = ...,
2439
+ underline: int = ...,
2440
+ ) -> None: ...
2441
+ def insert_radiobutton(
2442
+ self,
2443
+ index: str | int,
2444
+ cnf: dict[str, Any] | None = {},
2445
+ *,
2446
+ accelerator: str = ...,
2447
+ activebackground: str = ...,
2448
+ activeforeground: str = ...,
2449
+ background: str = ...,
2450
+ bitmap: str = ...,
2451
+ columnbreak: int = ...,
2452
+ command: Callable[[], object] | str = ...,
2453
+ compound: _Compound = ...,
2454
+ font: _FontDescription = ...,
2455
+ foreground: str = ...,
2456
+ hidemargin: bool = ...,
2457
+ image: _ImageSpec = ...,
2458
+ indicatoron: bool = ...,
2459
+ label: str = ...,
2460
+ selectcolor: str = ...,
2461
+ selectimage: _ImageSpec = ...,
2462
+ state: Literal["normal", "active", "disabled"] = ...,
2463
+ underline: int = ...,
2464
+ value: Any = ...,
2465
+ variable: Variable = ...,
2466
+ ) -> None: ...
2467
+ def insert_separator(self, index: str | int, cnf: dict[str, Any] | None = {}, *, background: str = ...) -> None: ...
2468
+ def delete(self, index1: str | int, index2: str | int | None = None) -> None: ...
2469
+ def entrycget(self, index: str | int, option: str) -> Any: ...
2470
+ def entryconfigure(
2471
+ self, index: str | int, cnf: dict[str, Any] | None = None, **kw: Any
2472
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2473
+ entryconfig = entryconfigure
2474
+ def index(self, index: str | int) -> int | None: ...
2475
+ def invoke(self, index: str | int) -> Any: ...
2476
+ def post(self, x: int, y: int) -> None: ...
2477
+ def type(self, index: str | int) -> Literal["cascade", "checkbutton", "command", "radiobutton", "separator"]: ...
2478
+ def unpost(self) -> None: ...
2479
+ def xposition(self, index: str | int) -> int: ...
2480
+ def yposition(self, index: str | int) -> int: ...
2481
+
2482
+ class Menubutton(Widget):
2483
+ def __init__(
2484
+ self,
2485
+ master: Misc | None = None,
2486
+ cnf: dict[str, Any] | None = {},
2487
+ *,
2488
+ activebackground: str = ...,
2489
+ activeforeground: str = ...,
2490
+ anchor: _Anchor = ...,
2491
+ background: str = ...,
2492
+ bd: _ScreenUnits = ...,
2493
+ bg: str = ...,
2494
+ bitmap: str = ...,
2495
+ border: _ScreenUnits = ...,
2496
+ borderwidth: _ScreenUnits = ...,
2497
+ compound: _Compound = ...,
2498
+ cursor: _Cursor = ...,
2499
+ direction: Literal["above", "below", "left", "right", "flush"] = ...,
2500
+ disabledforeground: str = ...,
2501
+ fg: str = ...,
2502
+ font: _FontDescription = ...,
2503
+ foreground: str = ...,
2504
+ height: _ScreenUnits = ...,
2505
+ highlightbackground: str = ...,
2506
+ highlightcolor: str = ...,
2507
+ highlightthickness: _ScreenUnits = ...,
2508
+ image: _ImageSpec = ...,
2509
+ indicatoron: bool = ...,
2510
+ justify: Literal["left", "center", "right"] = ...,
2511
+ menu: Menu = ...,
2512
+ name: str = ...,
2513
+ padx: _ScreenUnits = ...,
2514
+ pady: _ScreenUnits = ...,
2515
+ relief: _Relief = ...,
2516
+ state: Literal["normal", "active", "disabled"] = ...,
2517
+ takefocus: _TakeFocusValue = ...,
2518
+ text: float | str = ...,
2519
+ textvariable: Variable = ...,
2520
+ underline: int = ...,
2521
+ width: _ScreenUnits = ...,
2522
+ wraplength: _ScreenUnits = ...,
2523
+ ) -> None: ...
2524
+ @overload
2525
+ def configure(
2526
+ self,
2527
+ cnf: dict[str, Any] | None = None,
2528
+ *,
2529
+ activebackground: str = ...,
2530
+ activeforeground: str = ...,
2531
+ anchor: _Anchor = ...,
2532
+ background: str = ...,
2533
+ bd: _ScreenUnits = ...,
2534
+ bg: str = ...,
2535
+ bitmap: str = ...,
2536
+ border: _ScreenUnits = ...,
2537
+ borderwidth: _ScreenUnits = ...,
2538
+ compound: _Compound = ...,
2539
+ cursor: _Cursor = ...,
2540
+ direction: Literal["above", "below", "left", "right", "flush"] = ...,
2541
+ disabledforeground: str = ...,
2542
+ fg: str = ...,
2543
+ font: _FontDescription = ...,
2544
+ foreground: str = ...,
2545
+ height: _ScreenUnits = ...,
2546
+ highlightbackground: str = ...,
2547
+ highlightcolor: str = ...,
2548
+ highlightthickness: _ScreenUnits = ...,
2549
+ image: _ImageSpec = ...,
2550
+ indicatoron: bool = ...,
2551
+ justify: Literal["left", "center", "right"] = ...,
2552
+ menu: Menu = ...,
2553
+ padx: _ScreenUnits = ...,
2554
+ pady: _ScreenUnits = ...,
2555
+ relief: _Relief = ...,
2556
+ state: Literal["normal", "active", "disabled"] = ...,
2557
+ takefocus: _TakeFocusValue = ...,
2558
+ text: float | str = ...,
2559
+ textvariable: Variable = ...,
2560
+ underline: int = ...,
2561
+ width: _ScreenUnits = ...,
2562
+ wraplength: _ScreenUnits = ...,
2563
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2564
+ @overload
2565
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2566
+ config = configure
2567
+
2568
+ class Message(Widget):
2569
+ def __init__(
2570
+ self,
2571
+ master: Misc | None = None,
2572
+ cnf: dict[str, Any] | None = {},
2573
+ *,
2574
+ anchor: _Anchor = ...,
2575
+ aspect: int = ...,
2576
+ background: str = ...,
2577
+ bd: _ScreenUnits = ...,
2578
+ bg: str = ...,
2579
+ border: _ScreenUnits = ...,
2580
+ borderwidth: _ScreenUnits = ...,
2581
+ cursor: _Cursor = ...,
2582
+ fg: str = ...,
2583
+ font: _FontDescription = ...,
2584
+ foreground: str = ...,
2585
+ highlightbackground: str = ...,
2586
+ highlightcolor: str = ...,
2587
+ highlightthickness: _ScreenUnits = ...,
2588
+ justify: Literal["left", "center", "right"] = ...,
2589
+ name: str = ...,
2590
+ padx: _ScreenUnits = ...,
2591
+ pady: _ScreenUnits = ...,
2592
+ relief: _Relief = ...,
2593
+ takefocus: _TakeFocusValue = ...,
2594
+ text: float | str = ...,
2595
+ textvariable: Variable = ...,
2596
+ # there's width but no height
2597
+ width: _ScreenUnits = ...,
2598
+ ) -> None: ...
2599
+ @overload
2600
+ def configure(
2601
+ self,
2602
+ cnf: dict[str, Any] | None = None,
2603
+ *,
2604
+ anchor: _Anchor = ...,
2605
+ aspect: int = ...,
2606
+ background: str = ...,
2607
+ bd: _ScreenUnits = ...,
2608
+ bg: str = ...,
2609
+ border: _ScreenUnits = ...,
2610
+ borderwidth: _ScreenUnits = ...,
2611
+ cursor: _Cursor = ...,
2612
+ fg: str = ...,
2613
+ font: _FontDescription = ...,
2614
+ foreground: str = ...,
2615
+ highlightbackground: str = ...,
2616
+ highlightcolor: str = ...,
2617
+ highlightthickness: _ScreenUnits = ...,
2618
+ justify: Literal["left", "center", "right"] = ...,
2619
+ padx: _ScreenUnits = ...,
2620
+ pady: _ScreenUnits = ...,
2621
+ relief: _Relief = ...,
2622
+ takefocus: _TakeFocusValue = ...,
2623
+ text: float | str = ...,
2624
+ textvariable: Variable = ...,
2625
+ width: _ScreenUnits = ...,
2626
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2627
+ @overload
2628
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2629
+ config = configure
2630
+
2631
+ class Radiobutton(Widget):
2632
+ def __init__(
2633
+ self,
2634
+ master: Misc | None = None,
2635
+ cnf: dict[str, Any] | None = {},
2636
+ *,
2637
+ activebackground: str = ...,
2638
+ activeforeground: str = ...,
2639
+ anchor: _Anchor = ...,
2640
+ background: str = ...,
2641
+ bd: _ScreenUnits = ...,
2642
+ bg: str = ...,
2643
+ bitmap: str = ...,
2644
+ border: _ScreenUnits = ...,
2645
+ borderwidth: _ScreenUnits = ...,
2646
+ command: _ButtonCommand = ...,
2647
+ compound: _Compound = ...,
2648
+ cursor: _Cursor = ...,
2649
+ disabledforeground: str = ...,
2650
+ fg: str = ...,
2651
+ font: _FontDescription = ...,
2652
+ foreground: str = ...,
2653
+ height: _ScreenUnits = ...,
2654
+ highlightbackground: str = ...,
2655
+ highlightcolor: str = ...,
2656
+ highlightthickness: _ScreenUnits = ...,
2657
+ image: _ImageSpec = ...,
2658
+ indicatoron: bool = ...,
2659
+ justify: Literal["left", "center", "right"] = ...,
2660
+ name: str = ...,
2661
+ offrelief: _Relief = ...,
2662
+ overrelief: _Relief = ...,
2663
+ padx: _ScreenUnits = ...,
2664
+ pady: _ScreenUnits = ...,
2665
+ relief: _Relief = ...,
2666
+ selectcolor: str = ...,
2667
+ selectimage: _ImageSpec = ...,
2668
+ state: Literal["normal", "active", "disabled"] = ...,
2669
+ takefocus: _TakeFocusValue = ...,
2670
+ text: float | str = ...,
2671
+ textvariable: Variable = ...,
2672
+ tristateimage: _ImageSpec = ...,
2673
+ tristatevalue: Any = ...,
2674
+ underline: int = ...,
2675
+ value: Any = ...,
2676
+ variable: Variable | Literal[""] = ...,
2677
+ width: _ScreenUnits = ...,
2678
+ wraplength: _ScreenUnits = ...,
2679
+ ) -> None: ...
2680
+ @overload
2681
+ def configure(
2682
+ self,
2683
+ cnf: dict[str, Any] | None = None,
2684
+ *,
2685
+ activebackground: str = ...,
2686
+ activeforeground: str = ...,
2687
+ anchor: _Anchor = ...,
2688
+ background: str = ...,
2689
+ bd: _ScreenUnits = ...,
2690
+ bg: str = ...,
2691
+ bitmap: str = ...,
2692
+ border: _ScreenUnits = ...,
2693
+ borderwidth: _ScreenUnits = ...,
2694
+ command: _ButtonCommand = ...,
2695
+ compound: _Compound = ...,
2696
+ cursor: _Cursor = ...,
2697
+ disabledforeground: str = ...,
2698
+ fg: str = ...,
2699
+ font: _FontDescription = ...,
2700
+ foreground: str = ...,
2701
+ height: _ScreenUnits = ...,
2702
+ highlightbackground: str = ...,
2703
+ highlightcolor: str = ...,
2704
+ highlightthickness: _ScreenUnits = ...,
2705
+ image: _ImageSpec = ...,
2706
+ indicatoron: bool = ...,
2707
+ justify: Literal["left", "center", "right"] = ...,
2708
+ offrelief: _Relief = ...,
2709
+ overrelief: _Relief = ...,
2710
+ padx: _ScreenUnits = ...,
2711
+ pady: _ScreenUnits = ...,
2712
+ relief: _Relief = ...,
2713
+ selectcolor: str = ...,
2714
+ selectimage: _ImageSpec = ...,
2715
+ state: Literal["normal", "active", "disabled"] = ...,
2716
+ takefocus: _TakeFocusValue = ...,
2717
+ text: float | str = ...,
2718
+ textvariable: Variable = ...,
2719
+ tristateimage: _ImageSpec = ...,
2720
+ tristatevalue: Any = ...,
2721
+ underline: int = ...,
2722
+ value: Any = ...,
2723
+ variable: Variable | Literal[""] = ...,
2724
+ width: _ScreenUnits = ...,
2725
+ wraplength: _ScreenUnits = ...,
2726
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2727
+ @overload
2728
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2729
+ config = configure
2730
+ def deselect(self) -> None: ...
2731
+ def flash(self) -> None: ...
2732
+ def invoke(self) -> Any: ...
2733
+ def select(self) -> None: ...
2734
+
2735
+ class Scale(Widget):
2736
+ def __init__(
2737
+ self,
2738
+ master: Misc | None = None,
2739
+ cnf: dict[str, Any] | None = {},
2740
+ *,
2741
+ activebackground: str = ...,
2742
+ background: str = ...,
2743
+ bd: _ScreenUnits = ...,
2744
+ bg: str = ...,
2745
+ bigincrement: float = ...,
2746
+ border: _ScreenUnits = ...,
2747
+ borderwidth: _ScreenUnits = ...,
2748
+ # don't know why the callback gets string instead of float
2749
+ command: str | Callable[[str], object] = ...,
2750
+ cursor: _Cursor = ...,
2751
+ digits: int = ...,
2752
+ fg: str = ...,
2753
+ font: _FontDescription = ...,
2754
+ foreground: str = ...,
2755
+ from_: float = ...,
2756
+ highlightbackground: str = ...,
2757
+ highlightcolor: str = ...,
2758
+ highlightthickness: _ScreenUnits = ...,
2759
+ label: str = ...,
2760
+ length: _ScreenUnits = ...,
2761
+ name: str = ...,
2762
+ orient: Literal["horizontal", "vertical"] = ...,
2763
+ relief: _Relief = ...,
2764
+ repeatdelay: int = ...,
2765
+ repeatinterval: int = ...,
2766
+ resolution: float = ...,
2767
+ showvalue: bool = ...,
2768
+ sliderlength: _ScreenUnits = ...,
2769
+ sliderrelief: _Relief = ...,
2770
+ state: Literal["normal", "active", "disabled"] = ...,
2771
+ takefocus: _TakeFocusValue = ...,
2772
+ tickinterval: float = ...,
2773
+ to: float = ...,
2774
+ troughcolor: str = ...,
2775
+ variable: IntVar | DoubleVar = ...,
2776
+ width: _ScreenUnits = ...,
2777
+ ) -> None: ...
2778
+ @overload
2779
+ def configure(
2780
+ self,
2781
+ cnf: dict[str, Any] | None = None,
2782
+ *,
2783
+ activebackground: str = ...,
2784
+ background: str = ...,
2785
+ bd: _ScreenUnits = ...,
2786
+ bg: str = ...,
2787
+ bigincrement: float = ...,
2788
+ border: _ScreenUnits = ...,
2789
+ borderwidth: _ScreenUnits = ...,
2790
+ command: str | Callable[[str], object] = ...,
2791
+ cursor: _Cursor = ...,
2792
+ digits: int = ...,
2793
+ fg: str = ...,
2794
+ font: _FontDescription = ...,
2795
+ foreground: str = ...,
2796
+ from_: float = ...,
2797
+ highlightbackground: str = ...,
2798
+ highlightcolor: str = ...,
2799
+ highlightthickness: _ScreenUnits = ...,
2800
+ label: str = ...,
2801
+ length: _ScreenUnits = ...,
2802
+ orient: Literal["horizontal", "vertical"] = ...,
2803
+ relief: _Relief = ...,
2804
+ repeatdelay: int = ...,
2805
+ repeatinterval: int = ...,
2806
+ resolution: float = ...,
2807
+ showvalue: bool = ...,
2808
+ sliderlength: _ScreenUnits = ...,
2809
+ sliderrelief: _Relief = ...,
2810
+ state: Literal["normal", "active", "disabled"] = ...,
2811
+ takefocus: _TakeFocusValue = ...,
2812
+ tickinterval: float = ...,
2813
+ to: float = ...,
2814
+ troughcolor: str = ...,
2815
+ variable: IntVar | DoubleVar = ...,
2816
+ width: _ScreenUnits = ...,
2817
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2818
+ @overload
2819
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2820
+ config = configure
2821
+ def get(self) -> float: ...
2822
+ def set(self, value) -> None: ...
2823
+ def coords(self, value: float | None = None) -> tuple[int, int]: ...
2824
+ def identify(self, x, y) -> Literal["", "slider", "trough1", "trough2"]: ...
2825
+
2826
+ class Scrollbar(Widget):
2827
+ def __init__(
2828
+ self,
2829
+ master: Misc | None = None,
2830
+ cnf: dict[str, Any] | None = {},
2831
+ *,
2832
+ activebackground: str = ...,
2833
+ activerelief: _Relief = ...,
2834
+ background: str = ...,
2835
+ bd: _ScreenUnits = ...,
2836
+ bg: str = ...,
2837
+ border: _ScreenUnits = ...,
2838
+ borderwidth: _ScreenUnits = ...,
2839
+ # There are many ways how the command may get called. Search for
2840
+ # 'SCROLLING COMMANDS' in scrollbar man page. There doesn't seem to
2841
+ # be any way to specify an overloaded callback function, so we say
2842
+ # that it can take any args while it can't in reality.
2843
+ command: Callable[..., tuple[float, float] | None] | str = ...,
2844
+ cursor: _Cursor = ...,
2845
+ elementborderwidth: _ScreenUnits = ...,
2846
+ highlightbackground: str = ...,
2847
+ highlightcolor: str = ...,
2848
+ highlightthickness: _ScreenUnits = ...,
2849
+ jump: bool = ...,
2850
+ name: str = ...,
2851
+ orient: Literal["horizontal", "vertical"] = ...,
2852
+ relief: _Relief = ...,
2853
+ repeatdelay: int = ...,
2854
+ repeatinterval: int = ...,
2855
+ takefocus: _TakeFocusValue = ...,
2856
+ troughcolor: str = ...,
2857
+ width: _ScreenUnits = ...,
2858
+ ) -> None: ...
2859
+ @overload
2860
+ def configure(
2861
+ self,
2862
+ cnf: dict[str, Any] | None = None,
2863
+ *,
2864
+ activebackground: str = ...,
2865
+ activerelief: _Relief = ...,
2866
+ background: str = ...,
2867
+ bd: _ScreenUnits = ...,
2868
+ bg: str = ...,
2869
+ border: _ScreenUnits = ...,
2870
+ borderwidth: _ScreenUnits = ...,
2871
+ command: Callable[..., tuple[float, float] | None] | str = ...,
2872
+ cursor: _Cursor = ...,
2873
+ elementborderwidth: _ScreenUnits = ...,
2874
+ highlightbackground: str = ...,
2875
+ highlightcolor: str = ...,
2876
+ highlightthickness: _ScreenUnits = ...,
2877
+ jump: bool = ...,
2878
+ orient: Literal["horizontal", "vertical"] = ...,
2879
+ relief: _Relief = ...,
2880
+ repeatdelay: int = ...,
2881
+ repeatinterval: int = ...,
2882
+ takefocus: _TakeFocusValue = ...,
2883
+ troughcolor: str = ...,
2884
+ width: _ScreenUnits = ...,
2885
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
2886
+ @overload
2887
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
2888
+ config = configure
2889
+ def activate(self, index: Incomplete | None = None): ...
2890
+ def delta(self, deltax: int, deltay: int) -> float: ...
2891
+ def fraction(self, x: int, y: int) -> float: ...
2892
+ def identify(self, x: int, y: int) -> Literal["arrow1", "arrow2", "slider", "trough1", "trough2", ""]: ...
2893
+ def get(self) -> tuple[float, float, float, float] | tuple[float, float]: ...
2894
+ def set(self, first: float | str, last: float | str) -> None: ...
2895
+
2896
+ _TextIndex: TypeAlias = _tkinter.Tcl_Obj | str | float | Misc
2897
+
2898
+ class Text(Widget, XView, YView):
2899
+ def __init__(
2900
+ self,
2901
+ master: Misc | None = None,
2902
+ cnf: dict[str, Any] | None = {},
2903
+ *,
2904
+ autoseparators: bool = ...,
2905
+ background: str = ...,
2906
+ bd: _ScreenUnits = ...,
2907
+ bg: str = ...,
2908
+ blockcursor: bool = ...,
2909
+ border: _ScreenUnits = ...,
2910
+ borderwidth: _ScreenUnits = ...,
2911
+ cursor: _Cursor = ...,
2912
+ endline: int | Literal[""] = ...,
2913
+ exportselection: bool = ...,
2914
+ fg: str = ...,
2915
+ font: _FontDescription = ...,
2916
+ foreground: str = ...,
2917
+ # width is always int, but height is allowed to be ScreenUnits.
2918
+ # This doesn't make any sense to me, and this isn't documented.
2919
+ # The docs seem to say that both should be integers.
2920
+ height: _ScreenUnits = ...,
2921
+ highlightbackground: str = ...,
2922
+ highlightcolor: str = ...,
2923
+ highlightthickness: _ScreenUnits = ...,
2924
+ inactiveselectbackground: str = ...,
2925
+ insertbackground: str = ...,
2926
+ insertborderwidth: _ScreenUnits = ...,
2927
+ insertofftime: int = ...,
2928
+ insertontime: int = ...,
2929
+ insertunfocussed: Literal["none", "hollow", "solid"] = ...,
2930
+ insertwidth: _ScreenUnits = ...,
2931
+ maxundo: int = ...,
2932
+ name: str = ...,
2933
+ padx: _ScreenUnits = ...,
2934
+ pady: _ScreenUnits = ...,
2935
+ relief: _Relief = ...,
2936
+ selectbackground: str = ...,
2937
+ selectborderwidth: _ScreenUnits = ...,
2938
+ selectforeground: str = ...,
2939
+ setgrid: bool = ...,
2940
+ spacing1: _ScreenUnits = ...,
2941
+ spacing2: _ScreenUnits = ...,
2942
+ spacing3: _ScreenUnits = ...,
2943
+ startline: int | Literal[""] = ...,
2944
+ state: Literal["normal", "disabled"] = ...,
2945
+ # Literal inside Tuple doesn't actually work
2946
+ tabs: _ScreenUnits | str | tuple[_ScreenUnits | str, ...] = ...,
2947
+ tabstyle: Literal["tabular", "wordprocessor"] = ...,
2948
+ takefocus: _TakeFocusValue = ...,
2949
+ undo: bool = ...,
2950
+ width: int = ...,
2951
+ wrap: Literal["none", "char", "word"] = ...,
2952
+ xscrollcommand: _XYScrollCommand = ...,
2953
+ yscrollcommand: _XYScrollCommand = ...,
2954
+ ) -> None: ...
2955
+ @overload
2956
+ def configure(
2957
+ self,
2958
+ cnf: dict[str, Any] | None = None,
2959
+ *,
2960
+ autoseparators: bool = ...,
2961
+ background: str = ...,
2962
+ bd: _ScreenUnits = ...,
2963
+ bg: str = ...,
2964
+ blockcursor: bool = ...,
2965
+ border: _ScreenUnits = ...,
2966
+ borderwidth: _ScreenUnits = ...,
2967
+ cursor: _Cursor = ...,
2968
+ endline: int | Literal[""] = ...,
2969
+ exportselection: bool = ...,
2970
+ fg: str = ...,
2971
+ font: _FontDescription = ...,
2972
+ foreground: str = ...,
2973
+ height: _ScreenUnits = ...,
2974
+ highlightbackground: str = ...,
2975
+ highlightcolor: str = ...,
2976
+ highlightthickness: _ScreenUnits = ...,
2977
+ inactiveselectbackground: str = ...,
2978
+ insertbackground: str = ...,
2979
+ insertborderwidth: _ScreenUnits = ...,
2980
+ insertofftime: int = ...,
2981
+ insertontime: int = ...,
2982
+ insertunfocussed: Literal["none", "hollow", "solid"] = ...,
2983
+ insertwidth: _ScreenUnits = ...,
2984
+ maxundo: int = ...,
2985
+ padx: _ScreenUnits = ...,
2986
+ pady: _ScreenUnits = ...,
2987
+ relief: _Relief = ...,
2988
+ selectbackground: str = ...,
2989
+ selectborderwidth: _ScreenUnits = ...,
2990
+ selectforeground: str = ...,
2991
+ setgrid: bool = ...,
2992
+ spacing1: _ScreenUnits = ...,
2993
+ spacing2: _ScreenUnits = ...,
2994
+ spacing3: _ScreenUnits = ...,
2995
+ startline: int | Literal[""] = ...,
2996
+ state: Literal["normal", "disabled"] = ...,
2997
+ tabs: _ScreenUnits | str | tuple[_ScreenUnits | str, ...] = ...,
2998
+ tabstyle: Literal["tabular", "wordprocessor"] = ...,
2999
+ takefocus: _TakeFocusValue = ...,
3000
+ undo: bool = ...,
3001
+ width: int = ...,
3002
+ wrap: Literal["none", "char", "word"] = ...,
3003
+ xscrollcommand: _XYScrollCommand = ...,
3004
+ yscrollcommand: _XYScrollCommand = ...,
3005
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3006
+ @overload
3007
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3008
+ config = configure
3009
+ def bbox(self, index: _TextIndex) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
3010
+ def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ...
3011
+ def count(self, index1, index2, *args): ... # TODO
3012
+ @overload
3013
+ def debug(self, boolean: None = None) -> bool: ...
3014
+ @overload
3015
+ def debug(self, boolean: bool) -> None: ...
3016
+ def delete(self, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ...
3017
+ def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ...
3018
+ @overload
3019
+ def dump(
3020
+ self,
3021
+ index1: _TextIndex,
3022
+ index2: _TextIndex | None = None,
3023
+ command: None = None,
3024
+ *,
3025
+ all: bool = ...,
3026
+ image: bool = ...,
3027
+ mark: bool = ...,
3028
+ tag: bool = ...,
3029
+ text: bool = ...,
3030
+ window: bool = ...,
3031
+ ) -> list[tuple[str, str, str]]: ...
3032
+ @overload
3033
+ def dump(
3034
+ self,
3035
+ index1: _TextIndex,
3036
+ index2: _TextIndex | None,
3037
+ command: Callable[[str, str, str], object] | str,
3038
+ *,
3039
+ all: bool = ...,
3040
+ image: bool = ...,
3041
+ mark: bool = ...,
3042
+ tag: bool = ...,
3043
+ text: bool = ...,
3044
+ window: bool = ...,
3045
+ ) -> None: ...
3046
+ @overload
3047
+ def dump(
3048
+ self,
3049
+ index1: _TextIndex,
3050
+ index2: _TextIndex | None = None,
3051
+ *,
3052
+ command: Callable[[str, str, str], object] | str,
3053
+ all: bool = ...,
3054
+ image: bool = ...,
3055
+ mark: bool = ...,
3056
+ tag: bool = ...,
3057
+ text: bool = ...,
3058
+ window: bool = ...,
3059
+ ) -> None: ...
3060
+ def edit(self, *args): ... # docstring says "Internal method"
3061
+ @overload
3062
+ def edit_modified(self, arg: None = None) -> bool: ... # actually returns Literal[0, 1]
3063
+ @overload
3064
+ def edit_modified(self, arg: bool) -> None: ... # actually returns empty string
3065
+ def edit_redo(self) -> None: ... # actually returns empty string
3066
+ def edit_reset(self) -> None: ... # actually returns empty string
3067
+ def edit_separator(self) -> None: ... # actually returns empty string
3068
+ def edit_undo(self) -> None: ... # actually returns empty string
3069
+ def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ...
3070
+ @overload
3071
+ def image_cget(self, index: _TextIndex, option: Literal["image", "name"]) -> str: ...
3072
+ @overload
3073
+ def image_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ...
3074
+ @overload
3075
+ def image_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ...
3076
+ @overload
3077
+ def image_cget(self, index: _TextIndex, option: str) -> Any: ...
3078
+ @overload
3079
+ def image_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ...
3080
+ @overload
3081
+ def image_configure(
3082
+ self,
3083
+ index: _TextIndex,
3084
+ cnf: dict[str, Any] | None = {},
3085
+ *,
3086
+ align: Literal["baseline", "bottom", "center", "top"] = ...,
3087
+ image: _ImageSpec = ...,
3088
+ name: str = ...,
3089
+ padx: _ScreenUnits = ...,
3090
+ pady: _ScreenUnits = ...,
3091
+ ) -> dict[str, tuple[str, str, str, str, str | int]] | None: ...
3092
+ def image_create(
3093
+ self,
3094
+ index: _TextIndex,
3095
+ cnf: dict[str, Any] | None = {},
3096
+ *,
3097
+ align: Literal["baseline", "bottom", "center", "top"] = ...,
3098
+ image: _ImageSpec = ...,
3099
+ name: str = ...,
3100
+ padx: _ScreenUnits = ...,
3101
+ pady: _ScreenUnits = ...,
3102
+ ) -> str: ...
3103
+ def image_names(self) -> tuple[str, ...]: ...
3104
+ def index(self, index: _TextIndex) -> str: ...
3105
+ def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ...
3106
+ @overload
3107
+ def mark_gravity(self, markName: str, direction: None = None) -> Literal["left", "right"]: ...
3108
+ @overload
3109
+ def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string
3110
+ def mark_names(self) -> tuple[str, ...]: ...
3111
+ def mark_set(self, markName: str, index: _TextIndex) -> None: ...
3112
+ def mark_unset(self, *markNames: str) -> None: ...
3113
+ def mark_next(self, index: _TextIndex) -> str | None: ...
3114
+ def mark_previous(self, index: _TextIndex) -> str | None: ...
3115
+ # **kw of peer_create is same as the kwargs of Text.__init__
3116
+ def peer_create(self, newPathName: str | Text, cnf: dict[str, Any] = {}, **kw) -> None: ...
3117
+ def peer_names(self) -> tuple[_tkinter.Tcl_Obj, ...]: ...
3118
+ def replace(self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ...
3119
+ def scan_mark(self, x: int, y: int) -> None: ...
3120
+ def scan_dragto(self, x: int, y: int) -> None: ...
3121
+ def search(
3122
+ self,
3123
+ pattern: str,
3124
+ index: _TextIndex,
3125
+ stopindex: _TextIndex | None = None,
3126
+ forwards: bool | None = None,
3127
+ backwards: bool | None = None,
3128
+ exact: bool | None = None,
3129
+ regexp: bool | None = None,
3130
+ nocase: bool | None = None,
3131
+ count: Variable | None = None,
3132
+ elide: bool | None = None,
3133
+ ) -> str: ... # returns empty string for not found
3134
+ def see(self, index: _TextIndex) -> None: ...
3135
+ def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ...
3136
+ # tag_bind stuff is very similar to Canvas
3137
+ @overload
3138
+ def tag_bind(
3139
+ self,
3140
+ tagName: str,
3141
+ sequence: str | None,
3142
+ func: Callable[[Event[Text]], object] | None,
3143
+ add: Literal["", "+"] | bool | None = None,
3144
+ ) -> str: ...
3145
+ @overload
3146
+ def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
3147
+ def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = None) -> None: ...
3148
+ # allowing any string for cget instead of just Literals because there's no other way to look up tag options
3149
+ def tag_cget(self, tagName: str, option: str): ...
3150
+ @overload
3151
+ def tag_configure(
3152
+ self,
3153
+ tagName: str,
3154
+ cnf: dict[str, Any] | None = None,
3155
+ *,
3156
+ background: str = ...,
3157
+ bgstipple: str = ...,
3158
+ borderwidth: _ScreenUnits = ...,
3159
+ border: _ScreenUnits = ..., # alias for borderwidth
3160
+ elide: bool = ...,
3161
+ fgstipple: str = ...,
3162
+ font: _FontDescription = ...,
3163
+ foreground: str = ...,
3164
+ justify: Literal["left", "right", "center"] = ...,
3165
+ lmargin1: _ScreenUnits = ...,
3166
+ lmargin2: _ScreenUnits = ...,
3167
+ lmargincolor: str = ...,
3168
+ offset: _ScreenUnits = ...,
3169
+ overstrike: bool = ...,
3170
+ overstrikefg: str = ...,
3171
+ relief: _Relief = ...,
3172
+ rmargin: _ScreenUnits = ...,
3173
+ rmargincolor: str = ...,
3174
+ selectbackground: str = ...,
3175
+ selectforeground: str = ...,
3176
+ spacing1: _ScreenUnits = ...,
3177
+ spacing2: _ScreenUnits = ...,
3178
+ spacing3: _ScreenUnits = ...,
3179
+ tabs: Any = ..., # the exact type is kind of complicated, see manual page
3180
+ tabstyle: Literal["tabular", "wordprocessor"] = ...,
3181
+ underline: bool = ...,
3182
+ underlinefg: str = ...,
3183
+ wrap: Literal["none", "char", "word"] = ..., # be careful with "none" vs None
3184
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3185
+ @overload
3186
+ def tag_configure(self, tagName: str, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3187
+ tag_config = tag_configure
3188
+ def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given
3189
+ def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ...
3190
+ def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ...
3191
+ def tag_nextrange(
3192
+ self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None
3193
+ ) -> tuple[str, str] | tuple[()]: ...
3194
+ def tag_prevrange(
3195
+ self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None
3196
+ ) -> tuple[str, str] | tuple[()]: ...
3197
+ def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ...
3198
+ def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ...
3199
+ # tag_remove and tag_delete are different
3200
+ def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ...
3201
+ @overload
3202
+ def window_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ...
3203
+ @overload
3204
+ def window_cget(self, index: _TextIndex, option: Literal["stretch"]) -> bool: ... # actually returns Literal[0, 1]
3205
+ @overload
3206
+ def window_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ...
3207
+ @overload # window is set to a widget, but read as the string name.
3208
+ def window_cget(self, index: _TextIndex, option: Literal["create", "window"]) -> str: ...
3209
+ @overload
3210
+ def window_cget(self, index: _TextIndex, option: str) -> Any: ...
3211
+ @overload
3212
+ def window_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ...
3213
+ @overload
3214
+ def window_configure(
3215
+ self,
3216
+ index: _TextIndex,
3217
+ cnf: dict[str, Any] | None = None,
3218
+ *,
3219
+ align: Literal["baseline", "bottom", "center", "top"] = ...,
3220
+ create: str = ...,
3221
+ padx: _ScreenUnits = ...,
3222
+ pady: _ScreenUnits = ...,
3223
+ stretch: bool | Literal[0, 1] = ...,
3224
+ window: Misc | str = ...,
3225
+ ) -> dict[str, tuple[str, str, str, str, str | int]] | None: ...
3226
+ window_config = window_configure
3227
+ def window_create(
3228
+ self,
3229
+ index: _TextIndex,
3230
+ cnf: dict[str, Any] | None = {},
3231
+ *,
3232
+ align: Literal["baseline", "bottom", "center", "top"] = ...,
3233
+ create: str = ...,
3234
+ padx: _ScreenUnits = ...,
3235
+ pady: _ScreenUnits = ...,
3236
+ stretch: bool | Literal[0, 1] = ...,
3237
+ window: Misc | str = ...,
3238
+ ) -> None: ...
3239
+ def window_names(self) -> tuple[str, ...]: ...
3240
+ def yview_pickplace(self, *what): ... # deprecated
3241
+
3242
+ class _setit:
3243
+ def __init__(self, var, value, callback: Incomplete | None = None) -> None: ...
3244
+ def __call__(self, *args) -> None: ...
3245
+
3246
+ # manual page: tk_optionMenu
3247
+ class OptionMenu(Menubutton):
3248
+ widgetName: Incomplete
3249
+ menuname: Incomplete
3250
+ def __init__(
3251
+ # differs from other widgets
3252
+ self,
3253
+ master: Misc | None,
3254
+ variable: StringVar,
3255
+ value: str,
3256
+ *values: str,
3257
+ # kwarg only from now on
3258
+ command: Callable[[StringVar], object] | None = ...,
3259
+ ) -> None: ...
3260
+ # configure, config, cget are inherited from Menubutton
3261
+ # destroy and __getitem__ are overridden, signature does not change
3262
+
3263
+ # Marker to indicate that it is a valid bitmap/photo image. PIL implements compatible versions
3264
+ # which don't share a class hierarchy. The actual API is a __str__() which returns a valid name,
3265
+ # not something that type checkers can detect.
3266
+ @type_check_only
3267
+ class _Image: ...
3268
+
3269
+ @type_check_only
3270
+ class _BitmapImageLike(_Image): ...
3271
+
3272
+ @type_check_only
3273
+ class _PhotoImageLike(_Image): ...
3274
+
3275
+ class Image(_Image):
3276
+ name: Incomplete
3277
+ tk: _tkinter.TkappType
3278
+ def __init__(
3279
+ self, imgtype, name: Incomplete | None = None, cnf={}, master: Misc | _tkinter.TkappType | None = None, **kw
3280
+ ) -> None: ...
3281
+ def __del__(self) -> None: ...
3282
+ def __setitem__(self, key, value) -> None: ...
3283
+ def __getitem__(self, key): ...
3284
+ configure: Incomplete
3285
+ config: Incomplete
3286
+ def height(self) -> int: ...
3287
+ def type(self): ...
3288
+ def width(self) -> int: ...
3289
+
3290
+ class PhotoImage(Image, _PhotoImageLike):
3291
+ # This should be kept in sync with PIL.ImageTK.PhotoImage.__init__()
3292
+ def __init__(
3293
+ self,
3294
+ name: str | None = None,
3295
+ cnf: dict[str, Any] = {},
3296
+ master: Misc | _tkinter.TkappType | None = None,
3297
+ *,
3298
+ data: str | bytes = ..., # not same as data argument of put()
3299
+ format: str = ...,
3300
+ file: StrOrBytesPath = ...,
3301
+ gamma: float = ...,
3302
+ height: int = ...,
3303
+ palette: int | str = ...,
3304
+ width: int = ...,
3305
+ ) -> None: ...
3306
+ def configure(
3307
+ self,
3308
+ *,
3309
+ data: str | bytes = ...,
3310
+ format: str = ...,
3311
+ file: StrOrBytesPath = ...,
3312
+ gamma: float = ...,
3313
+ height: int = ...,
3314
+ palette: int | str = ...,
3315
+ width: int = ...,
3316
+ ) -> None: ...
3317
+ config = configure
3318
+ def blank(self) -> None: ...
3319
+ def cget(self, option: str) -> str: ...
3320
+ def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0'
3321
+ def copy(self) -> PhotoImage: ...
3322
+ def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ...
3323
+ def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ...
3324
+ def get(self, x: int, y: int) -> tuple[int, int, int]: ...
3325
+ def put(
3326
+ self,
3327
+ data: (
3328
+ str
3329
+ | list[str]
3330
+ | list[list[str]]
3331
+ | list[tuple[str, ...]]
3332
+ | tuple[str, ...]
3333
+ | tuple[list[str], ...]
3334
+ | tuple[tuple[str, ...], ...]
3335
+ ),
3336
+ to: tuple[int, int] | None = None,
3337
+ ) -> None: ...
3338
+ def write(self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None) -> None: ...
3339
+ def transparency_get(self, x: int, y: int) -> bool: ...
3340
+ def transparency_set(self, x: int, y: int, boolean: bool) -> None: ...
3341
+
3342
+ class BitmapImage(Image, _BitmapImageLike):
3343
+ # This should be kept in sync with PIL.ImageTK.BitmapImage.__init__()
3344
+ def __init__(
3345
+ self,
3346
+ name: Incomplete | None = None,
3347
+ cnf: dict[str, Any] = {},
3348
+ master: Misc | _tkinter.TkappType | None = None,
3349
+ *,
3350
+ background: str = ...,
3351
+ data: str | bytes = ...,
3352
+ file: StrOrBytesPath = ...,
3353
+ foreground: str = ...,
3354
+ maskdata: str = ...,
3355
+ maskfile: StrOrBytesPath = ...,
3356
+ ) -> None: ...
3357
+
3358
+ def image_names() -> tuple[str, ...]: ...
3359
+ def image_types() -> tuple[str, ...]: ...
3360
+
3361
+ class Spinbox(Widget, XView):
3362
+ def __init__(
3363
+ self,
3364
+ master: Misc | None = None,
3365
+ cnf: dict[str, Any] | None = {},
3366
+ *,
3367
+ activebackground: str = ...,
3368
+ background: str = ...,
3369
+ bd: _ScreenUnits = ...,
3370
+ bg: str = ...,
3371
+ border: _ScreenUnits = ...,
3372
+ borderwidth: _ScreenUnits = ...,
3373
+ buttonbackground: str = ...,
3374
+ buttoncursor: _Cursor = ...,
3375
+ buttondownrelief: _Relief = ...,
3376
+ buttonuprelief: _Relief = ...,
3377
+ # percent substitutions don't seem to be supported, it's similar to Entry's validation stuff
3378
+ command: Callable[[], object] | str | list[str] | tuple[str, ...] = ...,
3379
+ cursor: _Cursor = ...,
3380
+ disabledbackground: str = ...,
3381
+ disabledforeground: str = ...,
3382
+ exportselection: bool = ...,
3383
+ fg: str = ...,
3384
+ font: _FontDescription = ...,
3385
+ foreground: str = ...,
3386
+ format: str = ...,
3387
+ from_: float = ...,
3388
+ highlightbackground: str = ...,
3389
+ highlightcolor: str = ...,
3390
+ highlightthickness: _ScreenUnits = ...,
3391
+ increment: float = ...,
3392
+ insertbackground: str = ...,
3393
+ insertborderwidth: _ScreenUnits = ...,
3394
+ insertofftime: int = ...,
3395
+ insertontime: int = ...,
3396
+ insertwidth: _ScreenUnits = ...,
3397
+ invalidcommand: _EntryValidateCommand = ...,
3398
+ invcmd: _EntryValidateCommand = ...,
3399
+ justify: Literal["left", "center", "right"] = ...,
3400
+ name: str = ...,
3401
+ readonlybackground: str = ...,
3402
+ relief: _Relief = ...,
3403
+ repeatdelay: int = ...,
3404
+ repeatinterval: int = ...,
3405
+ selectbackground: str = ...,
3406
+ selectborderwidth: _ScreenUnits = ...,
3407
+ selectforeground: str = ...,
3408
+ state: Literal["normal", "disabled", "readonly"] = ...,
3409
+ takefocus: _TakeFocusValue = ...,
3410
+ textvariable: Variable = ...,
3411
+ to: float = ...,
3412
+ validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
3413
+ validatecommand: _EntryValidateCommand = ...,
3414
+ vcmd: _EntryValidateCommand = ...,
3415
+ values: list[str] | tuple[str, ...] = ...,
3416
+ width: int = ...,
3417
+ wrap: bool = ...,
3418
+ xscrollcommand: _XYScrollCommand = ...,
3419
+ ) -> None: ...
3420
+ @overload
3421
+ def configure(
3422
+ self,
3423
+ cnf: dict[str, Any] | None = None,
3424
+ *,
3425
+ activebackground: str = ...,
3426
+ background: str = ...,
3427
+ bd: _ScreenUnits = ...,
3428
+ bg: str = ...,
3429
+ border: _ScreenUnits = ...,
3430
+ borderwidth: _ScreenUnits = ...,
3431
+ buttonbackground: str = ...,
3432
+ buttoncursor: _Cursor = ...,
3433
+ buttondownrelief: _Relief = ...,
3434
+ buttonuprelief: _Relief = ...,
3435
+ command: Callable[[], object] | str | list[str] | tuple[str, ...] = ...,
3436
+ cursor: _Cursor = ...,
3437
+ disabledbackground: str = ...,
3438
+ disabledforeground: str = ...,
3439
+ exportselection: bool = ...,
3440
+ fg: str = ...,
3441
+ font: _FontDescription = ...,
3442
+ foreground: str = ...,
3443
+ format: str = ...,
3444
+ from_: float = ...,
3445
+ highlightbackground: str = ...,
3446
+ highlightcolor: str = ...,
3447
+ highlightthickness: _ScreenUnits = ...,
3448
+ increment: float = ...,
3449
+ insertbackground: str = ...,
3450
+ insertborderwidth: _ScreenUnits = ...,
3451
+ insertofftime: int = ...,
3452
+ insertontime: int = ...,
3453
+ insertwidth: _ScreenUnits = ...,
3454
+ invalidcommand: _EntryValidateCommand = ...,
3455
+ invcmd: _EntryValidateCommand = ...,
3456
+ justify: Literal["left", "center", "right"] = ...,
3457
+ readonlybackground: str = ...,
3458
+ relief: _Relief = ...,
3459
+ repeatdelay: int = ...,
3460
+ repeatinterval: int = ...,
3461
+ selectbackground: str = ...,
3462
+ selectborderwidth: _ScreenUnits = ...,
3463
+ selectforeground: str = ...,
3464
+ state: Literal["normal", "disabled", "readonly"] = ...,
3465
+ takefocus: _TakeFocusValue = ...,
3466
+ textvariable: Variable = ...,
3467
+ to: float = ...,
3468
+ validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
3469
+ validatecommand: _EntryValidateCommand = ...,
3470
+ vcmd: _EntryValidateCommand = ...,
3471
+ values: list[str] | tuple[str, ...] = ...,
3472
+ width: int = ...,
3473
+ wrap: bool = ...,
3474
+ xscrollcommand: _XYScrollCommand = ...,
3475
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3476
+ @overload
3477
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3478
+ config = configure
3479
+ def bbox(self, index) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
3480
+ def delete(self, first, last: Incomplete | None = None) -> Literal[""]: ...
3481
+ def get(self) -> str: ...
3482
+ def icursor(self, index): ...
3483
+ def identify(self, x: int, y: int) -> Literal["", "buttondown", "buttonup", "entry"]: ...
3484
+ def index(self, index: _EntryIndex) -> int: ...
3485
+ def insert(self, index: _EntryIndex, s: str) -> Literal[""]: ...
3486
+ # spinbox.invoke("asdf") gives error mentioning .invoke("none"), but it's not documented
3487
+ def invoke(self, element: Literal["none", "buttonup", "buttondown"]) -> Literal[""]: ...
3488
+ def scan(self, *args): ...
3489
+ def scan_mark(self, x): ...
3490
+ def scan_dragto(self, x): ...
3491
+ def selection(self, *args) -> tuple[int, ...]: ...
3492
+ def selection_adjust(self, index): ...
3493
+ def selection_clear(self): ...
3494
+ def selection_element(self, element: Incomplete | None = None): ...
3495
+ def selection_from(self, index: int) -> None: ...
3496
+ def selection_present(self) -> None: ...
3497
+ def selection_range(self, start: int, end: int) -> None: ...
3498
+ def selection_to(self, index: int) -> None: ...
3499
+
3500
+ class LabelFrame(Widget):
3501
+ def __init__(
3502
+ self,
3503
+ master: Misc | None = None,
3504
+ cnf: dict[str, Any] | None = {},
3505
+ *,
3506
+ background: str = ...,
3507
+ bd: _ScreenUnits = ...,
3508
+ bg: str = ...,
3509
+ border: _ScreenUnits = ...,
3510
+ borderwidth: _ScreenUnits = ...,
3511
+ class_: str = ..., # can't be changed with configure()
3512
+ colormap: Literal["new", ""] | Misc = ..., # can't be changed with configure()
3513
+ container: bool = ..., # undocumented, can't be changed with configure()
3514
+ cursor: _Cursor = ...,
3515
+ fg: str = ...,
3516
+ font: _FontDescription = ...,
3517
+ foreground: str = ...,
3518
+ height: _ScreenUnits = ...,
3519
+ highlightbackground: str = ...,
3520
+ highlightcolor: str = ...,
3521
+ highlightthickness: _ScreenUnits = ...,
3522
+ # 'ne' and 'en' are valid labelanchors, but only 'ne' is a valid _Anchor.
3523
+ labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
3524
+ labelwidget: Misc = ...,
3525
+ name: str = ...,
3526
+ padx: _ScreenUnits = ...,
3527
+ pady: _ScreenUnits = ...,
3528
+ relief: _Relief = ...,
3529
+ takefocus: _TakeFocusValue = ...,
3530
+ text: float | str = ...,
3531
+ visual: str | tuple[str, int] = ..., # can't be changed with configure()
3532
+ width: _ScreenUnits = ...,
3533
+ ) -> None: ...
3534
+ @overload
3535
+ def configure(
3536
+ self,
3537
+ cnf: dict[str, Any] | None = None,
3538
+ *,
3539
+ background: str = ...,
3540
+ bd: _ScreenUnits = ...,
3541
+ bg: str = ...,
3542
+ border: _ScreenUnits = ...,
3543
+ borderwidth: _ScreenUnits = ...,
3544
+ cursor: _Cursor = ...,
3545
+ fg: str = ...,
3546
+ font: _FontDescription = ...,
3547
+ foreground: str = ...,
3548
+ height: _ScreenUnits = ...,
3549
+ highlightbackground: str = ...,
3550
+ highlightcolor: str = ...,
3551
+ highlightthickness: _ScreenUnits = ...,
3552
+ labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
3553
+ labelwidget: Misc = ...,
3554
+ padx: _ScreenUnits = ...,
3555
+ pady: _ScreenUnits = ...,
3556
+ relief: _Relief = ...,
3557
+ takefocus: _TakeFocusValue = ...,
3558
+ text: float | str = ...,
3559
+ width: _ScreenUnits = ...,
3560
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3561
+ @overload
3562
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3563
+ config = configure
3564
+
3565
+ class PanedWindow(Widget):
3566
+ def __init__(
3567
+ self,
3568
+ master: Misc | None = None,
3569
+ cnf: dict[str, Any] | None = {},
3570
+ *,
3571
+ background: str = ...,
3572
+ bd: _ScreenUnits = ...,
3573
+ bg: str = ...,
3574
+ border: _ScreenUnits = ...,
3575
+ borderwidth: _ScreenUnits = ...,
3576
+ cursor: _Cursor = ...,
3577
+ handlepad: _ScreenUnits = ...,
3578
+ handlesize: _ScreenUnits = ...,
3579
+ height: _ScreenUnits = ...,
3580
+ name: str = ...,
3581
+ opaqueresize: bool = ...,
3582
+ orient: Literal["horizontal", "vertical"] = ...,
3583
+ proxybackground: str = ...,
3584
+ proxyborderwidth: _ScreenUnits = ...,
3585
+ proxyrelief: _Relief = ...,
3586
+ relief: _Relief = ...,
3587
+ sashcursor: _Cursor = ...,
3588
+ sashpad: _ScreenUnits = ...,
3589
+ sashrelief: _Relief = ...,
3590
+ sashwidth: _ScreenUnits = ...,
3591
+ showhandle: bool = ...,
3592
+ width: _ScreenUnits = ...,
3593
+ ) -> None: ...
3594
+ @overload
3595
+ def configure(
3596
+ self,
3597
+ cnf: dict[str, Any] | None = None,
3598
+ *,
3599
+ background: str = ...,
3600
+ bd: _ScreenUnits = ...,
3601
+ bg: str = ...,
3602
+ border: _ScreenUnits = ...,
3603
+ borderwidth: _ScreenUnits = ...,
3604
+ cursor: _Cursor = ...,
3605
+ handlepad: _ScreenUnits = ...,
3606
+ handlesize: _ScreenUnits = ...,
3607
+ height: _ScreenUnits = ...,
3608
+ opaqueresize: bool = ...,
3609
+ orient: Literal["horizontal", "vertical"] = ...,
3610
+ proxybackground: str = ...,
3611
+ proxyborderwidth: _ScreenUnits = ...,
3612
+ proxyrelief: _Relief = ...,
3613
+ relief: _Relief = ...,
3614
+ sashcursor: _Cursor = ...,
3615
+ sashpad: _ScreenUnits = ...,
3616
+ sashrelief: _Relief = ...,
3617
+ sashwidth: _ScreenUnits = ...,
3618
+ showhandle: bool = ...,
3619
+ width: _ScreenUnits = ...,
3620
+ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
3621
+ @overload
3622
+ def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3623
+ config = configure
3624
+ def add(self, child: Widget, **kw) -> None: ...
3625
+ def remove(self, child) -> None: ...
3626
+ forget: Incomplete
3627
+ def identify(self, x: int, y: int): ...
3628
+ def proxy(self, *args): ...
3629
+ def proxy_coord(self): ...
3630
+ def proxy_forget(self): ...
3631
+ def proxy_place(self, x, y): ...
3632
+ def sash(self, *args): ...
3633
+ def sash_coord(self, index): ...
3634
+ def sash_mark(self, index): ...
3635
+ def sash_place(self, index, x, y): ...
3636
+ def panecget(self, child, option): ...
3637
+ def paneconfigure(self, tagOrId, cnf: Incomplete | None = None, **kw): ...
3638
+ paneconfig: Incomplete
3639
+ def panes(self): ...
3640
+
3641
+ def _test() -> None: ...