[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-db-sig
Subject:    [DB-SIG] postgresql-python return type
From:       tbryan () starship ! beopen ! com (Tom Bryan)
Date:       2000-06-29 2:14:14
Message-ID: Pine.LNX.4.21.0006281910260.9066-100000 () starship ! beopen ! com
[Download RAW message or body]

On Mon, 19 Jun 2000, Karl Thomas Diedrich wrote:

> type(tagetSearchResult) = <pgqueryobject at ...>
> I can display the value(query results) of the object with the print
> command
> print targetSearchResult
> 
> I tried formatting it as a string but I get the object type name instead
> of the value
> format = '%s'
> results = format % (targetSearchResult)
> print reults   =    <pgqueryobject at ...>

That's very odd.   I'm pretty sure that both print and formatting as %s
both call the __str__ method of the class.  In that case, the following
pieces of code should print the same output for all objects var

print var

and 

x = '%s' % var; print x

At least now you have a general Python question that you can post to
comp.lang.python.  Perhaps my claim is incorrect.

----Tom




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic