Sir, I did as you've said but there was still a compile time warning:
python setup.py build_ext --inplace running build_ext cythoning pyparsing.pyx to pyparsing.c warning: pyparsing.pyx:413:8: Unreachable code building 'pyparsing' extension creating build creating build\temp.win32-2.7 creating build\temp.win32-2.7\Release C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tcpyparsing.c /Fobuild\t emp.win32-2.7\Release\pyparsing.obj pyparsing.c C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCRE MENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild /EXPORT:initpyp arsing build\temp.win32-2.7\Release\pyparsing.obj /OUT:C:\Users\iProsper\Desktop \pyparsing\pyparsing.pyd /IMPLIB:build\temp.win32-2.7\Release\pyparsing.lib /MAN IFESTFILE:build\temp.win32-2.7\Release\pyparsing.pyd.manifest Creating library build\temp.win32-2.7\Release\pyparsing.lib and object build\ temp.win32-2.7\Release\pyparsing.exp C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe -nologo -manifest build \temp.win32-2.7\Release\pyparsing.pyd.manifest -outputresource:C:\Users\iProsper \Desktop\pyparsing\pyparsing.pyd;2
The warning is actually in the line 4: warning: pyparsing.pyx:413:8: Unreachable code. I then changed the line to read as:
def __getattr__( self, name ): if True: #name not in self.__slots__: if name in self.__tokdict: if name not in self.__accumNames: return self.__tokdict[name][-1][0] else: return ParseResults([ v[0] for v in self.__tokdict[name] ]) else: return "" else: return None
and then recompiled it. One thing I noticed is that even with the warning and the edit I made, both of them compiled successfully but when when I tried to test it with the following code:
from pyparsing import Word, alphas greet = Word(alphas) + ',' + Word(alphas) + '!' greeting = greet.parseString('Hello, World!') print greeting
I got the following error:
Traceback (most recent call last): File "C:\nwaomachux\build_pyparsing\checkout.py", line 1, in from pyparsing import Word, alphas File "pyparsing.pyx", line 3414, in init pyparsing (pyparsing.c:100064) AttributeError: 'builtin_function_or_method' object has no attribute 'ANY_VALUE'
I would have altered the file further and sent it to you to check it out but I'm only some few hours old with Pyparsing, so I've yet to get a grasp of the full source code.
I wouldn't know what the effect(s) of moving withAttribute.ANY_VALUE = object() to the beginning of def withAttribute(args,*attrDict): function signify. Please, what's the fix to it? Thanks.