Skip to content

Commit 8ece92f

Browse files
authored
Fix keywordization of keys from py->lisp (#1157)
Fixes #1156
1 parent cca6143 commit 8ece92f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Fixed
99
* Fix a bug where `#` characters were not legal in keywords and symbols (#1149)
1010
* Fix a bug where seqs were not considered valid input for matching clauses of the `case` macro (#1148)
11+
* Fix a bug where `py->lisp` did not keywordize string keys potentially containing namespaces (#1156)
1112

1213
## [v0.3.3]
1314
### Added

src/basilisp/lang/runtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,8 +1837,8 @@ def _keywordize_keys(k, keywordize_keys: bool = True):
18371837

18381838

18391839
@_keywordize_keys.register(str)
1840-
def _keywordize_keys_str(k, keywordize_keys: bool = True):
1841-
return kw.keyword(k)
1840+
def _keywordize_keys_str(k: str, keywordize_keys: bool = True):
1841+
return keyword_from_name(k)
18421842

18431843

18441844
@to_lisp.register(dict)

tests/basilisp/runtime_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,8 @@ def test_to_map(self):
687687
kw.keyword("f"): vec.v("tuple", "not", "list"),
688688
}
689689
),
690+
kw.keyword("h", ns="g"): "i/j",
691+
kw.keyword("m", ns="k.l"): None,
690692
}
691693
) == runtime.to_lisp(
692694
{
@@ -697,6 +699,8 @@ def test_to_map(self):
697699
"e": {"a", "set"},
698700
kw.keyword("f"): ("tuple", "not", "list"),
699701
},
702+
"g/h": "i/j",
703+
"k.l/m": None,
700704
}
701705
)
702706

0 commit comments

Comments
 (0)