Skip to main content
# tcopy

_Do not use this._

A direct tail call optimizing decorator for Python.

## Examples:

```python
from tcopy import tco

@tco
def fib(n, x=0, y=1):
if n == 0:
return x
return fib(n - 1, y, x + y)
```

The `tco` decorator will rewrite `fib` into the following at
definition time:

```python
def fib(n, x=0, y=1):
while 1:
if n == 0:
return x
n, x, y = n - 1, y, x + y
```

## Quirks

`tco` uses `inspect.getsource` to grab a function's source code from
disk. Because of this, the decorator does not work in the Python REPL.

Release files for tcopy 0.1.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 tcopy 0.1.2
File Size Uploaded
tcopy-0.1.2.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tcopy 0.1.2
File Interpreter ABI Platform
tcopy-0.1.2.macosx-10.10-intel.exe Details

Total release size: 68.5 kB

Release files / tcopy-0.1.2.tar.gz

Download URL tcopy-0.1.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8401bdbd19d3d27266191a007087c610eb3539f2d025bdf9a1ed5167133ba930
BLAKE2b-256 checksum
How to use checksums
29d2852a474f5605a5263380b9176d44692508ac9f0b12ed4b9df0064a1a2b11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / tcopy-0.1.2.macosx-10.10-intel.exe

Download URL tcopy-0.1.2.macosx-10.10-intel.exe
Size 65.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4bf9dc043e393f0be28ae944abd0cd5a11c0d24e52f0aac13ce2c54fb901780c
BLAKE2b-256 checksum
How to use checksums
47e7ffbc7e8c378d5f9012d5b953b253847bed80d61ecdef5bec56f19332199a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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