abbi031892 / periscope

Automatically exported from code.google.com/p/periscope
0 stars 0 forks source link

Periscope doesn't check type of input for lang #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.call listSubtitles func
2.insert str in the lang position (second var)

What is the expected output? What do you see instead?
the expected output should be sometihng like ValueError because list is 
expected.
instead it looks like Periscope trying to run on the str and to check if he 
knows the lang for each char.
so if i'm placing 'he' instead of ['he'] i'm getting this error:

WARNING:root:Ooops, you found a missing language in the config file of OpenSubti
tles: h. Send a bug report to have it added.
WARNING:root:Ooops, you found a missing language in the config file of OpenSubti
tles: e. Send a bug report to have it added.

Original issue reported on code.google.com by zimer...@gmail.com on 17 Apr 2011 at 8:39

GoogleCodeExporter commented 8 years ago
Python is not a strongly typed language, periscope is in Python. I don't think 
that checking types should be in the code. 

If you use the module directly, you're a developer and you can understand that 
you should use a list and not a string or a boolean or an integer, ...

Introducing a type check will only be useful for developers. They will 
understand how to properly call the function and change their calling code 
anyway. I don't think I should add more lines of code to do type-checking.

At least, this is my feeling towards writing Python modules.

Original comment by patrick....@gmail.com on 18 Apr 2011 at 12:05