Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrink10 committed Mar 29, 2020
1 parent 10801cc commit 879a3c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
16 changes: 6 additions & 10 deletions src/basilisp/lang/compiler/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,7 @@ def __deftype_classmethod_to_py_ast(
),
body=fn_body_ast,
decorator_list=list(
chain(
[_PY_CLASSMETHOD_FN_NAME], __fn_kwargs_support_decorator(node)
)
chain([_PY_CLASSMETHOD_FN_NAME], __kwargs_support_decorator(node))
),
returns=None,
)
Expand Down Expand Up @@ -896,7 +894,7 @@ def __deftype_method_to_py_ast(ctx: GeneratorContext, node: Method) -> Generated
decorator_list=list(
chain(
[_TRAMPOLINE_FN_NAME] if ctx.recur_point.has_recur else [],
__fn_kwargs_support_decorator(node),
__kwargs_support_decorator(node),
)
),
returns=None,
Expand Down Expand Up @@ -926,9 +924,7 @@ def __deftype_staticmethod_to_py_ast(
),
body=fn_body_ast,
decorator_list=list(
chain(
[_PY_STATICMETHOD_FN_NAME], __fn_kwargs_support_decorator(node)
)
chain([_PY_STATICMETHOD_FN_NAME], __kwargs_support_decorator(node))
),
returns=None,
)
Expand Down Expand Up @@ -1179,7 +1175,7 @@ def __fn_meta(
return (), ()


def __fn_kwargs_support_decorator(
def __kwargs_support_decorator(
node: Union[Fn, ClassMethod, Method, StaticMethod]
) -> Iterable[ast.AST]:
if node.kwarg_support is None:
Expand Down Expand Up @@ -1238,7 +1234,7 @@ def __single_arity_fn_to_py_ast(
body=fn_body_ast,
decorator_list=list(
chain(
__fn_kwargs_support_decorator(node),
__kwargs_support_decorator(node),
meta_decorators,
[_BASILISP_FN_FN_NAME],
[_TRAMPOLINE_FN_NAME]
Expand Down Expand Up @@ -1466,7 +1462,7 @@ def __multi_arity_fn_to_py_ast( # pylint: disable=too-many-locals
body=fn_body_ast,
decorator_list=list(
chain(
__fn_kwargs_support_decorator(node),
__kwargs_support_decorator(node),
[_TRAMPOLINE_FN_NAME] if ctx.recur_point.has_recur else [],
)
),
Expand Down
8 changes: 4 additions & 4 deletions src/basilisp/lang/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,8 +1359,8 @@ def _lisp_fn_apply_kwargs(f):
Python keyword arguments will be converted into Lisp keyword/argument pairs
that can be easily understood by Basilisp.
Lisp functions annotated with the `:apply-kwargs` metadata key will be wrapped
with this decorator by the compiler."""
Lisp functions annotated with the `:apply` value for the `:kwargs` metadata key
will be wrapped with this decorator by the compiler."""

@functools.wraps(f)
def wrapped_f(*args, **kwargs):
Expand All @@ -1380,8 +1380,8 @@ def _lisp_fn_collect_kwargs(f):
Python keyword arguments will be collected into a single map, which is supplied
as the final positional argument.
Lisp functions annotated with the `:collect-kwargs` metadata key will be wrapped
with this decorator by the compiler."""
Lisp functions annotated with the `:collect` value for the `:kwargs` metadata key
will be wrapped with this decorator by the compiler."""

@functools.wraps(f)
def wrapped_f(*args, **kwargs):
Expand Down

0 comments on commit 879a3c4

Please sign in to comment.