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.1.0.tar.gz (3.3 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.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: multiproxpy-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 dfc1aea1e7c53b1819286cb957a33805df8532901e67fb26303a7d70a3b0ccf7
MD5 59d34848dc2f46fd9d5d02ddf2174f56
BLAKE2b-256 d9b48d41239f16cccf4fef199bd923445850e4db1a620a5540e0db032355617f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: multiproxpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb9233019bb50118b7729d027b1cfd6492b045a59eb5b5738fb930f1fe977f13
MD5 47abd801aac5c1b7fc27859fca6132bb
BLAKE2b-256 3c415bce64c2d003c61a01e87589f8509a82d9231306f990a7bf3093ff544769

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

0.2.0

2 files

This release

0.1.0 This release

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