What's Missing From Python?
Page 1 of 111 Replies - 6468 Views - Last Post: 23 June 2012 - 07:56 PM
#1
What's Missing From Python?
Posted 02 July 2011 - 11:55 AM

POPULAR
To give you an example:
I personally would love to see something similar to C++ enumerators in Python.
Replies To: What's Missing From Python?
#2
Re: What's Missing From Python?
Posted 02 July 2011 - 01:24 PM
Just kidding. A while ago I read a blog from someone that claimed that monads were the natural choice for his problem ... and he went on to implement them in python. Did neither understand nor bookmark it though
No really the point is, what does python need without becoming a bloated language that takes in every silly idea like php.
I can't think of one
#4
Re: What's Missing From Python?
Posted 02 July 2011 - 04:11 PM
Sorry had to say it.
But seriously I wish...
This post has been edited by MATTtheSEAHAWK: 02 July 2011 - 04:13 PM
#5
Re: What's Missing From Python?
Posted 03 July 2011 - 01:59 AM
Drives me nuts every time I have to go += 1 just to increment something.
And an old-school ternary operator (?) I know there is a Pythonic way to do it, but it doesn't work for me or my brain. I like the if (test_something)? true_do_this:false_do_this
I almost added that I'd love to see semicolons and squiggly braces too... but then I realised I was asking for Java so I'll wash my mouth out instead
Nah, everything else I am pretty happy with
#6
Re: What's Missing From Python?
Posted 03 July 2011 - 05:54 AM
#7
Re: What's Missing From Python?
Posted 03 July 2011 - 08:26 AM
kiwi_steve said:
You probably thought about that infamous and or construct that is unreadable. But since Python 2.5 there is a ternary operator.
result = expression_on_true if condition else expression_on_false
It only allows expressions not statements though.
>>> a = 5 >>> "a is positve" if a >= 0 else "a is negative" 'a is positive'
This post has been edited by Nallo: 03 July 2011 - 08:28 AM
#8
Re: What's Missing From Python?
Posted 03 July 2011 - 11:11 AM
This post has been edited by atraub: 03 July 2011 - 11:14 AM
#9
Re: What's Missing From Python?
Posted 03 July 2011 - 05:14 PM
Nallo, on 04 July 2011 - 04:26 AM, said:
kiwi_steve said:
You probably thought about that infamous and or construct that is unreadable. But since Python 2.5 there is a ternary operator.
result = expression_on_true if condition else expression_on_false
It only allows expressions not statements though.
Nope, thats the one I was thinking of...
Sometimes I think things get done differently in Python just so it can be called 'Pythonic'... and despite the fact I like the language overall, sometimes Pythonic is just Pythetic...
#10
Re: What's Missing From Python?
Posted 23 June 2012 - 12:32 PM
It's a small feature, but I think it would be nice to have.
This post has been edited by atraub: 23 June 2012 - 08:05 PM
#11
Re: What's Missing From Python?
Posted 23 June 2012 - 07:45 PM
So len(myList) == 1 and myList[0] == "blah blah blah" will not cause an error in Python if myList is empty.
This post has been edited by sepp2k: 23 June 2012 - 07:57 PM
#12
Re: What's Missing From Python?
Posted 23 June 2012 - 07:56 PM
EDIT:
Also, I guess that means Python is even greater than I realized! wah-hah!
This post has been edited by atraub: 23 June 2012 - 07:57 PM

New Topic/Question
Reply



MultiQuote




|