RODeco a read only function decorator
Project description
RODeco a read only function decorator
Use Cases
---------
Let's say you're using a python module, and you don't like an inner working.
This module allows you to override any function inside a module, at run-time, as long it is not a builtin.
Afterwards, any call to this function, by anyone (you, or the module itself), will use what you defined.
Example
-------
import os
os.path.basename('./test') # Will output "test"
import RODeco
@RODeco.RODeco(os.path.basename, "_old_basename")
def newbasename(s):
return "~/" + _old_basename(s)
os.path.basename('./test') # Will output "~/test"
Use Cases
---------
Let's say you're using a python module, and you don't like an inner working.
This module allows you to override any function inside a module, at run-time, as long it is not a builtin.
Afterwards, any call to this function, by anyone (you, or the module itself), will use what you defined.
Example
-------
import os
os.path.basename('./test') # Will output "test"
import RODeco
@RODeco.RODeco(os.path.basename, "_old_basename")
def newbasename(s):
return "~/" + _old_basename(s)
os.path.basename('./test') # Will output "~/test"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
RODeco-1.1.tar.gz
(1.9 kB
view details)
File details
Details for the file RODeco-1.1.tar.gz
.
File metadata
- Download URL: RODeco-1.1.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fc5bfacbd3429ad94dab2fd0919cbb0aa6f71ec7fe80fade64512f59f0a4a78 |
|
MD5 | 65b2b12fe9717bcf6e20456b92679c02 |
|
BLAKE2b-256 | b6c0c503435c2e3359f9ad4eb78dfb04ab2b7545a796f3f68eb8aaea3f0bf199 |