Skip to content

Commit

Permalink
Fix keywordization of keys from py->lisp (#1157)
Browse files Browse the repository at this point in the history
Fixes #1156
  • Loading branch information
chrisrink10 authored Dec 1, 2024
1 parent cca6143 commit 8ece92f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
* Fix a bug where `#` characters were not legal in keywords and symbols (#1149)
* Fix a bug where seqs were not considered valid input for matching clauses of the `case` macro (#1148)
* Fix a bug where `py->lisp` did not keywordize string keys potentially containing namespaces (#1156)

## [v0.3.3]
### Added
Expand Down
4 changes: 2 additions & 2 deletions src/basilisp/lang/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1837,8 +1837,8 @@ def _keywordize_keys(k, keywordize_keys: bool = True):


@_keywordize_keys.register(str)
def _keywordize_keys_str(k, keywordize_keys: bool = True):
return kw.keyword(k)
def _keywordize_keys_str(k: str, keywordize_keys: bool = True):
return keyword_from_name(k)


@to_lisp.register(dict)
Expand Down
4 changes: 4 additions & 0 deletions tests/basilisp/runtime_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ def test_to_map(self):
kw.keyword("f"): vec.v("tuple", "not", "list"),
}
),
kw.keyword("h", ns="g"): "i/j",
kw.keyword("m", ns="k.l"): None,
}
) == runtime.to_lisp(
{
Expand All @@ -697,6 +699,8 @@ def test_to_map(self):
"e": {"a", "set"},
kw.keyword("f"): ("tuple", "not", "list"),
},
"g/h": "i/j",
"k.l/m": None,
}
)

Expand Down

0 comments on commit 8ece92f

Please sign in to comment.