The 'gx' and 'mv' variables

37 views
Skip to first unread message

Gearoid Murphy

unread,
Aug 27, 2012, 11:12:16 AM8/27/12
to shedskin...@googlegroups.com
shared.py contains variables called _gx and _mv, I see references to them scattered across the code, can anyone provide more context on their meaning?

Thanks.

Jérémie Roquet

unread,
Aug 27, 2012, 11:35:16 AM8/27/12
to shedskin...@googlegroups.com
Hi Gearoid,

2012/8/27 Gearoid Murphy <gearoid....@gmail.com>:
> shared.py contains variables called _gx and _mv, I see references to them
> scattered across the code, can anyone provide more context on their meaning?

_mv is the moduleVisitor currently in use. moduleVisitor is a derived
class from the standard ASTVisitor class, which implements the
“Visitor” design pattern. Its role is to handle the parsing of the
Python code in a module. You may want to read the documentation of the
compiler module¹ to understand how it works.

_gx is the globalInfo. Its attributes are very loosely related. Well,
one could say they are not related at all, actually ;-) See it as a
bunch of global variables.

Hope this helps, best regards,

¹ http://docs.python.org/library/compiler.html

--
Jérémie

Jérémie Roquet

unread,
Aug 27, 2012, 11:37:51 AM8/27/12
to shedskin...@googlegroups.com
2012/8/27 Jérémie Roquet <arka...@gmail.com>:
> 2012/8/27 Gearoid Murphy <gearoid....@gmail.com>:
> Its role is to handle the parsing of the Python code in a module.

Err. I mean: not the parsing per se; it handles the /result/ of the
parsing (the abstract syntax tree).

--
Jérémie

Gearoid Murphy

unread,
Aug 27, 2012, 11:41:09 AM8/27/12
to shedskin...@googlegroups.com
Ah, I see, thanks for the insight.

Reply all
Reply to author
Forward
0 new messages