Skip to content

Commit 5f5ebe4

Browse files
authored
Autocomplete python/ namespace at the REPL (#788)
Fixes #787
1 parent 4bf6f2e commit 5f5ebe4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
* Added support for passing through `:tag` metadata to the generated Python AST (#354)
1010
* Added support for calling symbols as functions on maps and sets (#775)
1111
* Added support for passing command line arguments to Basilisp (#779)
12+
* Added support for autocompleting names in the `python/` pseudo-namespace for Python builtins at the REPL (#787)
1213

1314
### Changed
1415
* Optimize calls to Python's `operator` module into their corresponding native operators (#754)

src/basilisp/lang/runtime.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pylint: disable=too-many-lines
2-
2+
import builtins
33
import contextlib
44
import decimal
55
import functools
@@ -867,7 +867,9 @@ def __complete_imports_and_aliases(
867867

868868
candidates = filter(
869869
Namespace.__completion_matcher(prefix),
870-
itertools.chain(aliases.items(), imports.items()),
870+
itertools.chain(
871+
aliases.items(), imports.items(), [(sym.symbol("python"), builtins)]
872+
),
871873
)
872874
if name_in_module is not None:
873875
for _, module in candidates:

0 commit comments

Comments
 (0)