Skip to content

objcode/python-inject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

#Inject python locals#

A bit of hackery to experiment with alternative call flow in python.

To use:

def foo():
    print a
   
inject(a=5).into(foo)
>> 5

@inject(cat='man')
def bar():
    print "the cat is a", cat

bar()
>> the cat is a man

@inject(a=5)
def baz(a=6):
    print a

baz()
>> 5

Q: Why should I use this?

A: You shouldn't

Q: Why does it exist?

A: Because it can

Q: Are you crazy?

A: ?

Q: Is it good?

A: yes

About

Inject variables into a python function at call time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy