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

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.0.tar.gz (4.4 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.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

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

Hashes for multiproxpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5d68352b3e6891631ea2af9d93cfeeb8226308485554ff8a7d8861273eaaabd8
MD5 62704d57600c847b33f4c0fcf95e3973
BLAKE2b-256 b9ed90a477ce63d34ae8f679e5484403a22923d9a64a6717ffb43d4adbe91f18

See more details on using hashes here.

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

Hashes for multiproxpy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 817507c38d9e65a8d592a81b46d173b587c8d3b11ccd03fe8a42d5fdee729672
MD5 006412ca6aa00574e0ec71c64766c2cb
BLAKE2b-256 704ce152ee3627cc29abb76f633438db751259021f6834a348590cb8451fed21

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

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