[issue17983] global __class__ statement in class declaration

2013-05-15 Thread Dwight Guth

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 0x7fc712192700:
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



[issue17983] global __class__ statement in class declaration

2013-05-15 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
assignee:  - benjamin.peterson
nosy: +benjamin.peterson

___
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



[issue17983] global __class__ statement in class declaration

2013-05-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd9141a4f999 by Benjamin Peterson in branch '3.3':
complain about global __class__ in a class body (closes #17983)
http://hg.python.org/cpython/rev/cd9141a4f999

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
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