Skip to content

A python package for compiling large branching python functions into iterative C code.

Notifications You must be signed in to change notification settings

LQR471814/permute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

permute

A python package for compiling large branching python functions into iterative C code.

Coding Guidelines

Use python 3.10+

Use type hints in parameters and returns.

def typed_function(a: int, b: int) -> int:
    return a + b

Use type hints in assignments to indicate initialization

def foo():
    x: int = 0
    x = x + 1

When using type hints, do not use any of the now-deprecated UpperCase type classes from the typing package

# do this ✔
x: list[float] = [0.1, 0.2, 0.3]
y: dict[str, int] = {
    'foo': 0,
    'bar': 1,
}

# not this ✖
from typing import List, Dict
x: List[int] = []
y: Dict[str, int] = {}

Unsupported Language Features

  • Classes & Objects, use namedtuple instead
  • Iterable unpacking a, b = (1, 2)
  • Keyword arguments func(a=2)
  • Default arguments def func(a: float = 2)
  • Variable length arguments *args and **kwargs

WIP Language Features

  • Dictionaries

About

A python package for compiling large branching python functions into iterative C code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published