[Httplib2-discuss] =?WINDOWS-1252?Q?Re:_[Httplib2-discuss]_Bug_#1462092:_Follo?= =?WINDOWS-1252?Q?w-
Status: Beta
Brought to you by:
jcgregorio
From: Joe G. <joe...@gm...> - 2006-04-03 13:50:36
|
On 4/3/06, Thomas Broyer <t.b...@gm...> wrote: > If you don't like my: > if headers.has_key('connection'): > hopbyhop =3D HOP_BY_HOP + [x.strip() for x in > response.get('connection', '').split(',')] > else: > hopbyhop =3D HOP_BY_HOP > you can just do: > hopbyhop =3D list(HOP_BY_HOP) > hopbyhop.extend([x.strip() for x in response.get('connection', > '').split(',')]) > > By using "list(HOP_BY_HOP)", we're making a copy of HOP_BY_HOP that we > can then extend without modifying the global variable. Thanks, I went with the list(HOP_BY_HOP) solution. -joe -- Joe Gregorio http://bitworking.org |