Python library for creating memory efficient D classes