MultiProxPy
A small python-package that allows you to "group" calls to objects.
The cool part is that the resulting "MultiProxy"-object can be used like the referenced objects:
from MultiProxPy import group_objects
list1 = [3,1,2]
list2 = [5,2]
list3 = [7,8,9]
list_proxy = group_objects(list1, list2, list3)
list_proxy.sort() # Sorts all lists
list_proxy.append(15) # Appends 15 to all lists
list_proxy[0] = -1 # Sets the first elemet to 0 for all lists
print(list1, list2, list3)
The grouping is very abstract and should work with any type of object.
The best part is that your IDE will treat the proxy-object like one of the contained objects.
It will suggest methods/attributes bound to that class:
Other examples can be found in the github-repository: https://github.com/CheesecakeTV/MultiProxPy
Limitations
There are a few downsides you should be aware of.
- Any return-value on proxy-calls will be lost
- Simmilarely, math operations like additions don't work for the proxy. However, inline-operations do, e.g.:
list_proxy += [5] - The proxy can't fool
isinstance, e.g.:isinstance(list_proxy, list)will returnFalse - Objects inside the proxy should have the same type, or a derived one. This is only a suggestion. If you are careful enough, you can mix different types
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiproxpy-0.2.0.tar.gz.
File metadata
- Download URL: multiproxpy-0.2.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.4.1 CPython/3.14.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d68352b3e6891631ea2af9d93cfeeb8226308485554ff8a7d8861273eaaabd8
|
|
| MD5 |
62704d57600c847b33f4c0fcf95e3973
|
|
| BLAKE2b-256 |
b9ed90a477ce63d34ae8f679e5484403a22923d9a64a6717ffb43d4adbe91f18
|
File details
Details for the file multiproxpy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: multiproxpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.4.1 CPython/3.14.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
817507c38d9e65a8d592a81b46d173b587c8d3b11ccd03fe8a42d5fdee729672
|
|
| MD5 |
006412ca6aa00574e0ec71c64766c2cb
|
|
| BLAKE2b-256 |
704ce152ee3627cc29abb76f633438db751259021f6834a348590cb8451fed21
|