New submission from Konstantin Enchant :
Very strange case but https://www.ietf.org/rfc/rfc2109.txt (see 4.1 Syntax:
General) defines that "= value" is optional for attribute-value pairs for
header Cookie.
And SimpleCookie fully broken if meets attribute without valu
Konstantin Enchant added the comment:
Yes. Case:
# ---
class A:
def f(self):
nonlocal __x
# ---
must raises SyntaxError like case:
# ---
class A:
def f(self):
nonlocal x
>> SyntaxError: no binding for nonlocal
Konstantin Enchant added the comment:
The problem happens only when "nonlocal __something" in a class method. In your
case f2() isn't class method.
More interesting behavior with underscores -
https://gist.github.com/sirkonst/6eff6
New submission from Konstantin Enchant:
Code:
# ---
__obj = object()
class Foo:
def f1(self):
nonlocal __obj
f = Foo()
f.f1() # <-- segmentation fault
# ---
--
messages: 257174
nosy: Konstantin Enchant
prior