Python is DOOMED! Again!

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Jan 27 01:11:45 CET 2015


random832 at fastmail.us wrote:

> On Thu, Jan 22, 2015, at 23:23, Steven D'Aprano wrote:
>> Rick Johnson wrote:
>> 
>> > The solution is move the type
>> > hinting syntax completely out of the source file and into
>> > another file -- think of it as a "Python Type Hinting Header
>> > File".
>> 
>> The 1970s called, they want their bad ideas back.
>> 
>> I can do no better than to quote from the Go FAQs:
>> 
>>     Dependency management is a big part of software development
>>     today but the “header files” of languages in the C tradition
>>     are antithetical to clean dependency analysis—and fast
>>     compilation.
> 
> This is more along the lines of a lint library than a header file

Stub files are a second-rate solution for the problem of annotating
functions where you are unable (or unwilling) to annotate the source code
directly. They suffer from similar problems:

- you have to manage the stub file independently of the source 
  code it belongs with

- type information is about as far away from the variable as it
  is possible to get (a completely different file!)

- lexical analysis has to look for twice as many files (it has to 
  hit the hard drive for a stub file before looking at the source),
  and we know from importing that file system access is a 
  significant and expensive part of the process.

But, when the first-rate solution cannot be used, a second-rate solution is
better than nothing.


> (header files in the 1970s didn't even actually include function
> signature information) - which did not even participate in compilation
> at all.

If C compilers didn't use the header files, what were they for?



-- 
Steven




More information about the Python-list mailing list