I can't reproduce the error, but

On 2013/06/11, at 1:46, Bram Moolenaar <b...@moolenaar.net> wrote:
> The following differences ones are similar.

so the following simpler test (line 536 of test86.ok) also fails similarly?

>>> Testing *Iter* using d["a"] = %s
d["a"] = FailingIter():(<type 'exceptions.TypeError'>, TypeError('unable to 
convert to vim structure',))

The code tested here is essentially like the following:

:py d = vim.bindeval("{}")
:py <<EOF
class FailingIter(object):    # has __iter__() but no next()
    def __iter__(self):
        raise NotImplementedError
obj = FailingIter()   # obj is introduced for the discussion below
d["a"] = obj
EOF

'TypeError: unable to convert to vim structure' may mean:
The object obj is not an iterator (nor any other object type I know),
so I can't convert it into data structure which vim knows.

The other error, NotImplementedError, may mean:
obj looked like an iterator, so I tried to iterate over it but failed.

Since it is obvious that FailingIter() is not an iterator, I think
the former behavior is better; calling __iter__() can cause more
serious problem than just NotImplementedError in real (not test) code.
If we know that calling it is useless (since there is no next() method
anyway), it would be better not to call it, I suppose.

BTW, in test86.in, there are several uncommented (disabled) tests like
(line 933, 973, ...)

#iter_test('sys.stdout.writelines(%s)')
#iter_test('d.update(%s)')

Are these related to the current problem?

---
Jun



-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui