splinter icon indicating copy to clipboard operation
splinter copied to clipboard

ElementAPI.clear() shadows list.clear() in python 3.3+

Open javascript-error opened this issue 7 years ago • 0 comments

The following code in python <= 3.2 will call ElementAPI.clear():

browser.find_by_css('foobar').clear()

However, in python 3.3 and forward, the built-in list implements a clear() method. ElementList is a subclass of list, and as such the above code will call ElementList.clear().

The following still calls ElementAPI.clear() in all python versions:

browser.find_by_css('foobar').first.clear()

ElementList probably should not subclass list directly.

javascript-error avatar Apr 09 '19 15:04 javascript-error