Question on keyword arguments

grsmith at atlanticbb.net grsmith at atlanticbb.net
Thu Feb 18 10:57:31 EST 2016


Thanks to all who responded, it is a big help. 

Tim, the 'crazy-other-result format' is the
result returned by the database, nothing
I can do about that :)

Thanks again
George

-----Original Message----- 
From: Chris Angelico 
Sent: Thursday, February 18, 2016 10:45 AM 
Cc: python-list at python.org 
Subject: Re: Question on keyword arguments 

On Fri, Feb 19, 2016 at 2:39 AM, Dan Strohl <D.Strohl at f5.com> wrote:
> So, define a return object like:
>
> from collections import UserList
> class TestResponse(UserList):
>     def __str__(self):
>         return '\0xfe%s' % '\0xfe'.join(self.data)
>
> ...and return that object.

Out of interest, why UserList rather than simply subclassing list?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list