Yes, you're right. I encountered feed items that return an empty string as length. You're also right that the code will not work. I think this is correct way to check-it:

````
((isinstance(link.get('length', 0), basestring) and link.get('length',0).isdigit()) or isinstance(link.get('length', 0), int))
````