Python is DOOMED! Again!
rantingrickjohnson at gmail.com
Tue Jan 27 02:10:18 CET 2015
On Monday, January 26, 2015 at 6:12:00 PM UTC-6, Steven D'Aprano wrote:
> 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.
Funny how your example logically leads to the solution of
your own "partisan problem".
At an early stage in the design process, most wise designers
would realize that: since stub files are optional, and
therefore searching for stub files *EVERY TIME* Python is
reading a script is superfluous, then the solution is to
require a declaration in every file that wants typehinting.
In other words, put the onerous on the "typehint author" by
requiring a "typehint declaration" at the top of every file
that has a corresponding typehints stub.
Of course, there are much better alternatives than to
introduce *another* keyword. Shebangs, strings, whatever....
So don't take my example too literally!
> But, when the first-rate solution cannot be used, a
> second-rate solution is better than nothing.
Your synthetic "first rate vs second rate" dichotomy is
nothing more than a highly subjective and one sided
interpretation meant to paint the opposition as wrong without
offering any real evidence of "wrongfulness". Are you
attempting to polarize this issue? And if you are, what
possible good could come from injecting emotion into a
To find truths one must remain open to new ideas, *only*
follow logical paths, and *defiantly* reject the corrupting
influence of emotion. Does impartiality mean *anything* to
you? Have you ever wondered why lady justice wears a
More information about the Python-list