On Fri, 3 Nov 2006, Greg Ewing wrote:
> > Before it is reasonable to change the meaning of "global", we would
> > need to have coherent answers to these questions:
> >
> > 1. What is the global namespace?
>
> Under the proposal, there is no such thing as
> "the" global namespace, so the questi
On 11/2/06, Talin <[EMAIL PROTECTED]> wrote:
> One way to solve this would be to define a platform-neutral path
> representation that can be "rendered" into either os-specific *or*
> application-specific formats. I could read a Perforce path string,
> convert that into an abstract path, do some wor
Greg Ewing wrote:
> Talin wrote:
>> And that includes path strings read from config files, not just path
>> objects.
>
> This is something new. I hadn't realised anyone
> was considering that to be within the scope of
> any of the proposed path modules.
>
> Obviously this is going to require def
Greg Ewing wrote:
> Ka-Ping Yee wrote:
>> Before it is reasonable to change the meaning of "global", we would
>> need to have coherent answers to these questions:
>>
>> 1. What is the global namespace?
>
> Under the proposal, there is no such thing as
> "the" global namespace, so the question
Ka-Ping Yee wrote:
> Before it is reasonable to change the meaning of "global", we would
> need to have coherent answers to these questions:
>
> 1. What is the global namespace?
Under the proposal, there is no such thing as
"the" global namespace, so the question is
meaningless.
There's no
Talin wrote:
> And that includes path strings read from config files,
> not just path objects.
This is something new. I hadn't realised anyone
was considering that to be within the scope of
any of the proposed path modules.
Obviously this is going to require defining a
standard external represen
Talin wrote:
> Right now, you can create a global variable from within a scope, even if
> that variable hasn't been declared yet:
That doesn't seem like a good practice from a
readability point of view to me, but in any
case, there's no reason it couldn't continue
to be supported:
If you don't
Before it is reasonable to change the meaning of "global", we would
need to have coherent answers to these questions:
1. What is the global namespace?
2. Do global variables belong to the global namespace?
3. When it says "global x" does that mean x is a global variable?
I think
Steven Bethard wrote:
> Ka-Ping Yee wrote:
>
>>Would it help at all to survey some folks to see how many interpret
>>"global variable" to mean "top-level" vs. "anything nonlocal"?
>
> I don't think that'll really be worth it. I'd be amazed if people
> didn't expect it to mean "top-level".
Anoth
Greg Ewing <[EMAIL PROTECTED]> writes:
> In any case, if we all start writing code that makes assumptions
> about pathname syntax, and some platform comes along in the future
> that does things differently, we're hosed.
Some conventions in the world are converging.
For example a byte universally
Mike Orr wrote:
> Perhaps this
> disrecommendation should be lifted, especially since both Mac and
> Windows do the right thing with "/", "..", and "." now.
Is anyone still supporting VMS? It has a wildly
different pathname syntax.
In any case, if we all start writing code that
makes assumptions
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote:
> If "global" were to change in Py3K to require an existing binding at the
> time the "global" keyword was executed, this would then have the
> semantics of "nonlocal" and be context-independent again. So I think any
> proposal to reuse "global"
Steven Bethard wrote:
> On 11/1/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
>> I think a fairer survey example would be something like this:
>>
>> n = 1
>> def f():
>> n = 2
>> def g():
>> global n = 99
>> return n
>> g()
>>
>> f()
>>
On Thu, 2 Nov 2006, Fredrik Lundh wrote:
> Talin wrote:
>
> > If you change the behavior of 'global' to be the same as 'nonlocal' as
> > has been proposed, then this effectively becomes impossible - you can no
> > longer set any global that hasn't already been pre-declared.
>
> of course you can, a
Talin wrote:
> If you change the behavior of 'global' to be the same as 'nonlocal' as
> has been proposed, then this effectively becomes impossible - you can no
> longer set any global that hasn't already been pre-declared.
of course you can, as long as it isn't shadowed in an intermediate scop
On Nov 2, 2006, at 6:53 PM, Talin wrote:
Ronald Oussoren wrote:
On Nov 2, 2006, at 5:21 PM, Paul Moore wrote:
On 11/1/06, Mike Orr <[EMAIL PROTECTED]> wrote:
[...] especially since both Mac and
Windows do the right thing with "/", "..", and "." now.
Not always:
D:\Data>dir C:/
Invalid s
Fredrik Lundh wrote:
> Talin wrote:
>
>> One thing I don't understand in this discussion of re-purposing the
>> 'global' keyword is how you handle the case of an inner function that
>> *creates* a global.
>>
>> Right now, you can create a global variable from within a scope, even if
>> that var
Ronald Oussoren wrote:
>
> On Nov 2, 2006, at 5:21 PM, Paul Moore wrote:
>
>> On 11/1/06, Mike Orr <[EMAIL PROTECTED]> wrote:
>>> [...] especially since both Mac and
>>> Windows do the right thing with "/", "..", and "." now.
>>
>> Not always:
>>
>> D:\Data>dir C:/
>> Invalid switch - "".
>
> An
On Thu, 2 Nov 2006, Georg Brandl wrote:
> > PS. If you're hunting for keywords to overload to drag variables into
> > scope,
> > "import" is also available, although would probably be very hard to make
> > work.
>
> How should that possibly work?
Without treading on the toes of the existing i
On Nov 2, 2006, at 5:21 PM, Paul Moore wrote:
On 11/1/06, Mike Orr <[EMAIL PROTECTED]> wrote:
[...] especially since both Mac and
Windows do the right thing with "/", "..", and "." now.
Not always:
D:\Data>dir C:/
Invalid switch - "".
And on Mac this depends on the API you use, if you use
On 11/1/06, Mike Orr <[EMAIL PROTECTED]> wrote:
> [...] especially since both Mac and
> Windows do the right thing with "/", "..", and "." now.
Not always:
D:\Data>dir C:/
Invalid switch - "".
Paul.
___
Python-3000 mailing list
Python-3000@python.org
h
Mike Orr wrote:
> The thread on python-dev has been revived, so those interested in this
> subject will want to look in both places.
>
> On 11/1/06, Talin <[EMAIL PROTECTED]> wrote:
>> Actually I generally use:
>>
>>p = os.path.normpath( os.path.join( __file__, "../..", "lib" ) )
>>
>> or
Jan Grant wrote:
> On Wed, 1 Nov 2006, Steven Bethard wrote:
>
>> I don't think that'll really be worth it. I'd be amazed if people
>> didn't expect it to mean "top-level". The real question is, if people
>> see something like this::
>>
>> def f():
>> n = 0
>> def g(i):
>>
> OTOH, having `global` and `nonlocal` mean the same thing for
> module-bound variables violates TOOWTDI.
Then you can disallow "nonlocal" for anything else than closure variables.
And disallow "global" for anything else than module-global variables.
It is explicit and unambiguous, and reduces th
Talin wrote:
> One thing I don't understand in this discussion of re-purposing the
> 'global' keyword is how you handle the case of an inner function that
> *creates* a global.
>
> Right now, you can create a global variable from within a scope, even if
> that variable hasn't been declared yet
Fredrik Lundh wrote:
> Steven Bethard wrote:
>
>> I don't think that'll really be worth it. I'd be amazed if people
>> didn't expect it to mean "top-level".
>
> as anyone who's spent enough time on c.l.python knows, people expect it
> to mean "application global". it isn't.
>
> alternatively,
On Wed, 1 Nov 2006, Steven Bethard wrote:
> I don't think that'll really be worth it. I'd be amazed if people
> didn't expect it to mean "top-level". The real question is, if people
> see something like this::
>
> def f():
> n = 0
> def g(i):
> global n
>
Steven Bethard wrote:
> I don't think that'll really be worth it. I'd be amazed if people
> didn't expect it to mean "top-level".
as anyone who's spent enough time on c.l.python knows, people expect it
to mean "application global". it isn't.
alternatively, they expect it to be a scope specifi
Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
> A shorthand form is also permitted, in which ``nonlocal`` is
> prepended to an assignment or augmented assignment statement::
>
> nonlocal x = 3
>
> The above has exactly the same meaning as ``nonlocal x; x = 3``.
Nice.
> The shorthand form does not
Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
> Guido wrote:
> > My personal preference is still to abuse 'global' instead of adding a
> > new, ugly keyword. That would make the syntax for global and nonlocal
> > completely identical. :-) But I seem to be alone in this preference.
>
> Brett wrote:
> > S
On 11/2/06, Mike Orr <[EMAIL PROTECTED]> wrote:
> Given the widely-diverging views on what, if anything, should be done
> to os.path, how about we make a PEP and a standalone implementation of
> (1) for now, and leave (2) and everything else for a later PEP.
Why write a PEP at this stage? Just rel
31 matches
Mail list logo