#75 Python identation problem

closed-works-for-me
nobody
None
5
2008-01-10
2007-07-03
Jay Ro
No

When programming in Python I got several identation errors in lines that appeard to be correct.

For example, in the last line of a method (def....) I had:

if boolean:
print something
else:
print another_thing

Well, the python compiler told me that the 'else' was incorrectly idented but it appeard to be good in Geany. So, I opened the same program with gedit and gedit show me this:

if boolean:
print something
else:
print another_thing

It happens many times, and appears to be everytime in the last line of a python method.

Besides this bug, Geany's my favorite IDE at the moment.

Keep up the good work, folks.

Discussion

  • Nick Treleaven

    Nick Treleaven - 2007-07-07

    Logged In: YES
    user_id=1268692
    Originator: NO

    Hi,
    It's difficult to see the problem as sf.net may have removed tab characters. Could you attach an example file please?

    Also which version of Geany are you using?

    What are your settings for indentation - could you also attach your ~/.geany/geany.conf configuration file?

     
  • Nick Treleaven

    Nick Treleaven - 2007-08-29

    Logged In: YES
    user_id=1268692
    Originator: NO

    As in my last comment, we need more information to reproduce this. I've written some Python scripts and I have no problem with indentation.

    Some thoughts:
    1. If it looked good in Geany, there must have been a mix of tabs and spaces in the indentation somewhere. It's possible an unwanted tab or space was inserted if you pressed e.g. shift+space for the suppress autocompletion keybinding. Also perhaps you're mixing tabs and spaces - make sure the 'Use tabs...' setting is correct.

    2. Is the tab width setting correct? It's possible that's causing a problem.

     
  • Nick Treleaven

    Nick Treleaven - 2008-01-10

    Logged In: YES
    user_id=1268692
    Originator: NO

    Closing this bug for now as we need more information to be able to reproduce it, but feel free to add comments.

     
  • Nick Treleaven

    Nick Treleaven - 2008-01-10
    • status: open --> closed-works-for-me
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks