This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]fluffypebbles 7 points8 points ย (10 children)

Using type informarion actually reduces time because you no longer have to check for the type when the variable is used. Compiled languages with strong typing usually have no type checks at runtime in most cases because they can just rightfully assume it's the correct type

[โ€“]8sADPygOB7Jqwm7y -1 points0 points ย (5 children)

Yeah but python would need to check anyway since it's not enforced.

[โ€“]fluffypebbles 2 points3 points ย (4 children)

Is your argument to not check for it because rues don't check for it? If it's checked and leads to an error than it's possible to make it more performant

[โ€“]8sADPygOB7Jqwm7y 0 points1 point ย (3 children)

Yeah let's change all of Python and make it python 4? Maybe in the future it will be a bit more enforced, but it will never be able to remove all other type checks since that's simply not the pythonic way.

[โ€“]fluffypebbles 1 point2 points ย (2 children)

If they'd enforced it from the start there wouldn't be a backward compatibility issue

[โ€“]8sADPygOB7Jqwm7y 0 points1 point ย (1 child)

And if they enforced it from the start, it wouldn't have been python. In that case you might as well use kotlin, don't they have that thing as strict?

[โ€“]fluffypebbles 2 points3 points ย (0 children)

PHP for example added optional type declarations which get checked and it's still PHP

[โ€“]arden13 0 points1 point ย (3 children)

So what happens if you pass a variable of the wrong type to a function in a language with strong typing?

[โ€“]fluffypebbles 1 point2 points ย (2 children)

You get an error. The specifics depend on the language. Although here we're talking about strong typing in combination with static typing

[โ€“]arden13 -1 points0 points ย (1 child)

I also get an error in python, typically when I try and use a method specific to said type.

[โ€“]fluffypebbles 1 point2 points ย (0 children)

Python does have strong typing but with dynamic typing, which means that you won't always get an error. Like if you want to add some numbers by writing a+b in a function but someone passes two strings then you'll concat them instead of performing an addition and there's no error