Ron Adam wrote:
> I presume you meant:
>
> def f():
> x = 42
> def g():
> def h():
> parent x
> x = 88
>
>
> The x would be a new local x in function g and have no effect on the x in
> function f. Parent would do exactly what it means in this case,
Georg Brandl wrote:
> Ron Adam wrote:
>
>> I presume you meant:
>>
>> def f():
>> x = 42
>> def g():
>> def h():
>> parent x
>> x = 88
>>
>>
>> The x would be a new local x in function g and have no effect on the x in
>> function f. Parent would do exa
Ron Adam <[EMAIL PROTECTED]> writes:
> By not limiting parent to just the parent scope you create exceptions. The
> rule
> becomes:
>
> The keyword (*)nonlocal designates a name will be written to in the
> closest enclosing "parent" scope *except* when a pre-existing matching
> name
> 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.
>
> No exceptions are needed, and no limitation to the immediately
> surrounding scope is needed. Read accesses
Marcin 'Qrczak' Kowalczyk wrote:
> Ron Adam <[EMAIL PROTECTED]> writes:
>
>> By not limiting parent to just the parent scope you create exceptions. The
>> rule
>> becomes:
>>
>> The keyword (*)nonlocal designates a name will be written to in the
>> closest enclosing "parent" scope *ex
Mike Orr wrote:
> .abspath()
> .normpath()
> .realpath()
> .splitpath()
> .relpath()
> .relpathto()
Seeing as the whole class is about paths, having
"path" in the method names seems redundant. I'd
prefer to see terser method names without any
noise characters in them.
--
As an aside to the discussion about "nonlocal", here are a couple of
thoughts on backward compatibility.
For some of the proposed keywords, here's the number of occurrences
of the keyword in the current standard library (not including comments
and docstrings):
nonlocal 0 0
use
Mike Krell wrote:
> This is also why I advocate the spelling "use", because
> ISTM "use x" pretty much means exactly what it says.
I beg to differ -- it means nothing at all to
me. At least "global" or "nonlocal" sound like
they have *something* to do with scope, even
if it's not clear exactly wh
On Sun, 5 Nov 2006, Ka-Ping Yee wrote:
> nonlocal 0 0
> use 2 2
> using 3 3
> reuse 0 4
> free 8 8
> outer 5 147
> global 126 214
Oops, i forgot to explain: the first column is th
Mike Orr wrote:
> The multi-argument constructor is a replacement for joining paths.
> (The PEP says .joinpath was "problematic" without saying why.)This
> could theoretically go either way, doing either the same thing as
> os.path.join, getting a little smarter, or doing "safe" joins by
> dis
>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" - you've deliberately narrowed the d
Greg Ewing wrote:
>Mike Krell wrote:
>
>
>> This is also why I advocate the spelling "use", because
>>ISTM "use x" pretty much means exactly what it says.
>>
>>
>
>I beg to differ -- it means nothing at all to
>me. At least "global" or "nonlocal" sound like
>they have *something* to do with
On Mon, 6 Nov 2006, 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 en
On Sat, 4 Nov 2006, Nick Coghlan wrote:
> Count me as another +1 on disallowing the shorthand version.
>
> Rationale:
> 1. We've lived without it in the case of global
> 2. We can add it later if we decide we really need it, but if we
> start with it and it turns out to be confusing or error-prone,
Mike Orr wrote:
> Posted to python-dev and python-3000. Follow-ups to python-dev only please.
>
> So, let's say we strip this Path class to:
I'm finally taking the time to sit down and go over this in detail. Here
are some suggestions.
> class Path(unicode):
> Path("foo")
> Path( Path
15 matches
Mail list logo