Skip to main content

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:
img.png
(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.

  1. Any return-value on proxy-calls will be lost
  2. Simmilarely, math operations like additions don't work for the proxy. However, inline-operations do, e.g.: list_proxy += [5]
  3. The proxy can't fool isinstance, e.g.: isinstance(list_proxy, list) will return False
  4. 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)

Source distribution for MultiProxPy 0.2.1
File Size Uploaded
multiproxpy-0.2.1.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MultiProxPy 0.2.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page