C
castironpi
'join' in the wrong word for the method in class Thread.
The agent-patient semantics of calling functions can get ambiguous.
It is not a problem of native Pythoners alone. Is it due to lazy
programming, an inability of English (do you have it in other
languages?), or not a problem at all?
th1.join() doesn't mean, 'do something to th1', or even, 'have th1 do
something to itself.' In fact, if anything is doing anything
differently, taking waiting to be doing something different, it's the
caller.
Translating literally,
th1.join() -> join me here, th1.
And,
file1.close() -> close yourself, file1.
But not,
th1.join() -/> join yourself, th1.
Worse,
lock1.wait() -/> wait, lock1. (For what?)
Furthermore, in toolbars:
File -> Open -/> file an open.
and:
File -> Load -/> load a file. (It means, load the computer.)
In English, the placements of identifiers isn't consistent. IOW,
there isn't a syntactic mapping into natural language sentences.
(Though you can do it in Latin, German, Sanskrit, and Russian with
case markers*.) What are the true literals? What's doing what?
th1.join() -> 'be joined by th1'
file1.close()-> 'close file1'
lock1.wait()-> 'getinlinefor lock1'
And of course, 'open' isn't a method of File objects at all. The
closest is, 'be loaded by file1'.
Assuming speakers** of classical computer languages use OVS order--
object-verb-subject***, the most literal transformations are:
th1.bejoinedby()
file1.close()
lock1.getinlinefor().
The mapping of identifiers to English isn't consistent. It takes some
knowledge to read them-- shuffle an English sentence and it changes
meaning.
Functional languages are one long sentence: True.**** Declarative
ones tell a story. ('th1' joins him.) Imperatives command an
impartial audience.
What do the docs say about it?
'''
Thread.join([timeout])
Wait until the thread terminates. This blocks the calling thread until
the thread whose join() method is called terminates - either normally
or through an unhandled exception - or until the optional timeout
occurs.
When the timeout argument is present and not None, it should be a
floating point number specifying a timeout for the operation in
seconds (or fractions thereof). As join() always returns None, you
must call isAlive() after join() to decide whether a timeout happened
- if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will
block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current
thread as that would cause a deadlock. It is also an error to join() a
thread before it has been started and attempts to do so raises the
same exception.
'''
The natural language meaning of 'join' isn't used. Do benevolent
dictators do this? What do malevolent ones call themselves?
*Latin, German, Sanskrit, and Russian can do it. Latin, German,
Sanskrit, and Russian -speakers- can do it.
**It would be interesting to try to learn a language without ever
speaking it.
*** English is SVO, subject-verb-object. French is too, unless the
object is direct: subject- direct-object -verb.
**** The sum of the first three integers in the last two files, sorted
alphabetically, in 'c:\programs'.
The agent-patient semantics of calling functions can get ambiguous.
It is not a problem of native Pythoners alone. Is it due to lazy
programming, an inability of English (do you have it in other
languages?), or not a problem at all?
th1.join() doesn't mean, 'do something to th1', or even, 'have th1 do
something to itself.' In fact, if anything is doing anything
differently, taking waiting to be doing something different, it's the
caller.
Translating literally,
th1.join() -> join me here, th1.
And,
file1.close() -> close yourself, file1.
But not,
th1.join() -/> join yourself, th1.
Worse,
lock1.wait() -/> wait, lock1. (For what?)
Furthermore, in toolbars:
File -> Open -/> file an open.
and:
File -> Load -/> load a file. (It means, load the computer.)
In English, the placements of identifiers isn't consistent. IOW,
there isn't a syntactic mapping into natural language sentences.
(Though you can do it in Latin, German, Sanskrit, and Russian with
case markers*.) What are the true literals? What's doing what?
th1.join() -> 'be joined by th1'
file1.close()-> 'close file1'
lock1.wait()-> 'getinlinefor lock1'
And of course, 'open' isn't a method of File objects at all. The
closest is, 'be loaded by file1'.
Assuming speakers** of classical computer languages use OVS order--
object-verb-subject***, the most literal transformations are:
th1.bejoinedby()
file1.close()
lock1.getinlinefor().
The mapping of identifiers to English isn't consistent. It takes some
knowledge to read them-- shuffle an English sentence and it changes
meaning.
Functional languages are one long sentence: True.**** Declarative
ones tell a story. ('th1' joins him.) Imperatives command an
impartial audience.
What do the docs say about it?
'''
Thread.join([timeout])
Wait until the thread terminates. This blocks the calling thread until
the thread whose join() method is called terminates - either normally
or through an unhandled exception - or until the optional timeout
occurs.
When the timeout argument is present and not None, it should be a
floating point number specifying a timeout for the operation in
seconds (or fractions thereof). As join() always returns None, you
must call isAlive() after join() to decide whether a timeout happened
- if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will
block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current
thread as that would cause a deadlock. It is also an error to join() a
thread before it has been started and attempts to do so raises the
same exception.
'''
The natural language meaning of 'join' isn't used. Do benevolent
dictators do this? What do malevolent ones call themselves?
*Latin, German, Sanskrit, and Russian can do it. Latin, German,
Sanskrit, and Russian -speakers- can do it.
**It would be interesting to try to learn a language without ever
speaking it.
*** English is SVO, subject-verb-object. French is too, unless the
object is direct: subject- direct-object -verb.
**** The sum of the first three integers in the last two files, sorted
alphabetically, in 'c:\programs'.