Skip to content

Commit

Permalink
feat(cli): write "date-time" with dash
Browse files Browse the repository at this point in the history
"datetime" will look strange to a user who doesn't know Python. It
exposes internals that may change. (What if we adopt a special class for
times without dates?) Let us instead pick something very close from
natural language.
  • Loading branch information
dbohdan committed Aug 10, 2023
1 parent 794a4dc commit 3b2c696
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ options:
input format
--json-indent n, --indent-json n
JSON indentation
-k, --stringify Turn into strings boolean, datetime, and null keys for
JSON and TOML and null values for TOML
-k, --stringify Turn into strings boolean, date-time, and null keys
for JSON and TOML and null values for TOML
-o output, --output output
output file
--of {cbor,json,msgpack,toml,yaml}, -of {cbor,json,msgpack,toml,yaml}, --output-format {cbor,json,msgpack,toml,yaml}
Expand Down
4 changes: 2 additions & 2 deletions remarshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def parse_command_line(argv: List[str]) -> argparse.Namespace: # noqa: C901.
dest="stringify",
action="store_true",
help=(
"Turn into strings boolean, datetime, and null keys for JSON "
"Turn into strings boolean, date-time, and null keys for JSON "
"and TOML and null values for TOML"
),
)
Expand Down Expand Up @@ -438,7 +438,7 @@ def reject_special_keys(key: Any) -> Any:
msg = "boolean key"
raise TypeError(msg)
if isinstance(key, datetime.datetime):
msg = "datetime key"
msg = "date-time key"
raise TypeError(msg)
if key is None:
msg = "null key"
Expand Down

0 comments on commit 3b2c696

Please sign in to comment.