shir0kamii / pyhooks Goto Github PK
View Code? Open in Web Editor NEWPython hooks for methods
Python hooks for methods
Hi ๐
This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.
Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.
That's it for now!
Happy merging! ๐ค
I came to this repo to learn hooks technology.After i see the theory,have doubts about what do pyhooks solve better than Python Decorators.Pyhooks and Decorators have same principle that can execute code before or after a method.For the example using in Pyhooks repo can use Python Decorators:
def hook(func):
def wrapper(*args,**kwargs):
self=args[0]
self.version+=1
return wrapper
class DatabaseEntry(object):
version = 0
@hook
def save(self):
print('save data')
database_entry=DatabaseEntry()
database_entry.save()
database_entry.save()
database_entry.save()
print(database_entry.version)
Hi, your library has been added to the Python object-oriented programming resources list
I was wondering if you had ever thought of simpler decorator names like
@after('save')
def increment_value(self):
pass
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.