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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiproxpy-0.2.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multiproxpy-0.2.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file multiproxpy-0.2.1.tar.gz.

File metadata

  • Download URL: multiproxpy-0.2.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Windows/10

File hashes

Hashes for multiproxpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3e66778bdcca1e5acc0f4ac0fa5a331b38e36aa8da7190ee1f6819e919bc55e2
MD5 2bcd28a5bd9fbb85c7f69c8d78d4fffe
BLAKE2b-256 42b18fb3c67ff140a299aa9a199ced098c5450b14e541d698b5dfeece3b95596

See more details on using hashes here.

File details

Details for the file multiproxpy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: multiproxpy-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Windows/10

File hashes

Hashes for multiproxpy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 584ec17700192ec70924b3e9689f8957faca71bdd677aed8a7521c4a464a2055
MD5 d493bfa4cf13598259b151db08b568a2
BLAKE2b-256 061e0cb77f36d4b4cd2952b1933d438c6cbaa0f4ddd496aff8c92d6406d7d0f5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 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