Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-23 Thread Timothy N. Tsvetkov
On Feb 16, 10:41 pm, Andrej Mitrovic andrej.mitrov...@gmail.com
wrote:
 On Feb 16, 7:38 pm, Casey Hawthorne caseyhhammer_t...@istar.ca
 wrote:

  Interesting talk on Python vs. Ruby and how he would like Python to
  have just a bit more syntactic flexibility.

 http://blog.extracheese.org/2010/02/python-vs-ruby-a-battle-to-the-de...
  --
  Regards,
  Casey

 Gary's friend Geoffrey Grosenbach says in his blog post (which Gary
 linked to): Python has no comparable equivalent to Ruby’s do end
 block. Python lambdas are limited to one line and can’t contain
 statements (for, if, def, etc.). Which leaves me wondering, what’s the
 point?

 I'm sorry, lambda's do support if's and for's. Also, lambda's are
 expressions, not statements, but you can pass them around, keep them
 in a dictionary if you want to. And if you need more than one line of
 statements, for crying out loud use a def? And who needs those do-
 end blocks anyway, trying to turn Python into Pascal?

I think there are some nice use-cases for anonymous functions /
blocks. First, mentioned above, is pretty DSL. And the second is using
blocks in map/reduce functions. Yes, you can pass there a function but
I believe that in most situations it is more readable to pass a
multiline anonymous function / block than defined somewhere function
written only for a single map/reduce operation. And often when you use
reduce it is a bit more complicated then just one line function.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Ruby

2010-02-03 Thread Timothy N. Tsvetkov
On Jan 28, 2:29 am, Jonathan Gardner jgard...@jonathangardner.net
wrote:
 On Jan 27, 5:47 am, Simon Brunning si...@brunningonline.net wrote:



  I think Python is a little cleaner, but I'm sure you'd find Ruby fans
  who'd argue the complete opposite.

 Are you sure about that?

 There's a lot of line noise in Ruby. How are you supposed to pronounce
 @@? What about {|..| ... }?

 There's a lot of magic in Ruby as well. For instance, function calls
 are made without parentheses. Blocks can only appear as the first
 argument. There's a lot more, if you put your mind to it.

 Indentation is also optional in Ruby. You can quickly fool a newbie by
 not indenting your code properly, which is impossible in Python.

 Python is much, much cleaner. I don't know how anyone can honestly say
 Ruby is cleaner than Python.

I will. I developed on both (Python was first) and I think that ruby I
very clean and maybe cleaner than Python. Also I don't know any
situation where you need to pronounce your code symbol by symbol. You
might need to pronounce some semantics.

And you're wrong with blocks.

About indent your right. It helps newbies indent code becouse they
must to. But most of professional developers started with Pascal and
then C and they all indent well :) it is about culture and it is what
about teacher should say.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What python can NOT do?

2009-08-29 Thread Timothy N. Tsvetkov
On Aug 29, 4:26 am, qwe rty hkh00...@gmail.com wrote:
 On Aug 29, 3:14 am, Tim Chase python.l...@tim.thechases.com wrote:





   what else can NOT be done in python? what are the limitations of the
   language?

   I understand there's a little trouble getting Python to prove
   that P=NP  You'll also find that it only comes close to solving
   the unrestricted three-body problem and the Traveling Salesman
   problem is still limited to fallible heuristics and searching the
   entire solution set in better than O(2**n) time.

  I forgot about solving the Spam problem entirely.  And answering
  poorly worded/thought-out questions on the internet...

  I've also been sorely disappointed by Python's ability to make a
  good chocolate cream silk pie.

  -tkc

 if you don't know the answer please don't reply

If you want to ask a silly question don't ask it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: speeding up reading files (possibly with cython)

2009-03-08 Thread Timothy N. Tsvetkov

 If that's the problem, the solution is: get more memory.


Or maybe think about algorithm, which needs less memory... My
experience tells me, that each time when you want to store a lot of
data into dict (or other structure) to analyze it then, you can find a
way not to store so much amount of data %)
--
http://mail.python.org/mailman/listinfo/python-list