Issue 20349: Argument Clinic: error on new or init with no arguments (original) (raw)

Issue20349

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.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/64548

classification

Title: Argument Clinic: error on __new__ or __init__ with no arguments
Type: behavior Stage:
Components: Build, Demos and Tools Versions: Python 3.4

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: larry, taleinat
Priority: normal Keywords: patch

Created on 2014-01-22 16:42 by taleinat, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_new_or_init_without_arguments.clinic.py.patch taleinat,2014-01-22 16:42 Patch fixing AC handling of __new__ and __init__ methods without arguments. review
Messages (3)
msg208826 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-22 16:42
This is caused by the code "fields = list(parser_body_fields)" under "if new_or_init:" in CLanguage.output_templates(). 'parser_body_fields' is initialized to None and may not be set before the above mentioned code. Attached is a patch which replaces the line with: fields = list(parser_body_fields) if parser_body_fields is not None else []
msg209766 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-31 11:11
parser_body_fields is initialized to () these days, which should make this problem go away. Do you still have the issue in current trunk? Again, if you'd attached a reproducable test case, I could have independently verified the problem, and that it was fixed.
msg209782 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-31 13:06
This has indeed been fixed by the change you mentioned.
History
Date User Action Args
2022-04-11 14:57:57 admin set github: 64548
2014-01-31 13:06:13 taleinat set status: open -> closedresolution: fixedmessages: +
2014-01-31 11:11:18 larry set messages: +
2014-01-22 16:42:02 taleinat create