One would be tempted to think that once a node is created, it receives a gnx which stays throughout its entiry lifespan. Turns out this is not the case:
Try executing this script: QQQ print "---- inserting ----" p2 = p.insertAsLastChild().copy() p3 = p.insertAsLastChild().copy() print [p2.gnx, p3.gnx] chi = p.children_iter() print [pos.gnx for pos in chi] QQQ I get this output (provided that the script node has no children when executed) QQQ ---- inserting ---- toString: unusual gnx None runMainLoop,eventFilter,masterKeyHandler,masterCommand,doCommand,executeScript,<module>,__get_gnx toString: unusual gnx None runMainLoop,eventFilter,masterKeyHandler,masterCommand,doCommand,executeScript,<module>,__get_gnx ['ville.20090506232652.70', 'ville.20090506232652.71'] toString: unusual gnx None runMainLoop,eventFilter,masterKeyHandler,masterCommand,doCommand,executeScript,<module>,__get_gnx toString: unusual gnx None runMainLoop,eventFilter,masterKeyHandler,masterCommand,doCommand,executeScript,<module>,__get_gnx ['ville.20090506232652.72', 'ville.20090506232652.73'] QQQ That is, the gnx is initially None, and p.gnx reports bogus gnx that has no bearing on what the gnx will be the next time the node is accessed. This is counterintuitive, and it doesn't "need" to be the case. Basically, when a tnode is constructed, it should receive a gnx, which should persist forever. Alternatively, the gnx *could* be created only when it's accessed, but in any case it should remain be the same from that point on. -- Ville M. Vainio http://tinyurl.com/vainio --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
