On 02/10/16 23:47, boB Stepp wrote:
> adequately testing it. I cannot even conceive of what might be edge
> cases for this function.
I meant to add, the obvious boundaries for this actual function
are passing in non-callable values, or callables that require
arguments.
And to handle those you
On Sun, Oct 2, 2016 at 6:00 PM, Steven D'Aprano wrote:
> On Sun, Oct 02, 2016 at 05:47:51PM -0500, boB Stepp wrote:
>> In exercise 3.2 of Downey's "Think Python 2" he has a function:
>>
>> def do_twice(f):
>> f()
>> f()
>>
>> As you know, I am trying to learn testing/TDD while doing these
On 02/10/16 23:47, boB Stepp wrote:
> In exercise 3.2 of Downey's "Think Python 2" he has a function:
>
> def do_twice(f):
> f()
> f()
>
> As you know, I am trying to learn testing/TDD while doing these
> exercises. How do I test such a *general* function?
You are testing do_twice() no
On Sun, Oct 02, 2016 at 05:47:51PM -0500, boB Stepp wrote:
> In exercise 3.2 of Downey's "Think Python 2" he has a function:
>
> def do_twice(f):
> f()
> f()
>
> As you know, I am trying to learn testing/TDD while doing these
> exercises. How do I test such a *general* function? Should
In exercise 3.2 of Downey's "Think Python 2" he has a function:
def do_twice(f):
f()
f()
As you know, I am trying to learn testing/TDD while doing these
exercises. How do I test such a *general* function? Should I create
a variety of arbitrary functions in my test file, call the do_twic
On 02/10/16 03:50, anish singh wrote:
>> Possibly, but we can't tell because
>> a) You don't show us the code that parses your input
Thanks, that helps.
> import os, sys, getopt
> import re
> import glob
>
>
> def get_full_path(path, pattern):
> for (dirpath, dirnames, filenames) in os.walk(
On 02/10/16 02:46, boB Stepp wrote:
>> case. If I know that the result is always an int I can
>> use the first case if I know its always a tuple I can
>> use the second. But not knowing which is just plain
>> messy.
>
> So in which sorts of scenarios would you use argument unpacking?
Any time a
> On 01/10/16 09:16, anish singh wrote:
> > I am trying to implement grep to just increase my knowledge
> > about regular expression.
> >
> > Below is the program usage:
> > python test.py -i Documents/linux/linux/ -s '\w+_readalarm*'
> >
> > However, due to my lack of knowledge about string handli