On this page
  1. weakref.CallableProxyType
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

weakref.CallableProxyType

Up: weakref | Next: weakref.finalize
Rel: weakref.finalize, weakref.getweakrefcount, weakref.getweakrefs, weakref.proxy
Ref: docs.python.org — weakref.CallableProxyType
Tags: #public #python3 #stdlib #weakref


Import

import weakref
from weakref import CallableProxyType

Signature & Overview

weakref.CallableProxyType()

weakref.CallableProxyType class.

Usage

import weakref

class Fn:
    def __call__(self): return 42

f = Fn()
p = weakref.proxy(f)
assert isinstance(p, weakref.CallableProxyType) and p() == 42

Gotchas

REPL Inspect

from weakref import CallableProxyType
help(CallableProxyType)

Linked from

Related notes