Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55145

Re: Python Unit Tests

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Python Unit Tests
Date 2013-09-30 20:06 -0400
References <bb6482de-ce4e-4dd2-845c-f71008123c03@googlegroups.com> <64c1fa97-ace1-4fee-83b0-cf5fd7230e82@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.525.1380586006.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 9/30/2013 3:54 PM, melwin9@gmail.com wrote:
> Lol, im starting to get the hang out of, onto the next hurdle, i looked up the error and it says the data is none?
>
> Traceback (most recent call last):
>    File "guess.py", line 34, in <module>
>      main(random.randint(1, 10))
>    File "guess.py", line 27, in main
>      guess, tries = getguess(target, allowed)
> TypeError: 'NoneType' object is not iterable

If you have not figured it out yet, add a copy of the return within the 
while loop,
    return guess, tries
after the while loop also, so it does not return the default of None.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Python Unit Tests melwin9@gmail.com - 2013-09-27 21:52 -0700
  Re: Python Unit Tests Dave Angel <davea@davea.name> - 2013-09-28 06:11 +0000
  Re: Python Unit Tests Terry Reedy <tjreedy@udel.edu> - 2013-09-28 14:47 -0400
    Re: Python Unit Tests melwin9@gmail.com - 2013-09-29 18:46 -0700
      Re: Python Unit Tests Steven D'Aprano <steve@pearwood.info> - 2013-09-30 02:55 +0000
        Re: Python Unit Tests melwin9@gmail.com - 2013-09-29 21:19 -0700
          Re: Python Unit Tests Terry Reedy <tjreedy@udel.edu> - 2013-09-30 02:08 -0400
  Re: Python Unit Tests melwin9@gmail.com - 2013-09-30 12:54 -0700
    Re: Python Unit Tests MRAB <python@mrabarnett.plus.com> - 2013-09-30 21:08 +0100
    Re: Python Unit Tests Dave Angel <davea@davea.name> - 2013-09-30 20:20 +0000
    Re: Python Unit Tests Terry Reedy <tjreedy@udel.edu> - 2013-09-30 20:06 -0400

csiph-web