'result([msgid=RES_ANY [,all=1 [,timeout=None]]]) -> (result_type, result_data)
This method is used to wait for and return the result of an
operation previously initiated by one of the LDAP asynchronous
operation routines (eg search(), modify(), etc.) They all
returned an invocation identifier (a message id) upon successful
initiation of their operation. This id is guaranteed to be
unique across an LDAP session, and can be used to request the
result of a specific operation via the msgid parameter of the
result() method.
If the result of a specific operation is required, msgid should
be set to the invocation message id returned when the operation
was initiated; otherwise RES_ANY should be supplied.
The all parameter only has meaning for search() responses
and is used to select whether a single entry of the search
response should be returned, or to wait for all the results
of the search before returning.
A search response is made up of zero or more search entries
followed by a search result. If all is 0, search entries will
be returned one at a time as they come in, via separate calls
to result(). If all is 1, the search response will be returned
in its entirety, i.e. after all entries and the final search
result have been received.
For all set to 0, result tuples
trickle in (with the same message id), and with the result type
RES_SEARCH_ENTRY, until the final result which has a result
type of RES_SEARCH_RESULT and a (usually) empty data field.
When all is set to 1, only one result is returned, with a
result type of RES_SEARCH_RESULT, and all the result tuples
listed in the data field.
The method returns a tuple of the form (result_type,
result_data).  The result_type is one of the constants RES_*.
See search() for a description of the search result\'s
result_data, otherwise the result_data is normally meaningless.
The result() method will block for timeout seconds, or
indefinitely if timeout is negative.  A timeout of 0 will effect
a poll. The timeout can be expressed as a floating-point value.
If timeout is None the default in self.timeout is used.
If a timeout occurs, a TIMEOUT exception is raised, unless
polling (timeout = 0), in which case (None, None) is returned.'

def result(self, msgid=ldap.RES_ANY, all=1, timeout=None):

    (res_type, res_data, res_msgid) = self.result2(msgid, all, timeout)
    return (res_type, res_data)
