|
|
|
|
|
by scott_w
420 days ago
|
|
That Python lets you blindly interchange different types for no good reason. It simply doesn’t. Yes, it’s common for Python to be strict for inputs when the types are different. For example, try: Decimal(‘3.0’) / 1.5 You’ll get an error and for good reason. |
|
Or it's like my original example -- the Regex module isn't restricted to r-strings. It happily works with regular strings. Python's general philosophy is to handle input liberally. Even type hinting is an add-on. Now, it doesn't go as far as JavaScript in allowing e.g. "4"+1, but it's still awfully liberal. I just don't see how you can claim otherwise.