ListProperty is not iterable

664 views
Skip to first unread message

Mehmet Yilmaz Codes

unread,
Jul 15, 2015, 12:04:03 PM7/15/15
to kivy-...@googlegroups.com
Any help appreciated:









File "kivytest.py", line 238, in on_login_success


     self.loginevent.update_test_selection("Ya!")


   File "kivytest.py", line 64, in update_test_selection


     self.dispatch('on_update_tests',value)


   File "kivy/_event.pyx", line 695, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:6970)


   File "kivy/_event.pyx", line 1168, in kivy._event.EventObservers.dispatch (kivy/_event.c:12154)


   File "kivy/_event.pyx", line 1092, in kivy._event.EventObservers._dispatch (kivy/_event.c:11729)


   File "kivytest.py", line 144, in updatetests


     self.drops = ListProperty([])


   File "kivy/properties.pyx", line 397, in kivy.properties.Property.__set__ (kivy/properties.c:4680)


   File "kivy/properties.pyx", line 695, in kivy.properties.ListProperty.set (kivy/properties.c:10155)


   File "kivy/properties.pyx", line 596, in kivy.properties.ObservableList.__init__ (kivy/properties.c:7512)


 TypeError: 'kivy.properties.ListProperty' object is not iterable


I am confused, why is a listproperty not iterable?

Does this have something to do with it being initalized and "copying"?  I want to empty the property here if there is any data

Thanks,
M

Alexander Taylor

unread,
Jul 15, 2015, 12:17:01 PM7/15/15
to kivy-...@googlegroups.com, mehme...@gmail.com
Set it to [], not ListProperty([]). You're trying to instantiate a new listproperty, but actually passing this as a setter argument to the old one, which promptly fails because ListProperty is indeed not iterable.

Mehmet Yilmaz Codes

unread,
Jul 15, 2015, 4:11:53 PM7/15/15
to kivy-...@googlegroups.com, mehme...@gmail.com
Excellent, thanks!
Reply all
Reply to author
Forward
0 new messages