classification
Title: Property with -> annotation triggers assert
Type: Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, ncoghlan (2)
Priority: normal Keywords

Created on 2007-04-09 23:05 by gvanrossum, last changed 2008-01-06 22:29 by admin.

Messages (2)
msg31741 - (view) Author: Guido van Rossum (gvanrossum) Date: 2007-04-09 23:05
Example:

# x.py
class C:
  @property
  def p(self) -> int:
    return 0

$ ./python -E x.py
python: ../Python/ast.c:724: ast_for_arguments: Assertion `((n)->n_type) == 263 || ((n)->n_type) == 267' failed.
Aborted
$

Removing "@property" or "-> int" from the example avoids the problem.  Adding argument annotations inside the argument list doesn't trigger it.
msg31742 - (view) Author: Nick Coghlan (ncoghlan) Date: 2007-04-23 11:06
Fixed in rev 54926 (the check for whether or not decorators were present wasn't quite right).
History
Date User Action Args
2008-01-06 22:29:46adminsetkeywords: - py3k
versions: + Python 3.0
2007-04-09 23:05:22gvanrossumcreate