Skip to content

Instantly share code, notes, and snippets.

View asaboor-gh's full-sized avatar
👋

Abdul Saboor asaboor-gh

👋
View GitHub Profile
@asaboor-gh
asaboor-gh / create_function.py
Created May 5, 2021 22:52 — forked from dsuess/create_function.py
Dynamic function creation in Python
"""
Python is a dynamic language, and it is relatively easy to dynamically create
and modify things such as classes and objects. Functions, however, are quite
challenging to create dynamically.
One area where we might want to do this is in an RPC library, where a function
defined on a server needs to be available remotely on a client.
The naive solution is to simply pass arguments to a generic function that
accepts `*args` and `**kwargs`. A lot of information is lost with this approach,
however, in particular the number of arguments taken. Used in an RPC
implementation, this also delays any error feedback until after the arguments
@asaboor-gh
asaboor-gh / settings.json
Created May 22, 2020 02:05 — forked from cinnamon-msft/settings.json
Windows Terminal Build Color Scheme
{
"name": "Build",
"foreground": "#f1f1f1",
"background": "#492D7C",
"cursorColor": "#FFFFFF",
"black": "#0C0C0C",
"red": "#C50F1F",
"green": "#13A10E",
"yellow": "#C19C00",