Fundamental Limitations
Dynamic Features
Shed Skin requires static typing, which makes many dynamic Python features impossible to support. Not Supported:Introspection and Metaprogramming
Not Supported:Unsupported Standard Library Modules
The following categories of standard library modules are not supported:All Dynamic and Introspection Modules
importlib- Dynamic importsinspect- Runtime introspectionast- Abstract syntax treesdis- Bytecode disassemblertypes- Dynamic type creationtyping- Type hints (not needed for Shed Skin)__future__- Feature flags
Debugging and Profiling
pdb- Python debuggercProfile,profile- Python profilingtrace- Execution tracingtraceback- Stack trace formatting
Serialization and Persistence
pickle- Object serializationshelve- Persistent dictionarymarshal- Internal Python object serializationjson- JSON encoding/decoding (not yet supported)xml- XML processing
- Use CSV for simple tabular data (csv module is supported)
- Implement custom text-based formats
- Use Shed Skin extension module with Python’s pickle:
Threading and Multiprocessing
threading- Thread-based parallelismmultiprocessing- Process-based parallelism (except when using extension modules)concurrent.futures- High-level parallelismasyncio- Asynchronous I/O
- Use C++ threading directly in custom library code
- Use multiprocessing with extension modules:
Network and Web Frameworks
urllib,urllib2,urllib3- URL handlinghttp- HTTP modulesrequests- HTTP library (third-party)flask,django- Web frameworksemail- Email handlingsmtplib- SMTP protocol
socket module (partially supported) for low-level networking, or use extension modules with Python network libraries.
GUI Frameworks
tkinter- Tk GUIPyQt,PySide- Qt bindingswxPython- wxWidgets bindingspygame- Game development
Database and ORM
sqlite3- SQLite databasemysql- MySQL databasepsycopg2- PostgreSQLsqlalchemy- SQL toolkit and ORM
Partially Supported Modules
Some modules have limited support. Here’s what’s missing:collections
Not Supported:namedtuple- Named tuple factory (dynamic type creation)Counter- Counting dictionaryOrderedDict- Ordered dictionary (regular dict maintains order)ChainMap- Multiple dict views
functools
Not Supported:partial- Partial function applicationlru_cache- Memoization decoratorwraps- Decorator metadatasingledispatch- Generic functions
itertools
Not Supported:starmap- Apply function to iterable of tuples
os
Not Supported:os.walk- Directory tree traversalos.popen- Pipe to commandos.fork- Process forking- Most process management functions
- Environment variable manipulation (limited)
- Basic file operations:
os.remove(),os.rename(),os.listdir() - Directory operations:
os.mkdir(),os.rmdir(),os.getcwd(),os.chdir() os.path- Fully supportedos.system()- Run shell command
sys
Not Supported:sys.modules- Loaded modulessys.path- Module search path- Most introspection attributes
sys.settrace()- Debug tracing
sys.argv- Command-line argumentssys.exit()- Exit programsys.stdin/stdout/stderr- Standard streamssys.maxsize- Largest integer
datetime
Status: Partially supported but not well tested Known Issues:- May have edge cases with timezone handling
- Some methods might not work correctly
- Limited strftime/strptime support
time module for simple time operations:
Unicode and Text Encoding
Limitation: Currently restricted to 1-byte characters (ASCII, Latin-1). Not Supported:- Full Unicode/UTF-8 text processing
- Multi-byte character encodings
unicodedatamodule
- ASCII text (0-127)
- Latin-1 text (0-255)
- Binary data via bytes/bytearray
- Process only ASCII/Latin-1 text
- Use extension module with Python’s unicode:
Nested Functions and Closures
Not Supported:Argument Unpacking
Not Supported:Arbitrary-Size Integers
Limitation: Integers are fixed-size (32-bit, 64-bit, or 128-bit).- Use
--int64or--int128for larger range - Use float for approximate large numbers
- Implement custom bigint if needed (complex)
- Use extension module with Python’s int:
Exception Handling Limitations
Limitation: Cannot catch exception by dynamic typeSummary
Best Practices
- Compile computational core: Write performance-critical algorithms in Shed Skin-compatible Python
- Use extension modules: Keep dynamic/unsupported features in main Python program
- Static patterns: Design code with static typing in mind
- Test thoroughly: Ensure type inference succeeds on all code paths
- Profile first: Verify bottlenecks before porting to Shed Skin
See Also
- Supported Modules - What is supported
- Built-in Types - Type reference
- Creating Extension Modules - How to use Shed Skin with Python