Skip to content

improve micropython.decos #794

Open
Open
@Josverl

Description

@Josverl
  • viper
  • native
  • asm_thumb

https://realpython.com/primer-on-python-decorators/#fancy-decorators

import functools
from typing import List, Callable

def native2(_func=None, *args, **kwargs):
    """native emitter that returns a proper type."""
    def wrapper_outer(func):
        @functools.wraps(func)
        def wrapper_inner(*args, **kwargs): ...
        return wrapper_inner
    return wrapper_outer

but better in typing

simplified to 👍🏻
def viper(_func: Callable[_Param, _Ret], /) -> Callable[_Param, _Ret]:

resolved in 2a87840

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions