This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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
Priority: normal Keywords:

Created on 2007-04-09 23:05 by gvanrossum, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg31741 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) 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) * (Python committer) 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
2022-04-11 14:56:23adminsetgithub: 44823
2008-01-06 22:29:46adminsetkeywords: - py3k
versions: + Python 3.0
2007-04-09 23:05:22gvanrossumcreate