use-python-keyword 0.0.1

Python keyword and soft-keyword primitives for RustUse
Documentation
  • Coverage
  • 20%
    11 out of 55 items documented1 out of 11 items with examples
  • Size
  • Source code size: 12.58 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 663.22 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-python
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-python-keyword

Python keyword and soft-keyword primitives for RustUse.

Experimental

use-python-keyword is experimental while use-python remains below 0.3.0.

Example

use use_python_keyword::{PythonKeyword, is_python_reserved_word};

let keyword: PythonKeyword = "async".parse()?;

assert_eq!(keyword.to_string(), "async");
assert!(is_python_reserved_word("match"));
# Ok::<(), use_python_keyword::PythonKeywordParseError>(())

Scope

  • Common hard Python keywords.
  • Common soft keywords such as match, case, type, and _.
  • Display and parse helpers that preserve Python source spelling.

Non-goals

  • Parsing Python source code.
  • Determining whether a soft keyword is active in a specific grammar context.
  • Tracking future Python grammar changes at runtime.

License

Licensed under either Apache-2.0 or MIT.