Georg Brandl wrote:
> Marcin 'Qrczak' Kowalczyk wrote:
>> The rule should be:
>>
>> The keyword 'nonlocal' causes the lookup to be performed as if there
>> were no assignments to that variable in the scope containing the
>> 'nonlocal' declaration.
>
> Plus, if there's no binding in an enclosing sc
Andrew McNamara wrote:
>> Python, C/C++, JavaScript, Ruby, and Perl all have this in common:
>>
>>A "global variable" is visible to the entire file and does
>>not belong to any particular function.
>
> I note that you didn't say "a global variable is visible to the entire
> application" -
>def weird(local=True):
>if local:
>n = 1
>else:
>global n # [ or nonlocal n, in Nick's ]
>n += 1
>return n
I'm not sure what you're both trying to explain here. First off, the
above code yields a SyntaxWarning. Secondly all its acc
Talin <[EMAIL PROTECTED]> wrote:
> I'd like to replace this with:
>
> .component( slice_object )
>
> where the semantics of 'component' are identical to __getitem__ on an
> array or tuple. So for example:
>
> Path( "a", "b" ).component( 0 ) => "a"
> Path( "a", "b" ).component( 1 )
"Michael Urman" <[EMAIL PROTECTED]> wrote:
> I personally expect that while there is a theoretical clash between
> variable names in nested scopes, that's already a poor coding
> decision. The module level globals should not unintentionally collide
> with function-local non-local access. Thus reus
Josiah Carlson wrote:
> Talin <[EMAIL PROTECTED]> wrote:
>> I'd like to replace this with:
>>
>> .component( slice_object )
>>
>> where the semantics of 'component' are identical to __getitem__ on an
>> array or tuple. So for example:
>>
>> Path( "a", "b" ).component( 0 ) => "a"
>> Pat
Josiah Carlson wrote:
>"Michael Urman" <[EMAIL PROTECTED]> wrote:
>
>
>>I personally expect that while there is a theoretical clash between
>>variable names in nested scopes, that's already a poor coding
>>decision. The module level globals should not unintentionally collide
>>with function-loca
On 11/5/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
As an aside to the discussion about "nonlocal", here are a couple ofthoughts on backward compatibility.For some of the proposed keywords, here's the number of occurrencesof the keyword in the current standard library (not including comments
and doc
Michael Urman wrote:
>>def weird(local=True):
>>if local:
>>n = 1
>>else:
>>global n # [ or nonlocal n, in Nick's ]
>>n += 1
>>return n
>
> I'm not sure what you're both trying to explain here. First off, the
> above code yields a S
My latest idea is something like this:
BEGIN
class Path(unicode):
"""Pathname-manipulation methods."""
pathlib = os.path # Subclass can specify (posix|nt|mac)path.
safe_args_only = False# Glyph can set this to True in a subclass.
class FSPath(object):
"""File
Le lundi 06 novembre 2006 à 14:37 -0800, Mike Orr a écrit :
> def __init__(klass, *args):
> if len(args) == 1 and isinstance(args[0], klass.path_class):
> self.path = args[0]
> else:
> self.path = self.path_class(*args)
s/klass/self/, I suppose ?
> Subc
> [Mike Orr wrote:]
> In this vein, a common utility module with back-end functions would be
> good. Then we can solve the difficult problems *once* and have a test
> suite that proves it, and people would have confidence using any OO
> classes that are built over them. We can start by gathering
12 matches
Mail list logo