Skip to content

Commit

Permalink
feat(lookup_table): builtin module update for Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Dec 26, 2024
1 parent bd32f3f commit 4362932
Showing 1 changed file with 184 additions and 18 deletions.
202 changes: 184 additions & 18 deletions lua/python_import/lookup_table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,202 @@ M = {}
-- If nothing is found, it will return `import ..` anyway.
-- However, it might take some time to search the candidate,
-- so we define a list of common imports here.
-- Updated for Python 3.13
---@type string[]
M.default_import = {
"pickle",
"os",
"sys",
"re",
"json",
"time",
"datetime",
"random",
"math",
"importlib",
-- built-in
"abc",
"argparse",
"shutil",
"array",
"ast",
"asyncio",
"atexit",
"base64",
"bdb",
"binascii",
"bisect",
"builtins",
"bz2",

"calendar",
"cmath",
"cmd",
"code",
"codecs",
"codeop",
"collections",
"colorsys",
"compileall",
"concurrent",
"configparser",
"contextlib",
"contextvars",
"copy",
"copyreg",
"cProfile",
"csv",
"ctypes",
"curses",
"dataclasses",
"datetime",
"dbm",
"decimal",
"difflib",
"dis",
"doctest",

"email",
"encodings",
"ensurepip",
"enum",
"errno",

"faulthandler",
"fcntl",
"filecmp",
"fileinput",
"fnmatch",
"fractions",
"ftplib",
"functools",

"gc",
"getopt",
"getpass",
"gettext",
"glob",
"itertools",
"pathlib",
"abc",
"contextlib",
"collections",
"graphlib",
"grp",
"gzip",
"hashlib",
"heapq",
"hmac",
"html",
"http",
"idlelib",
"imaplib",
"importlib",
"inspect",
"io",
"ipaddress",
"itertools",
"json",
"keyword",
"linecache",
"locale",
"logging",
"lzma",
"mailbox",
"marshal",
"math",
"mimetypes",
"mmap",
"modulefinder",
"msvcrt",
"multiprocessing",
"netrc",
"numbers",
"operator",
"optparse",
"os",
"pathlib",
"pdb",
"pickle",
"pickletools",
"pkgutil",
"platform",
"plistlib",
"poplib",
"posix",
"pprint",
"profile",
"pstats",
"pty",
"pwd",
"py_compile",
"pyclbr",
"pydoc",

"queue",
"quopri",
"random",
"re",
"readline",
"reprlib",
"resource",
"rlcompleter",
"runpy",
"sched",
"secrets",
"select",
"selectors",
"shelve",
"shlex",
"shutil",
"signal",
"site",
"sitecustomize",
"smtplib",
"socket",
"socketserver",
"sqlite3",
"ssl",
"stat",
"statistics",
"string",
"stringprep",
"struct",
"subprocess",
"symtable",
"sys",
"sysconfig",
"syslog",

"tabnanny",
"tarfile",
"tempfile",
"termios",
"test",
"textwrap",
"threading",
"time",
"timeit",
"tkinter",
"token",
"tokenize",
"tomllib",
"trace",
"traceback",
"tracemalloc",
"tty",
"turtle",
"turtledemo",
"types",
"typing",
"unicodedata",
"unittest",
"urllib",
"usercustomize",
"uuid",
"venv",
"warnings",
"wave",
"weakref",
"webbrowser",
"winreg",
"winsound",
"wsgiref",
"xml",
"xmlrpc",
"zipapp",
"zipfile",
"zipimport",
"zlib",
"zoneinfo",

-- not built-in
"typing_extensions",
"setuptools",
"subprocess",
"xml",

-- third-party
"PIL",
Expand All @@ -42,6 +207,7 @@ M.default_import = {
"selenium",
"neptune",
"torch",
"pytest",
}

---@type table<string, string>
Expand Down

0 comments on commit 4362932

Please sign in to comment.