Re: Python critique

2011-01-31 Thread sturlamolden
On 11 Des 2010, 00:09, Antoine Pitrou wrote: > >     Probably the biggest practical problem with CPython is > > that C modules have to be closely matched to the version of > > CPython.  There's no well-defined API that doesn't change. > > Please stop spreading FUD:http://docs.python.org/c-api/ind

Re: Python critique

2011-01-31 Thread sturlamolden
On 10 Des 2010, 21:02, John Nagle wrote: >     Probably the biggest practical problem with CPython is > that C modules have to be closely matched to the version of > CPython.  There's no well-defined API that doesn't change. ctypes and DLLs in plain C do not change, and do not depend on CPython

Re: Python critique

2011-01-29 Thread rantingrick
On Dec 13 2010, 4:40 am, Jean-Michel Pichavant wrote: > It's more a demonstration that you can do it with python. > The reason is that Python developpers will not put themself in the > situation where they need to use a variable 'orange' line 32 and use the > same variable 'orange' line 33 to ref

Re: Python critique

2011-01-29 Thread rantingrick
On Dec 10 2010, 5:15 pm, Steven D'Aprano wrote: > n = 1 > [print(n) for n in (2,)] > print n Oh *thats* why we have print as a function! I always wanted to put print in a list cmp. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python critique

2010-12-13 Thread Jean-Michel Pichavant
Octavian Rasnita wrote: From: "Steven D'Aprano" ... Can you please tell me how to write the following program in Python? my $n = 1; { my $n = 2; print "$n\n"; } print "$n\n"; If this program if ran in Perl, it prints: 2 1 Lots of ways. Here's one: n = 1 class Scope: n

Re: Python critique

2010-12-11 Thread Steve Holden
On 12/11/2010 6:46 AM, Lie Ryan wrote: > Also, class scope and instance scope, though similar, are distinct > scopes. Python also have the hidden interpreter-level scope (the > __builtins__). Kindly ignore my last post. Class scopes are lexical, instance scopes are not. regards Steve -- Steve H

Re: Python critique

2010-12-11 Thread Steve Holden
On 12/11/2010 6:46 AM, Lie Ryan wrote: > On 12/11/10 11:37, Dan Stromberg wrote: >> On Fri, Dec 10, 2010 at 3:51 PM, John Nagle wrote: >>> On 12/10/2010 3:25 PM, Stefan Behnel wrote: Benjamin Kaplan, 11.12.2010 00:13: > On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: > The on

Re: Python critique

2010-12-11 Thread Lie Ryan
On 12/11/10 11:37, Dan Stromberg wrote: > On Fri, Dec 10, 2010 at 3:51 PM, John Nagle wrote: >> On 12/10/2010 3:25 PM, Stefan Behnel wrote: >>> Benjamin Kaplan, 11.12.2010 00:13: On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: The only scopes Python has are module and function.

Re: Python critique

2010-12-11 Thread Octavian Rasnita
From: "Steven D'Aprano" ... >> Can you please tell me how to write the following program in Python? >> >> my $n = 1; >> >> { >> my $n = 2; >> print "$n\n"; >> } >> >> print "$n\n"; >> >> If this program if ran in Perl, it prints: >> 2 >> 1 > > Lots of ways. Here's one: > > > n = 1 > >

Re: Python critique

2010-12-10 Thread Stefan Behnel
John Nagle, 11.12.2010 00:51: On 12/10/2010 3:25 PM, Stefan Behnel wrote: Benjamin Kaplan, 11.12.2010 00:13: On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: The only scopes Python has are module and function. There's more. Both a lambda, and in Python 3.x, list comprehensions, int

Re: Python critique

2010-12-10 Thread Dan Stromberg
On Fri, Dec 10, 2010 at 3:51 PM, John Nagle wrote: > On 12/10/2010 3:25 PM, Stefan Behnel wrote: >> >> Benjamin Kaplan, 11.12.2010 00:13: >>> >>> On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: > >>> The only scopes Python has are module and function. > >   There's more.  Both a lambda, a

Re: Python critique

2010-12-10 Thread John Nagle
On 12/10/2010 3:25 PM, Stefan Behnel wrote: Benjamin Kaplan, 11.12.2010 00:13: On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: The only scopes Python has are module and function. There's more. Both a lambda, and in Python 3.x, list comprehensions, introduce a new scope.

Re: Python critique

2010-12-10 Thread Stefan Behnel
Benjamin Kaplan, 11.12.2010 00:13: On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: How narrow are the scopes in Python? Is each block (each level of indentation) a scope? If it is, then I think it is very enough because the other cases can be detected easier or it might not appear at a

Re: Python critique

2010-12-10 Thread Steven D'Aprano
On Sat, 11 Dec 2010 00:46:41 +0200, Octavian Rasnita wrote: > How narrow are the scopes in Python? > Is each block (each level of indentation) a scope? Thankfully, no. > If it is, then I > think it is very enough because the other cases can be detected easier > or it might not appear at all in

Re: Python critique

2010-12-10 Thread Stefan Behnel
John Nagle, 10.12.2010 21:02: Probably the biggest practical problem with CPython is that C modules have to be closely matched to the version of CPython. There's no well-defined API that doesn't change. Well, there are no huge differences between CPython versions (apart from the Py_ssize_t cha

Re: Python critique

2010-12-10 Thread Benjamin Kaplan
On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote: > From: "John Nagle" >> On 12/10/2010 2:31 AM, kolo 32 wrote: >>> Hi, all, >>> >>> Python critique from strchr.com: >>> >>> http://www.strchr.com/python_crit

Re: Python critique

2010-12-10 Thread Antoine Pitrou
On Fri, 10 Dec 2010 12:02:21 -0800 John Nagle wrote: > > Probably the biggest practical problem with CPython is > that C modules have to be closely matched to the version of > CPython. There's no well-defined API that doesn't change. Please stop spreading FUD: http://docs.python.org/c-api/i

Re: Python critique

2010-12-10 Thread Octavian Rasnita
From: "John Nagle" > On 12/10/2010 2:31 AM, kolo 32 wrote: >> Hi, all, >> >> Python critique from strchr.com: >> >> http://www.strchr.com/python_critique > >I have criticisms of Python, but those aren't them. > >Probably th

Re: Python critique

2010-12-10 Thread John Nagle
On 12/10/2010 2:31 AM, kolo 32 wrote: Hi, all, Python critique from strchr.com: http://www.strchr.com/python_critique I have criticisms of Python, but those aren't them. Probably the biggest practical problem with CPython is that C modules have to be closely matched to the versi

Re: Python critique

2010-12-10 Thread Octavian Rasnita
From: "Jean-Michel Pichavant" > > Octavian Rasnita wrote: >> It is true that Python doesn't use scope limitations for variables? >> >> Octavian >> > Python does have scope. The problem is not the lack of scope, to > problem is the shadow declaration of some python construct in the > curren

Re: Python critique

2010-12-10 Thread Stefan Behnel
Jean-Michel Pichavant, 10.12.2010 15:02: the shadow declaration of some python construct in the current scope. print x # raise NameError [x for x in range(10)] # shadow declaration of x print x # will print 9 Note that this is rarely a problem in practice, and that this has been fixed in Pyth

Re: Python critique

2010-12-10 Thread Jean-Michel Pichavant
Octavian Rasnita wrote: It is true that Python doesn't use scope limitations for variables? Octavian Python does have scope. The problem is not the lack of scope, to problem is the shadow declaration of some python construct in the current scope. print x # raise NameError [x for x in ra

Re: Python critique

2010-12-10 Thread Octavian Rasnita
It is true that Python doesn't use scope limitations for variables? Octavian - Original Message - From: "kolo 32" Newsgroups: comp.lang.python To: Sent: Friday, December 10, 2010 12:31 PM Subject: Python critique > Hi, all, > > Python critique fr

Python critique

2010-12-10 Thread kolo 32
Hi, all, Python critique from strchr.com: http://www.strchr.com/python_critique -- http://mail.python.org/mailman/listinfo/python-list