I've asked this question at stackoverflow a few weeks ago, and to make
it clear: this should NOT be a copy of the stackoverflow-thread
"hidden features of Python".
I want to design a poster for an open source conference, the local
usergroup will have a table there, and in the past years there were
some people that came to the python-table just to ask "why should I
use python?".
For those guys would be a poster quite cool which describes the most
popular and beloved python features.
So, may you help me please? If there's a similar thread/blogpost/
whatever, please give it to me, google couldn't.
Regards
Julian
It's terrible, but all the alternatives are even worse. ;-)
Terry Jan Reedy
Neither unique to Python.
And then're the other killer "features" superfluous ":"s and rigid
formatting!
I love list comprehensions, but am currently falling for 'with'.
~Sean
* simplicity
* documentation - some criticise it, I love it.
* duck typing
* batteries included
And lots more!
--
Arnaud
- Very easy to learn, at least for the not-too-hairy fragment
- some features like generators are advanced compared with some
other languages, yet still easy to use
- pleasant-to-use syntax (yes, the indentation stuff that everyone
is freaked out by at first) and well-evolved library makes coding
very productive and enjoyable
- reasonably good documentation
- large and friendly user/developer community
> "Terry Reedy" <tjre...@udel.edu> wrote in message
>
> news:mailman.1929.1265328...@python.org...
>
> > Iterators, and in particular, generators.
> > A killer feature.
>
> > Terry Jan Reedy
+1, iterators/generators is among Python's best features for me too.
> Neither unique to Python.
Can you name a single feature that is unique to a language, Python or
other ? Every idea that's any good has been copied over, usually more
than once.
> And then're the other killer "features" superfluous ":"s and rigid
> formatting!
I'll give the benefit of doubt and assume you're joking rather than
trolling.
George
> For those guys would be a poster quite cool which describes the most
> popular and beloved python features.
That it is ego-orientated programming ;-)
http://mail.python.org/pipermail/python-announce-list/2009-April/007419.html
--
mph
That remembers me the time when it took me 4 hours to write a ten lines
metaclass :o)
JM
This is effin hilarious! Should be either linked or stored on python.org
Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
no need to 'DIM everything AS Integer' etc.!
That might be true when used to code actual algorithms using basic features.
But a lot of Pythonisms would appear mysterious to someone who doesn't know
the language (for example, what does :: mean in an array index).
Or perhaps pseudo-code is much more advanced these days...
--
bartc
not to mention the ever hilarious (that is, when you don't have to
maintain it) typical Java idiom:
EveryThing theEveryThing = new EveryThing();
My all-time favorite Python feature : it fits my brain.
My reasoning: I needed a language more powerful than bash, but more
portable and faster to develop (at least small scripts) than C/C++. So
I needed a scripting language. Python, Ruby, Perl, Tcl, ...?
Python seems to be the language with the most libraries available,
programs written in it, OS-support (even runs on my smartphone), has a
good data-model, has a good interactive shell (iPython).
JM
(sorry couldn't help)
> I've asked this question at stackoverflow a few weeks ago, and
> to make it clear: this should NOT be a copy of the
> stackoverflow-thread "hidden features of Python".
>
> I want to design a poster for an open source conference, the
> local usergroup will have a table there, and in the past years
> there were some people that came to the python-table just to
> ask "why should I use python?".
>
> For those guys would be a poster quite cool which describes
> the most popular and beloved python features.
In the fine old tradition:
Python: It sucks less.
A lot less.
--
Grant Edwards grante Yow! You should all JUMP
at UP AND DOWN for TWO HOURS
visi.com while I decide on a NEW
CAREER!!
!-)
But FWIW, that's exactly the point : even a stoopid like me can manage
to learn and use Python, and proceed to write working apps without
spending more time reading the doc than actually solving the problem.
> http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/choose_python.pdf
>
Choose to get your difficult questions about threads in Python ignored.
Oh well..
> For those guys would be a poster quite cool which describes the most
> popular and beloved python features.
Dictionaries.
A workhorse of Python, by far the most useful data structure.
I'll give the benefit of doubt and assume you're joking rather than
trolling.
George
*************************************************************
Not trolling, my friend!
GvR got it right when he discarded the superfluous semicolons from the ends
of statements--and then he ADDS superfluous colons to the ends of control
statements? It will probably be as much of a shock to you as it was to me
when I learned after studying parsing that colons, semicolons, "then"'s and
"do"'s, etc., are simply noise tokens that serve no purpose except to
clutter up the source.
As for enforced indentation, back in the late 60's when I was a programming
newbie I remember thinking how cool it would be to just indent the
statements controlled by for loops (we didn't have none of them fancy while
loops in FORTRAN back then! :-) ) Not too long after that I saw the havoc
that a buggy editor could wreak on nicely-formatted source. :-( Formatting
held hostage to a significant, invisible whitespace char? An inevitable
accident waiting to happen! Not good, Guido; not good at all.
That'll do for starters. :-)
> Ethan Furman wrote:
>
>> http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/
choose_python.pdf
>>
>>
> Choose to get your difficult questions about threads in Python ignored.
> Oh well..
With an attitude like that, you're damn lucky if you don't get kill-
filed. It was SIX MINUTES since you posted your question about timers,
what did you expect?
Threads are hard, and many people don't use them at all. You might never
get an answer, even without alienating people. Complaining after six DAYS
might be acceptable, if you do it with a sense of humour, but after six
minutes?
Advice on public forums is free, but it doesn't come with an guaranteed
response time. If you want a Service Level Agreement, you will need to
pay somebody for it.
--
Steven
> GvR got it right when he discarded the superfluous semicolons from the
> ends of statements--and then he ADDS superfluous colons to the ends of
> control statements?
They're not superfluous, they have a real, practical use.
> It will probably be as much of a shock to you as it
> was to me when I learned after studying parsing that colons, semicolons,
> "then"'s and "do"'s, etc., are simply noise tokens that serve no
> purpose except to clutter up the source.
Incorrect, they do have a use. Hint: source code isn't just read by
parsers.
> As for enforced indentation, back in the late 60's when I was a
> programming newbie I remember thinking how cool it would be to just
> indent the statements controlled by for loops (we didn't have none of
> them fancy while loops in FORTRAN back then! :-) ) Not too long after
> that I saw the havoc that a buggy editor could wreak on nicely-formatted
> source. :-(
As opposed to how resistant source code is to buggy editors that make
other changes to source code.
If your editor flips the order of characters, or turns the digit "4" into
"7", or deletes braces, or inserts "#" characters at the start of lines,
you would dump the editor in a second. But if the editor inserts or
removes whitespace, we're supposed to continue using the editor and
change the language?
> Formatting held hostage to a significant, invisible
> whitespace char?
It's not invisible. You can see it by noticing the space between the left
margin and the start of non-whitespace text. Can you see the difference
between these?
hello world
hello world
Of course you can, unless your News reader or mail client is buggy. If it
is deleting whitespace at the start of lines, how can you trust it not to
delete anything else?
Trailing spaces and tabs, on the other hand, *are* invisible. But they're
also insignificant, and so don't matter.
(Except for one little tiny corner case, which I shall leave as an
exercise for the advanced reader.)
--
Steven
Drat, now I'm gonna be up at odd hours tonight dredging my brain
for such corner cases. My catalog so far:
- triple-quoted multi-line strings
- "\" line-continuations don't work with trailing whitespace
(though Vim's syntax highlighting flags them, changing their
color if there's whitespace afterwards)
- files that read themselves (or perhaps depend on
introspection/debugging modules to read themselves)
Any others that I missed?
-tkc
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/
Pretty cool! I see your blog post criticizing Java's lack of type
inference, and then immediately adjacent to the post there's a banner ad
for a book called "Programming in Scala". I think I am getting a mixed
message ;-)
> My reasoning: I needed a language more powerful than bash, but more
> portable and faster to develop (at least small scripts) than C/C++. So
> I needed a scripting language. Python, Ruby, Perl, Tcl, ...?
>
> Python seems to be the language with the most libraries available,
I like Python a lot. That said, it looks like Perl's CPAN currently
has approximately double the number of packages in the Cheeseshop.
I'm guessing the CPAN is still growing, but I don't know how fast it
is growing compared to the Cheeseshop.
I won't venture a guess as to which has a higher percentage of older
unmaintained packages.
> I've asked this question at stackoverflow a few weeks ago, and to make
> it clear: this should NOT be a copy of the stackoverflow-thread
> "hidden features of Python".
Thanks for the hint, interesting stuff in there.
> For those guys would be a poster quite cool which describes the most
> popular and beloved python features.
For me as an electronics HW guy, I really like that I can easily
handle binary data without doing tedious and error prone shifting and
anding and oring.
I didn't expect immediate answer to this particular question. I have
repeatedly asked many questions about threads in the past, and IIRC
every one of them was ignored.
>
> Threads are hard, and many people don't use them at all. You might never
> get an answer, even without alienating people. Complaining after six DAYS
> might be acceptable, if you do it with a sense of humour, but after six
> minutes?
Well, it's 4 days now. I would be happy to get 50% response rate.
Apparently nobody is really using threads.
regards,
mk
I use threads.
Geremy Condra
Readability
--
Aahz (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/
import antigravity
>> Threads are hard, and many people don't use them at all. You might
>> never get an answer, even without alienating people. Complaining after
>> six DAYS might be acceptable, if you do it with a sense of humour, but
>> after six minutes?
>
> Well, it's 4 days now. I would be happy to get 50% response rate.
> Apparently nobody is really using threads.
Please see my response to your post "timer for a function".
--
Steven
thanks everyone for that many answers! I'm lying in bed with a bad
cold, so I'll get through all the posts on the weekend.
regards
Julian