05 юли 2012, четвъртък, 00:25:49 UTC+3, Aaron Meurer написа:
>
> On Jul 4, 2012, at 2:20 PM, Aleksandar Makelov <
> [email protected]> wrote:
>
>
>
> 24 юни 2012, неделя, 04:22:56 UTC+3, Aaron Meurer написа:
>>
>> On Jun 23, 2012, at 10:32 AM, Joachim Durchholz <[email protected]> 
>> wrote: 
>>
>> > Am 23.06.2012 17:38, schrieb Aleksandar Makelov: 
>> >> We want to make sure that the right thing is done with the output from 
>> the 
>> >> RNGs, so we manually supply as an additional argument to a given 
>> function 
>> >> some particular choice for all the variables inside the function that 
>> come 
>> >> from RNGs. 
>> > 
>> > Ah, I see. 
>> > I'm not convinced that it's the best way to design such a thing. Adding 
>> parameters to a function that are purely there for testing purposes is 
>> going to confuse people who aren't into testing. It's also in contradiction 
>> to the "keep interfaces as narrow as possible" principle - a narrow 
>> interface means less things that need to be remembered by programmers, less 
>> things that need to be set up by the caller, less things that might be 
>> misinterpreted. 
>> > Also, it'd adding code to the functions. Which means adding bugs - 
>> which may affect the function if it's running in production. Which kind of 
>> defeats the purpose of testing in the first place. 
>>
>> This is fixed by the ideas of this pull request: 
>> https://github.com/sympy/sympy/pull/1375. 
>>
> I'm confused about this - how does the PR avoid the use of an additional 
> parameter?
>
>
> You still have an additional parameter, but there's no more code 
> duplication. 
>
> Aaron Meurer
>
 
Thanks. So the only thing that makes this different from manually supplying 
the values for the random variables is the use of the (predefined) 
generator object that spits out whatever we tell it to? Also, does the code 
duplication you're talking about refer to repeating the logic of the 
function in the tests?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/TAOJDbZ9b_oJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to