Why is CGI module so complicated?

Michael P. Reilly arcege at shore.net
Tue Aug 10 19:02:00 CEST 1999

Ian Clarke <I.Clarke at NOSPAM.strs.co.uk> wrote:
: I have been writing an application using the cgi module, and am somewhat
: confused as to why data is returned in FieldStorage or MiniField storage
: objects, why not just return it in a plain dictionary?

: At the moment, lets say you want to access a CGI variable called "pie"
: you need to use:

: f = cgi.FieldStorage()
: print f['pie'].value

: But why not just:

: f = cgi.FieldStorage()
: print f['pie']

: That way the FieldStorage object would be a true dictionary, and could
: be used as, for example, a TemplateDocument's substitutions dictionary.

: I would write a wrapper to get rid of all of the FieldStorage objects,
: but I have almost finished my code :-(

: Can anyone explain what the point of the FieldStorage and
: MiniFieldStorage objects are?

: Ian

Ian, please read my reply in the previous thread:


More information about the Python-list mailing list