Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda-like support for callbacks #33

Merged
merged 11 commits into from
May 29, 2024

Conversation

KavyanshKhaitan2
Copy link
Contributor

Added rich callback support for callbacks. This should still keep most of the uses still working except the ones with spaces in them.

Also adding more documentation for the above feature.

Issues resolved: #32

Added rich callback support for callbacks. This should still keep most of the uses still working except the ones with spaces in them.

Also adding more documentation for the above feature.
@KavyanshKhaitan2
Copy link
Contributor Author

Some checks didnt pass because i used the f"{varName=}" syntax for testing. So commenting those lines out!
@KavyanshKhaitan2
Copy link
Contributor Author

KavyanshKhaitan2 commented May 25, 2024

Huh. the "workflow tests" failed because I used f"{varName=}" syntax for testing inside if __name__ == "__main__"... So pushed that on by commenting those lines out!

@ObaraEmmanuel
Copy link
Owner

Now I remember why I avoided type hinting. It is always changing and not consistent. Your code only works for 3.10 because of the type hinting.

@ObaraEmmanuel
Copy link
Owner

I would recommend you drop all type hints for now

@KavyanshKhaitan2
Copy link
Contributor Author

I would recommend you drop all type hints for now

see; I wont drop ALL type hinting; I would like to keep some basic type hinting for sure.

Again; pushing a commit...

Removed some type hinting because of runtime errors on older versions of Python.
Made the implementation better, faster, and smaller in size by using a helper function called `parseHelper` which just returns the args and kwargs it recieves.
New docs for the new implementation.
changed camelCase to snake_case for consistency. Also, removed unnecessary functions.
docs/callback.rst Outdated Show resolved Hide resolved
formation/callback_parse.py Outdated Show resolved Hide resolved
formation/loader.py Outdated Show resolved Hide resolved
formation/loader.py Outdated Show resolved Hide resolved
Copy link
Owner

@ObaraEmmanuel ObaraEmmanuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have polished up the code. It still does not pass some of the lambda tests I have written locally so I will add some more code to resolve this later in the week. I also intend to change for format from funcname arg1 arg2 ... kwarg1=v kwarg2=v ... to funcname(arg1, arg2,..., kwarg1=v, kwarg2=v, ...) for easier parsing.

@ObaraEmmanuel ObaraEmmanuel merged commit b51f3fc into ObaraEmmanuel:master May 29, 2024
8 checks passed
KavyanshKhaitan2 added a commit to KavyanshKhaitan2/ObaraEmmanuel.Formation.PRs that referenced this pull request May 30, 2024
This commit acknowledges some of @ObaraEmmanuel in pull request ObaraEmmanuel#33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Lambda support in callbacks
2 participants