[IronPython] Compiler error for invalid field access
wd at teleri.net
Sun Aug 5 21:57:55 CEST 2007
On Sun Aug 05, 2007; 12:51PM -0700, Ori wrote:
> I'm using the following code to compile python code:
> SystemState state = new SystemState();
> MyCompilerSink sink = new MyCompilerSink();
> CompilerContext context = new CompilerContext(string.Empty, sink);
> Parser parser = Parser.FromString(state, context, "my code");
> it works find for finding syntax mistakes - but I also wan to know about
> invalid property names / method names. If for example the code uses the
> expression 'self.Name' I would like to see a compilation error if the object
> does not have a 'Name' property.
Because objects are mutable Python by its nature does not resolve
member/property references until they occur within the code. Consider
the following example (which is valid functional Python):
setup = False
f = foo()
f.baz = "hi"
f.setup = True
> Is there a way to do it?
> View this message in context: http://www.nabble.com/Compiler-error-for-invalid-field-access-tf4220967.html#a12007623
> Sent from the IronPython mailing list archive at Nabble.com.
> Users mailing list
> Users at lists.ironpython.com
personal: chip norkus; irc: wd; wd at teleri.net
info: finger wd at teleri.net for plan or keys; http://telekinesis.org
More information about the Ironpython-users