News for hackers. Stuff that matters.
Re:Type hinting for Python by Animats on Tuesday January 06, 2015 @02:52PM (#8846511)
Who modded that down? He has a good point. This is a bad idea. In particular, "Python's static type-checking would be optional - programs can still be run even if the static checker has complaints." is a really bad idea. It means the type annotations can't be used for optimizations. Or we'll have code that only runs with optimization turned off, or on some compilers.
Re:Type hinting for Python by minthd on Tuesday January 06, 2015 @03:56PM (#8847085)
What if:

1. The default will be dynamic typing. But you can change that.

2. You can specify a specific module you release as static. This will only affect the internal parts of the module, with one exception - when you call something of that module with the wrong type, you'll get a warning "this runs XX times slower because of a wrong type, change..." , but when you run it with the right type, you'll get great speedup ?

Re:Type hinting for Python by minthd on Tuesday January 06, 2015 @03:21PM (#8846699)
What if:

1. The default will be dynamic typing. But you can change that.

2. You can specify a specific module you release as static. This will only affect the internal parts of the module, with one exception - when you call something of that module with the wrong type, you'll get a runtime type exception, so there's no problem working with dynamic code with a fast module.

Re:Type hinting for Python by minthd on Tuesday January 06, 2015 @03:35PM (#8846917)
What if:

1. The default will be dynamic typing. But you can change that.

2. You can specify a specific module you release as static. This will only affect the internal parts of the module, with one exception - when you call something of that module with the wrong type, you'll get a warning "this runs XX times slower because of a wrong type, change..." , but when you run it with the right type, you'll get great speedup ?

Re:Type hinting for Python by minthd on Tuesday January 06, 2015 @03:18PM (#8846666)
What if:

1. The default will be dynamic typing. But you can change that.

2. You can specify a specific module you release as static. This will only affect the internal parts of the module, with one exception - when you call something of that module with the wrong type, you'll get a runtime type exception, so there's no problem working with dynamic code with a fast module.

Re:Type hinting for Python by minthd on Tuesday January 06, 2015 @03:17PM (#8846664)
What if:

1. The default will be dynamic typing. But you can change that.

2. You can specify a specific module you release as static. This will only affect the internal parts of the module, with one exception - when you call something of that module with the wrong type, you'll get a runtime type exception, so there's no problem working with dynamic code with a fast module.