New submission from Dwight Guth:

The following python program causes cpython to crash:

class A:
  global __class__
  def a(self):
    super()

I get the following output on the console:

bug.py:2: SyntaxWarning: name '__class__' is assigned to before global 
declaration
  global __class__
lookup '__class__' in � a sequ 2 -1
freevars of A: ('__class__',)
Fatal Python error: compiler_make_closure()

Current thread 0x00007fc712192700:
Aborted (core dumped)

This probably happens because __class__ is handled specially by the scoping 
rules and isn't expected to be anything other than a member of co_cellvars. It 
should probably throw an exception instead (SystemError?)

----------
messages: 189293
nosy: dwight.guth
priority: normal
severity: normal
status: open
title: global __class__ statement in class declaration
type: crash
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17983>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to