Metadata-Version: 1.1
Name: tcopy
Version: 0.1.2
Summary: Basic tail call removal decorator
Home-page: https://github.com/Bogdanp/tcopy
Author: Bogdan Popa
Author-email: popa.bogdanp@gmail.com
License: UNKNOWN
Description: # 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.
        
Keywords: dangerous,optimization,useless
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Interpreters
