Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not follow the "Style Guild for Python Code"(PEP 8) #29

Closed
KarlManong opened this issue Jun 28, 2013 · 1 comment
Closed

Why not follow the "Style Guild for Python Code"(PEP 8) #29

KarlManong opened this issue Jun 28, 2013 · 1 comment

Comments

@KarlManong
Copy link

Thank U for ur job.
When i'm reading ur codes, i was confused the code style, such as:

        nodetype        = start_node.nodeName.lower()
        name            = start_node.getAttribute('name').lower()
        context         = start_node.getAttribute('context').lower()
        mutex           = start_node.getAttribute('mutex').lower()
        cancel          = start_node.getAttribute('cancel').lower()
        success         = start_node.getAttribute('success').lower()
        times           = start_node.getAttribute('times').lower()
        times_field     = start_node.getAttribute('times-field').lower()
        threshold       = start_node.getAttribute('threshold').lower()
        threshold_field = start_node.getAttribute('threshold-field').lower()
        file            = start_node.getAttribute('file').lower()
        file_field      = start_node.getAttribute('file-field').lower()

see http://www.python.org/dev/peps/pep-0008/#id16

and

type(context) != type([])

just use

isinstance(context, list)

and

_spec_map.has_key(child_node.nodeName.lower()):

just use

child_node.nodeName.lower() in _spec_map

.
Thank U.

@knipknap
Copy link
Contributor

Not worth the effort IMO, though I may accept patches.

danfunk added a commit that referenced this issue Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants