Hi Joachim,

Often times when people first send e-mails to the mailing list it takes a
while for it to get through.  I wouldn't blame them for sending multiple
times.  I've been guilty of this in the past.

Hi Abhishek,

You have a variable other, in your method definition that is never defined.
 Maybe you meant this to refer to your input argument, args?


On Thu, May 15, 2014 at 1:33 PM, Joachim Durchholz <[email protected]> wrote:

> 1) One message to the list is enough, it won't be read faster if you send
> it thrice within ten minutes. Actually most knowledgeable people on this
> list scan their SymPy inbox once per day
>
> Am 15.05.2014 20:15, schrieb Abhishek K Das:
>
>    wrote this function for FiniteSet
>>
>>      def as_dict(self,*args):
>>          """
>>          Rewrite a FiniteSet as a Dictionary.
>>
>>          Examples
>>          ========
>>          >>> from sympy import Symbol
>>          >>> from sympy.core import sets
>>          >>> A = FiniteSet((0, 0), (0, 2), (2, 0), (2, 2))
>>          >>> x = Symbol('x')
>>          >>> y = Symbol('y')
>>
>>          >>> A.as_dict(x,y)
>>          [{x: 0, y:0}, {x: 0, y:2}, {x:2, y:0}, {x:2, y:2}]
>>          """
>>          _list = []
>>          for elem in self:
>>              _list.append(dict(zip(list(other),list(elem))))
>>              return _list
>>
>> but when I do ./bin/doctest core it shows :
>>
>>
>> _______________________________________ sympy.core.sets.FiniteSet.as_dict
>> _______________________________________
>> File "sympy/core/sets.py", line 1524, in sympy.core.sets.FiniteSet.as_
>> dict
>> Failed example:
>>      A.as_dict(x,y)
>> Exception raised:
>>      Traceback (most recent call last):
>>        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
>>          compileflags, 1) in test.globs
>>        File "<doctest sympy.core.sets.FiniteSet.as_dict[5]>", line 1, in
>> <module>
>>          A.as_dict(x,y)
>>        File "sympy/core/sets.py", line 1530, in as_dict
>>          _list.append(dict(zip(list(other),list(elem))))
>>      NameError: global name 'other' is not defined
>>
>> ============================= tests finished: 216 passed, 1 failed, in
>> 2.51
>> seconds =============================
>> DO *NOT* COMMIT!
>> ============================================== rst doctests start
>> ===============================================
>>
>>
>> This is the first time , I have made some changes in any file in sympy . I
>> am a newbie , please tell me what are the issues with the doctest and how
>> can I edit this so as
>> to get the test passed ?
>>
>
> The bug is in your function. It is referencing the name "other", but it is
> neither a parameter nor available as a global Python variable.
>
> The doctest merely triggers the problem.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/53752494.7050506%40durchholz.org.
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJ8oX-ECNXzzNpqNyVBX3xn%2BSgF5PiW-e-7Put2JqzLNy7D56A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to