[Expat-discuss] Question Concerning Python stubs

jchick@dsl.net jchick@dsl.net
Wed Dec 5 08:21:05 2001


To Expat-List:

	I have a question about the python which "just doesn't make sense"
or Choo-baca. Here is my problem illistrated below:


	file:  Python2.0/xml/parser/expat.py

		contains:

			"""Interface to the Expat non-validating XML parser."""
			__version__ = '$Revision: 1.1 $'

			from pyexpat import *	<---- I understand the Import of pyexpat.py

-------------------------------------------------------------------------------------


	file: Python2.0/pyexpat.py

		contains:

			# XXX TypeErrors on calling handlers, or on bad
			return values from a# handler, are obscure and unhelpful.

			from xml.parsers import expat  <---- I don't understand why??

			class Outputter:
    				def StartElementHandler(self, name, attrs):
        				print 'Start element:\n\t', repr(name), attrs

			<Class Continues>

			...
			...
			...


			out = Outputter()

			#####################################################


Where Does This Method Exsist -->  parser = expat.ParserCreate(namespace_separator='!')


			#####################################################

			# Test getting/setting returns_unicode
			parser.returns_unicode = 0; confirm(parser.returns_unicode == 0)


---------------------------------------------------------------------------------------------


	If you don't understand my picture above, this is the break down
of it. I have two python file, one file is located in Python2.0/xml/parser/expat.py,
which looks to import the other file located Python2.0/pyexpat.py. The
first file imports everything from pyexpat, which makes senses, but in the
second file pyexpat.py, the imports are pulling everything from expat.py,
which is nothing.......  The first choo-baca thing and the second
choo-baca thing is located in pyexpat.py after the class were the function
call of ParserCreate from expat. Reminder that expat has nothing in it, so
how does this function exsists or do I have a bad copy of expat.py.


PS - Choo-baca is a reference from SouthPark, if you don't watch SouthPark
then I am sorry.......


Josh Chick
jchick@dsl.net