Skip to content

bobjansen/patchy-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

patchy.py

Patchy.py allows you to keep define a Python function as the result of another function and a diff.

How to use?

The easiest way to define patched functions by putting both them in a temporary file and running patchy.create_patch() on them like this

$ edit tmp.py
$ python
> import patchy
> import tmp
> patch.create_patch(tmp.fun1, tmp.fun2)
  Copy the patch that is
> exit()
$ edit tmp.py
  Remove the body of fun2
  Put the patch in the doc string

See test.py for example patched files.

When?

When you just can't keep your code dry.

Why?

Why not?

About

Copy paste for pro's

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages