|
From: Sumit's M. L. <li...@ba...> - 2014-08-29 20:57:48
|
I must have midread my logs earlier. The following does return a one element list, even if I have trailing whitespace: value = foo, So that works fine. Thanks. :) The only other question I had was I didn't see anything in the docs for optional arguments. I realize I can use the following to set a default: name = string(default='') And I can just check for the empty string, but this doesn't really work with other types: minRange = integer(default=?) I can't really use -1 because that's a valid range and there are some sections where this is totally optional and needs to be treated differently if it's not set. Is there a way to make some arguments optional, but still assign them a type if they're present? Sumit On 30/08/14 00:59, Michael Foord wrote: > On 29 Aug 2014, at 09:46, Sumit's Mailing Lists <li...@ba...> wrote: > >> Hey there, >> >> I'm using ConfigObj for a project and am trying to get it to accept >> single element lists. I've run into a some issues which I documented on >> this Stackoverflow Questions: >> >> http://stackoverflow.com/questions/25561597/configobj-and-single-element-lists >> >> Is what I'm trying to do possibly with the current version of ConfigObj? > The correct syntax for a single element list is: > > value = foo, > > A trailing comma, no brackets or braces. The value you get back with two elements including an empty string is probably a bug though. > > All the best, > > Michael Foord > >> Sumit >> >> >> ------------------------------------------------------------------------------ >> Slashdot TV. >> Video for Nerds. Stuff that matters. >> http://tv.slashdot.org/ >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop > > -- > http://www.voidspace.org.uk/ > > > May you do good and not evil > May you find forgiveness for yourself and forgive others > May you share freely, never taking more than you give. > -- the sqlite blessing > http://www.sqlite.org/different.html > > > > > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |