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:
(The image might not show on PyPi. Here is the link: https://github.com/CheesecakeTV/MultiProxPy/blob/main/assets/images/SuggestionsOnProxyObject.png)
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
Metadata
Release files for MultiProxPy 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multiproxpy-0.2.1.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multiproxpy-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / multiproxpy-0.2.1.tar.gz
| Download URL | multiproxpy-0.2.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e66778bdcca1e5acc0f4ac0fa5a331b38e36aa8da7190ee1f6819e919bc55e2
|
|
BLAKE2b-256 checksum How to use checksums |
42b18fb3c67ff140a299aa9a199ced098c5450b14e541d698b5dfeece3b95596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.5 Windows/10
|
Release files / multiproxpy-0.2.1-py3-none-any.whl
| Download URL | multiproxpy-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
584ec17700192ec70924b3e9689f8957faca71bdd677aed8a7521c4a464a2055
|
|
BLAKE2b-256 checksum How to use checksums |
061e0cb77f36d4b4cd2952b1933d438c6cbaa0f4ddd496aff8c92d6406d7d0f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.5 Windows/10
|