On 1/30/2014 6:00 PM, CM wrote:
On Thursday, January 30, 2014 5:25:31 PM UTC-5, Chris Angelico wrote:
On Fri, Jan 31, 2014 at 9:04 AM, CM wrote:
fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
fake_result = not all(i == '[omitted]' for i in fake_data)
Trying to get
On Fri, Jan 31, 2014 at 4:05 PM, Terry Reedy wrote:
> On 1/30/2014 5:55 PM, Chris Angelico wrote:
>>
>> On Fri, Jan 31, 2014 at 9:48 AM, CM wrote:
>>>
>>> builtin_all = __builtins__.all
>>>
>>> but I got the error:
>>>
>>> AttributeError: 'dict' object has no attribute 'all'
>>
>>
>> Try using sq
On 1/30/2014 5:55 PM, Chris Angelico wrote:
On Fri, Jan 31, 2014 at 9:48 AM, CM wrote:
builtin_all = __builtins__.all
but I got the error:
AttributeError: 'dict' object has no attribute 'all'
Try using square brackets notation instead. Apparently your
__builtins__ is a dictionary, not a mod
On Fri, Jan 31, 2014 at 10:00 AM, CM wrote:
> Essentially, if ALL the items in that list are '[omitted]', I must not
> process the list, but if even one of them is something other than
> '[omitted]', I need to process it.
Okay. The set example that I gave will work, then - as long as all
items
CM wrote:
> On Thursday, January 30, 2014 5:14:57 PM UTC-5, Peter Otten wrote:
>
>> Hint:
>>
>> >>> def demo():
>> ... fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
>> ... fake_result = not all(i == '[omitted]' for i in fake_data)
>> ... print 'This is fake result: ', f
On Thursday, January 30, 2014 5:25:31 PM UTC-5, Chris Angelico wrote:
> On Fri, Jan 31, 2014 at 9:04 AM, CM wrote:
>
> > fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
>
> > fake_result = not all(i == '[omitted]' for i in fake_data)
>
> > print 'This is fake result: ',
> Try using square brackets notation instead. Apparently your
> __builtins__ is a dictionary, not a module, though I don't know why
> (probably something to do with numpy, which I've never actually used).
>
> But try this:
> builtin_all = __builtins__["all"]
>
> It might work.
Yes, it does. Tha
On Fri, Jan 31, 2014 at 9:48 AM, CM wrote:
> builtin_all = __builtins__.all
>
> but I got the error:
>
> AttributeError: 'dict' object has no attribute 'all'
Try using square brackets notation instead. Apparently your
__builtins__ is a dictionary, not a module, though I don't know why
(probably s
On Thursday, January 30, 2014 5:14:57 PM UTC-5, Peter Otten wrote:
> Hint:
>
> >>> def demo():
> ... fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
> ... fake_result = not all(i == '[omitted]' for i in fake_data)
> ... print 'This is fake result: ', fake_result
>
> >>> d
On Fri, Jan 31, 2014 at 9:04 AM, CM wrote:
> fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
> fake_result = not all(i == '[omitted]' for i in fake_data)
> print 'This is fake result: ', fake_result
Trying to get my head around this. You want to see if all the values
in fa
CM wrote:
> This is puzzling. (Using Python 2.5, WinXP, Boa Constructor 0.6.1
> definitely running the code through Python 2.5)
>
> If I run these lines in my program, through my IDE (Boa Constructor),
>
> fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
> fake_result = not a
This is puzzling. (Using Python 2.5, WinXP, Boa Constructor 0.6.1 definitely
running the code through Python 2.5)
If I run these lines in my program, through my IDE (Boa Constructor),
fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
fake_result = not all(i == '[omitted]' for
12 matches
Mail list logo