Skip to content

Feature Request: a decorator to declare a function/class as "native" #71

Closed
@dlashua

Description

@dlashua

Would it be possible to use a decorator to indicate that a function/class should remain native (i.e. not "pyscript") so that it can be called from other native (pure python) code?

As an example of what I mean, in the below code, I'd much prefer to define PyscriptWatchdogEventHandler directly in watchdog.py with some kind of decorator on it to indicate that it shouldn't be "pyscriptified".

https://gist.github.com/dlashua/f7d88f9a5afdcf7af17ce24266925a0b

Related Question: The purpose of the above code is to automatically reload pyscript files when they change (because I'm lazy). I use an input_boolean to indicate this functionality should be enabled that I can turn off when I'm not developing to save resources. Have I missed a situation that could occur and leave me with memory leaks or other unintended effects? Is there a better way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions