Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: copyright

Fishhook Extended

This module allows for swapping out the slot pointers contained in static classes with the generic slot pointers used by python for heap classes. This allows for assigning arbitrary python functions to static class dunders using hook and hook_cls and for applying new functionality to previously unused dunders. A hooked static dunder can be restored to original functionality using the unhook function

Extended from fishhook by chilaxan

Calling original methods

orig(self, *args, **kwargs) is a special function that looks up the original implementation of a hooked dunder in the methods cache. It will only work properly when used inside a hooked method where an original implementation existed Extended: orig also now looks up the original attribute of a hooked type slot in the attributes cache. Can work anywhere, provided it is given the hooked class.

hooking single methods

@hook(int)
def __add__(self, other):
  ...
  return orig(self, other)

hooking multiple methods

@hook_cls(int)
class int_hook:
  attr = ...

  def __add__(self, other):
    ...

Extended: hooking type slots

int_dict_hook = {'a': 3}
hook(int, '__dict__')(int_dict_hook)

Links

Github

PyPi

Release files for fishhook-extended 0.0.2

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

Source distribution (sdist)

Source distribution for fishhook-extended 0.0.2
File Size Uploaded
fishhook-extended-0.0.2.tar.gz 5.8 kB Details

Release files / fishhook-extended-0.0.2.tar.gz

Download URL fishhook-extended-0.0.2.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f3c42685940f0ac296dd4a5bc38b78fde947898a0a1d84ffbb546ea45ddefd5f
BLAKE2b-256 checksum
How to use checksums
212316a4631edcc7506d2183387cdb125a1f8f232311a274cd1ed5b812de3f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

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