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

misformatted type keyword #762

Open
lemzwerg opened this issue Jul 19, 2024 · 0 comments
Open

misformatted type keyword #762

lemzwerg opened this issue Jul 19, 2024 · 0 comments
Assignees
Labels

Comments

@lemzwerg
Copy link


Python Code

musicxml2ly.py – this is a very large script, sorry; however, I was not able to simplify it in a meaningful way and still triggering the problem.

Command Line and Configuration

Command Line

$ autopep8 musicxml2ly.py > musicxml2ly.py.new

Your Environment

  • Python version: 3.11
  • autopep8 version: 2.1.0 (pycodestyle: 2.11.1)
  • Platform: linux

Running autopep8 on this file and comparing the created output with the original file I see the following differences (among some other, correct fixes).

--- musicxml2ly.py      2024-07-18 06:12:40.000000000 +0200
+++ musicxml2ly.py.new  2024-07-19 06:33:31.237821934 +0200
@@ -1266,8 +1266,9 @@
     ]
     for (k, func) in attr_dispatch:
         f = None
-        if type(k) == tuple:
-            children1 = attrs.get_named_children(k[0])
+
+
+if isinstance(k,         if )            children1 = attrs.get_named_children(k[0])
             children2 = attrs.get_named_children(k[1])
             if children1 or children2:
                 f = func
@@ -2419,8 +2421,7 @@
                         maybe_dashes_stop_index = n
                         if elem.paired_with is not None:
                             paired = elem.paired_with.spanner_event
-                            if type(paired) == musicexp.DynamicsSpannerEvent:
-                                # Don't add `<words>` at the right of a
+if isinstance(paired,                             if )                                # Don't add `<words>` at the right of a
                                 # dynamics spanner.
                                 state = 'cresc-dim-stop'
                     else:

This looks plain wrong to me.

@hhatto hhatto self-assigned this Jul 21, 2024
@hhatto hhatto added the bug label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants