Skip to main content
Shed Skin supports the core Python built-in types with static type semantics. This page documents the available operations and methods for each type.

Numeric Types

int

Integer type. By default, integers are 32-bit signed integers on most architectures. Size Configuration:
  • Default: 32-bit signed integer (on most architectures)
  • Use --int64 flag for 64-bit integers
  • Use --int32 flag to explicitly specify 32-bit
  • Use --int128 flag for 128-bit integers
Supported Operations:
Supported Methods:
Important Notes:
  • No arbitrary-precision arithmetic (unlike CPython)
  • Integer overflow behavior follows C++ semantics
  • Use appropriate size flag for your data range needs

float

Floating-point number type. Size Configuration:
  • Default: 64-bit double precision
  • Use --float32 flag for 32-bit single precision
  • Use --float64 flag to explicitly specify 64-bit
Supported Operations:
Supported Methods:
Mixing int and float:

bool

Boolean type with values True and False. Supported Operations:

complex

Complex number type. Supported Operations:

Sequence Types

str

String type for text data. Character Encoding:
  • Currently restricted to 1-byte characters
  • No full Unicode/UTF-8 support
  • ASCII and Latin-1 work fine
Supported Operations:
Supported Methods:

bytes

Immutable sequence of bytes. Supported Operations:

bytearray

Mutable sequence of bytes. Supported Operations:

list

Mutable sequence type. Type Restriction: All elements must be of the same type (or compatible types with common base). Supported Operations:
Supported Methods:

tuple

Immutable sequence type. Type Restriction:
  • All elements same type for tuples of any length
  • Mixed types allowed for length-2 tuples only
Supported Operations:
Supported Methods:

Mapping Type

dict

Dictionary mapping type. Type Restriction: Keys must be of one type, values must be of one type. Keys must be hashable. Supported Operations:
Supported Methods:

Set Types

set

Unordered collection of unique elements. Type Restriction: All elements must be of the same type and hashable. Supported Operations:
Supported Methods:

frozenset

Immutable set type. Supports same operations as set except modifications.

Type Checking and Conversion

None Type

None represents absence of a value. Important Restriction: None can only be mixed with non-scalar types (not with int, float, bool, or complex).

Performance Notes

  • List operations: Appending is O(1) amortized. Prefer append() over + in loops.
  • String concatenation: Use "".join(list) for concatenating many strings instead of + in a loop.
  • Dictionary/set operations: Hash-based, typically O(1) for lookup/insert.
  • Integer size: Smaller integer sizes can improve performance and memory usage if your values fit.
  • Float size: 32-bit floats use less memory but have less precision.

See Also