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
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
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
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
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
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
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
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.
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
>
>
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
Hi, all,
Python critique from strchr.com:
http://www.strchr.com/python_critique
--
http://mail.python.org/mailman/listinfo/python-list
24 matches
Mail list logo