Speaking Python

David Mertz mertz at gnosis.cx
Mon Oct 13 22:02:37 CEST 2003


In the endless Lisp/macro threads, Alex Martelli mentioned something a
bit interesting about screen-reading applications.  Specifically, he
expressed reservations about whether Python would be a good language for
visually impaired or blind programmers.

The concern, I think, is that pronouncing
'space-space-space-space-space-space-space-space' isn't all that easy to
follow if spoken with every line.  Even a reduced form like
"eight-spaces' isn't perfect either.  Actually, a symmetric concern is
with voice recognition applications--perhaps for people with motor
disabilities.

My feeling is that a good vocal Python programming editor would need to
know a bit about the structure of the language.  Maybe to a greater
degree than would one with explicit delimiters (although I have trouble
imagining blind programmers being all that happy with hearing
'close-paren-close-paren-close-paren-close-paren-close-paren-close-paren'
either).  Perhaps this same hypothetical editor would speak code and
recognize spoken code using the same format.

So quick test, how do you say:

    def range_sum(N):
        if N < 0:
            return None
        elif N == 1:
            return 1
        else:
            tot = 0
            for n in range(1,N+1):
                tot += n
            return tot

It's a stupid function, of course; I just wanted something with a couple
of levels of indents for an example.  There's no need to tell me it's
pronouned 'sum-of-range-of-N-plus-one'.

Yours, David...

--
---[ to our friends at TLAs (spread the word) ]--------------------------
Echelon North Korea Nazi cracking spy smuggle Columbia fissionable Stego
White Water strategic Clinton Delta Force militia TEMPEST Libya Mossad
---[ Postmodern Enterprises <mertz at gnosis.cx> ]--------------------------






More information about the Python-list mailing list