Skip to main content

Motivation

In my plabic package (https://pypi.org/project/plabic/), I had a class which had a private iterator in my implementation of shuffle algebra calculations

But then if I did the shuffle product of x and x, those iterators would be both driven together rather than separately Simlarly if I did x and y, then used y somehere else, the x iterator which should have had all of x and y information would be missing some pieces depending on how the y iterator had been driven.

Errors

So we have errors that cover this kind of situation. The first being SameObjectError and the latter being ConsumedObjectError

Cloning

Suppose we provide a way of cloning the objects so that the closures/iterators contained are separate now. Then the two functions avoid_common_pointers and avoid_this_pointer can fix up the argument lists to that combining function which expects all distinct objects. If there are no repeats, it does not do anything and does not even need to ever try to call that optional cloning function. If there are repeats, it will call the cloning function appropriately giving the new list of arguments.

Decorators

Assumes that the function being called has all of it's args as that same type T and none of the kwargs have T in them that need cloning

handle_args_repeats

if you provide the cloner function on T and it will call that cloner on any repeated arguments in args if you don't provide the cloner and there are repeats will raise the SameObjectError if you don't provide the cloner and there are no repeats, there will not be an error

invalidate_these_args

Either provide

  • a list of argument numbers that become invalid after this function
  • a list of argument numbers that remain valid after this function with the rest becoming invalid

Also need the function which does the invalidation and a way to query the validity

This makes sure all of the args are valid and then calls the function assuming that was the case After this, the args which are supposed to become invalid are invalidated

Metadata

Release files for ownershipworkaround 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ownershipworkaround 0.1.0
File Size Uploaded
ownershipworkaround-0.1.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ownershipworkaround 0.1.0
File Interpreter ABI Platform
ownershipworkaround-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / ownershipworkaround-0.1.0.tar.gz

Download URL ownershipworkaround-0.1.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
27f47afbc6fbc69c3586b4a49a2dc7d52c02dcd880c0606a977a3f21d9de8291
BLAKE2b-256 checksum
How to use checksums
0b2cc39c53e399805b61be84b30951abb61856d96c50b8eb6ebcafb0057a505e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / ownershipworkaround-0.1.0-py3-none-any.whl

Download URL ownershipworkaround-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d03811983b68dceba6f2816028051c599abe821d5b08090c151b6b1b944ca410
BLAKE2b-256 checksum
How to use checksums
28f08a5dd9e861ce631100aab4c77373d8b5b16ecc29525a143753844efe8703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.0 This release

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