File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ typedef struct {
2121 PyObject * co_varnames ; /* tuple of strings (local variable names) */
2222 PyObject * co_freevars ; /* tuple of strings (free variable names) */
2323 PyObject * co_cellvars ; /* tuple of strings (cell variable names) */
24- /* The rest doesn't count for hash or comparisons */
24+ /* The rest aren't used in either hash or comparisons, except for
25+ co_name (used in both) and co_firstlineno (used only in
26+ comparisons). This is done to preserve the name and line number
27+ for tracebacks and debuggers; otherwise, constant de-duplication
28+ would collapse identical functions/lambdas defined on different lines.
29+ */
2530 unsigned char * co_cell2arg ; /* Maps cell vars which are arguments. */
2631 PyObject * co_filename ; /* unicode (where it was loaded from) */
2732 PyObject * co_name ; /* unicode (name, for reference) */
You can’t perform that action at this time.
0 commit comments