Usage of main()

r rt8396 at gmail.com
Fri Sep 4 08:37:43 CEST 2009


On Sep 4, 12:55 am, Manuel Graune <manuel.gra... at koeln.de> wrote:
(snip)

> How come the main()-idiom is not "the standard way" of writing a
> python-program (like e.g. in C)?

Why use a nested function when you already *in* main? thats like
declaring variables when your compiler could just use some simple
logic...

'2.7' -> string because wrapped in quotes
2 -> integer because is in set{0123456789} && no quotes!
1.23 -> because all digits && has a period

...or using "{" and "}" instead of INDENT and DEDENT.

Python removes the unnecessary cruft and redundancy that is C, and
puts the burden on your machine!

http://www.python.org/dev/peps/pep-0020/

> And in addition: Can someone please explain why the first version
> is so much slower?

leave that one for someone else...



More information about the Python-list mailing list