Remove support for defclass attribute lists

This commit is contained in:
Kodi Arfer 2019-07-02 12:04:15 -04:00
parent 6bc9e842e1
commit c99360b294
2 changed files with 4 additions and 8 deletions

View File

@ -6,6 +6,8 @@ Unreleased
Removals
------------------------------
* Python 2 is no longer supported.
* Support for attribute lists in `defclass` has been removed. Use `setv`
and `defn` instead.
0.17.0
==============================

View File

@ -1475,10 +1475,9 @@ class HyASTCompiler(object):
@special("defclass", [
SYM,
maybe(brackets(many(FORM)) + maybe(STR) +
maybe(brackets(many(SYM + FORM))) + many(FORM))])
maybe(brackets(many(FORM)) + maybe(STR) + many(FORM))])
def compile_class_expression(self, expr, root, name, rest):
base_list, docstring, attrs, body = rest or ([[]], None, None, [])
base_list, docstring, body = rest or ([[]], None, [])
bases_expr, bases, keywords = (
self._compile_collect(base_list[0], with_kwargs=True))
@ -1488,11 +1487,6 @@ class HyASTCompiler(object):
if docstring is not None:
bodyr += self.compile(docstring).expr_as_stmt()
if attrs is not None:
bodyr += self.compile(self._rewire_init(HyExpression(
[HySymbol("setv")] +
[x for pair in attrs[0] for x in pair]).replace(attrs)))
for e in body:
e = self.compile(self._rewire_init(
macroexpand(e, self.module, self)))