On Fri, Jul 13, 2018 at 10:43 PM, Ed Kellett wrote:
> On 2018-07-12 18:00, Chris Angelico wrote:
>> What do you mean by "fix"? Make the 'x' bind eagerly? That would break
>> basically every other use of closures.
>
> No. I mean make each x a new variable--closures would work as before,
> for-loops
On 2018-07-12 18:00, Chris Angelico wrote:
> What do you mean by "fix"? Make the 'x' bind eagerly? That would break
> basically every other use of closures.
No. I mean make each x a new variable--closures would work as before,
for-loops would change. If we have subscopes, it seems natural that
ent
On Fri, Jul 13, 2018 at 2:44 PM, wrote:
> On Thursday, July 12, 2018 at 7:16:48 PM UTC-4, Chris Angelico wrote:
>> Not sure, but here's a simpler implementation:
>>
>> except Exception as .err.0:
>> print(.err.0)
>> .err.0 = None
>> del .err.0
>>
>> In other words, exactly the same as
On Thursday, July 12, 2018 at 7:16:48 PM UTC-4, Chris Angelico wrote:
> On Fri, Jul 13, 2018 at 8:10 AM Igor wrote:
> > On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote:
> >> aleiphoenix writes:
> >>
> >> [snip]
> >>
> >> When an exception has been assigned using as target, it
On Thursday, July 12, 2018 at 5:45:52 PM UTC+8, Ben Bacarisse wrote:
>
> Yes, it's intentional, but it's not exactly a scope. In
>
> https://docs.python.org/3/reference/compound_stmts.html#try
>
> --
> Ben.
Thank you for the reply. Never thought of this kind of problem in Python3.
On Thurs
On Fri, Jul 13, 2018 at 8:10 AM, wrote:
> On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote:
>> aleiphoenix writes:
>>
>> [snip]
>>
>> When an exception has been assigned using as target, it is cleared at
>> the end of the except clause. This is as if
>>
>> except E as N:
Just word on quoting...
codewiz...@gmail.com writes:
> On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote:
>>
>> [snip]
You cut everything I wrote. What you left is what I quoted from the
Python documentation. In fairness to the authors you should probably
have cut the attrib
On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote:
> aleiphoenix writes:
>
> [snip]
>
> When an exception has been assigned using as target, it is cleared at
> the end of the except clause. This is as if
>
> except E as N:
> foo
>
> was translated to
>
> excep
On Thu, Jul 12, 2018 at 11:23 PM, Ed Kellett wrote:
> Could we fix:
>
> for x in something:
> blah(lambda a: a + x)
>
> while we're at it?
What do you mean by "fix"? Make the 'x' bind eagerly? That would break
basically every other use of closures.
ChrisA
--
https://mail.python.org/mailma
On 2018-07-12 14:03, Chris Angelico wrote:
> Dealing with reference cycles is generally done *periodically* rather
> than immediately (CPython disposes of unreferenced objects immediately
> upon last deref). You can avoid having a dedicated cycle detection
> pass by using a mark-and-sweep GC, but t
On Thu, Jul 12, 2018 at 10:31 PM, Ed Kellett wrote:
> On 2018-07-12 10:59, Steven D'Aprano wrote:
>> On Thu, 12 Jul 2018 01:37:24 -0700, aleiphoenix wrote:
>>
>>> My question is, does except ... as ... create a new scope from outer
>>> block, causing 'err' be hidden from outer scope? Is this inten
On 2018-07-12 10:59, Steven D'Aprano wrote:
> On Thu, 12 Jul 2018 01:37:24 -0700, aleiphoenix wrote:
>
>> My question is, does except ... as ... create a new scope from outer
>> block, causing 'err' be hidden from outer scope? Is this intentional?
>
> No, it is not a new scope, and yes, it is int
On Thu, 12 Jul 2018 01:37:24 -0700, aleiphoenix wrote:
> My question is, does except ... as ... create a new scope from outer
> block, causing 'err' be hidden from outer scope? Is this intentional?
No, it is not a new scope, and yes, it is intentional. It's a nasty hack,
but a *necessary* nasty
aleiphoenix writes:
> suppose following code running with Python-3.4.8 and Python-3.6.5
>
>
> # -*- coding: utf-8 -*-
>
>
> def hello():
> err = None
> print('0: {}'.format(locals()))
> try:
> b = 2
> print('1: {}'.format(locals()))
> raise ValueError()
>
suppose following code running with Python-3.4.8 and Python-3.6.5
# -*- coding: utf-8 -*-
def hello():
err = None
print('0: {}'.format(locals()))
try:
b = 2
print('1: {}'.format(locals()))
raise ValueError()
print('2: {}'.format(locals()))
except
15 matches
Mail list logo