Skip to content

Commit 2838356

Browse files
committed
added comments
1 parent 232cd4b commit 2838356

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

include/pythonic/pythonicVars.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ namespace pythonic
153153
// and require manual lifetime management in var's constructors/destructor.
154154
// And as they are heap-allocated memory and heap-allocation is performence costly, need to optimize or minimize frequent allocation and deallocation
155155

156+
// ============================================================================
157+
// TODO: Rule of Five: Destructor, copy/move constructor, assignment for var (see memory safety notes below)
158+
// TODO: Audit all unchecked union accesses (e.g., as_int_unchecked) for type safety
159+
// TODO: Consider using std::shared_ptr or copy-on-write for heap objects to avoid ghost/dangling references in views/enumerate/zip
160+
// TODO: Dict/Set: Detect mutation during iteration and throw, like Python (avoid iterator invalidation crashes)
161+
// TODO: Enforce deep const-correctness (const var should not allow mutation of underlying data)
162+
// TODO: Refactor operator+/-/* etc. to use a dispatch table (function pointer matrix) for efficiency and extensibility
163+
// TODO: Audit string-numeric promotion logic for Pythonic strictness
164+
// ============================================================================
165+
156166
union VarData
157167
{
158168
bool b;

0 commit comments

Comments
 (0)