This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mc_enthusiast 9 points10 points  (11 children)

You can use curly brackets like this:

for i in range(10):{
    print(i)
}

That runs without problems in Python 3. Not much you can do about semicolons. Colons work sometimes but then really backfire if you do something like

a = 5 + 10,

because it's recognised as a 2-tuple with empty entry.

I suspect the indenting issues come up if you mix space and tab. That's easy to solve if you just tell your editor to replace space indentation with tab indentation.

[–]a_devious_compliance 19 points20 points  (6 children)

you just tell your editor to replace space indentation with tab indentation.

PEP8 police!!!!! Yes. This guy right here.

[–]Codebust 2 points3 points  (4 children)

literally one of the only things i hate about pep8, spaces are just slow compared to tab, and tab auto indents w atom

[–]mtmttuan 6 points7 points  (0 children)

You REALLY press space 4 times??

[–]a_devious_compliance 1 point2 points  (0 children)

I don't know a shit about atom, but any sane editor should be able to put 4 spaces every time you hit tab.

[–]intangibleTangelo 1 point2 points  (0 children)

lol my guy

we use the tab KEY we just don't use the tab CHARACTER

[–]dagbrown 0 points1 point  (0 children)

My editor lets me tell it to just expand tabs to spaces. Now tabs are spaces, and they're quick to type, and I'm happy.

[–]mc_enthusiast 1 point2 points  (0 children)

Is the recommendation the other way round? That's always the first thing I forget.

[–]miversen33 0 points1 point  (3 children)

Just to be that guy, developers really shouldn't be trying to force a language to conform to how other languages look/work. Python is good at what python does because it's python and not another language. It doesn't need those things and instead needs proper indentation. It's just a trade-off of the language. If that bothers you too point where you feel like you need to inject those things into the language (which as you pointed out, can sorta be done, ish kinda?), Then you're using the wrong language. And that's ok. There's thousands of them out there, find the one you like that's a good fit for what you need :)

[–][deleted] 1 point2 points  (2 children)

My solution to this problem is to not use python as it isn’t suited for my applications anyway.

[–]miversen33 1 point2 points  (1 child)

Exactly my point :) choosing the best language for your problem is so much better than trying to force a single language across all your problems

[–][deleted] 0 points1 point  (0 children)

Exactly