From fe3e0a2fae01bc8fc71b8ba56b476284170a547c Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Fri, 21 Jul 2023 15:26:16 +1000 Subject: [PATCH] cmd: Remove comments about using the string module. Even though we now have a `string` module, just keep the existing IDENTCHARS definition. - If someone doesn't already have string installed (or aren't otherwise importing it), this would add an extra dependency and more memory used. - If they do, then the resulting concatenated string has to be allocated separately, so there's no gain from using the string.x components. Signed-off-by: Jim Mussared --- python-stdlib/cmd/cmd.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python-stdlib/cmd/cmd.py b/python-stdlib/cmd/cmd.py index 9d46a8a7..447ea148 100644 --- a/python-stdlib/cmd/cmd.py +++ b/python-stdlib/cmd/cmd.py @@ -51,13 +51,12 @@ this means that that help by doc string feature doesn't work. completions have also been stripped out. """ -# import string, sys -import sys # MiroPython doesn't yet have a string module +import sys __all__ = ["Cmd"] PROMPT = "(Cmd) " -# IDENTCHARS = string.ascii_letters + string.digits + '_' +# This is equivalent to string.ascii_letters + string.digits + '_' IDENTCHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"