-
-
Notifications
You must be signed in to change notification settings - Fork 275
PEP 8 planning
Migration of Pyparsing's API over to PEP-8 will be a multi-step process, involving synonym definitions of many methods, method arguments, and module-level variables to provide a migration path for existing pyparsing users. These include:
-
no change to existing class names, as they are already PEP-8 compliant
-
no change to
pyparsing_unicode
orpyparsing_common
; even though these are classes, their intent is to serve as module-like namespaces, so they will retain module naming style -
conversion of non-PEP-8 methods to classes (while redefining current names as synonyms to the new names):
-
delimitedList
->DelimitedList
-
oneOf
->OneOf
-
dictOf
->DictOf
-
infixNotation
->InfixNotation
-
countedArray
->CountedArray
-
matchPreviousLiteral
->MatchPreviousLiteral
-
matchPreviousExpr
->MatchPreviousExpr
-
originalTextFor
->OriginalTextFor
-
locatedExpr
->LocatedExpr
-
nestedExpr
->NestedExpr
-
indentedBlock
->IndentedBlock
-
opAssoc
->OpAssoc
-
commonHTMLentity
->CommonHtmlEntity
-
restOfLine
->RestOfLine
-
commaSeparatedList
->CommaSeparatedList
Method argument names in synonyms will be retained as-is, while argument names in new classes will be PEP-8.
This conversion will also make grammar definitions more consistent in appearance, as most will use just class names, not a mix of class names and method names.
-
-
no change to:
alphas
nums
alphanums
hexnums
printables
col
lineno
line
-
alphas8bit
(may be deprecated in favor ofpyparsing_unicode.Latin1.alphas
) -
punc8bit
(may be deprecated in favor ofpyparsing_unicode.Latin1.printables
)
-
renaming (with retained synonyms):
-
quotedString
->quoted_string
-
dblQuotedString
->dbl_quoted_string
-
sglQuotedString
->sgl_quoted_string
-
unicodeString
->unicode_string
-
removeQuotes
->remove_quotes
-
traceParseAction
->trace_parse_action
-
nullDebugAction
->null_debug_action
-
matchOnlyAtCol
->match_only_at_col
-
replaceWith
->replace_with
-
tokenMap
->token_map
-
upcaseTokens
->upcase_tokens
-
downcaseTokens
->downcase_tokens
-
makeHTMLTags
->make_html_tags
-
makeXMLTags
->make_xml_tags
-
withAttribute
->with_attribute
-
withClass
->with_class
-
replaceHTMLentity
->replace_html_entity
-
-
deprecate
-
empty
,lineStart
,lineEnd
,stringStart
,stringEnd
- these module-level names are just predefined instances for classesEmpty
,LineStart
, etc., and can be replaced with in-place instantiation of their respective classes
-
-
TBD
ungroup
srange
cStyleComment
cppStyleComment
htmlComment
dblSlashComment
javaStyleComment
pythonStyleComment