From b9c9b9f7b4b8825b62219c5e74858e485780803e Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Thu, 25 Jan 2007 15:22:43 -0700 Subject: [PATCH] add warning of subtle gotcha that can happen with mutable data buffers --- pyfec/fec/fecmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfec/fec/fecmodule.c b/pyfec/fec/fecmodule.c index 9b268a40..053fc26b 100644 --- a/pyfec/fec/fecmodule.c +++ b/pyfec/fec/fecmodule.c @@ -86,7 +86,7 @@ static char Encoder_encode__doc__[] = "\ Encode data into m packets.\ @param inshares: a sequence of k buffers of data to encode -- these are the k primary shares, i.e. the input data split into k pieces (for best performance, make it a tuple instead of a list)\n\ @param desired_shares_ids optional sorted sequence of shareids indicating which shares to produce and return; If None, all m shares will be returned (in order). (For best performance, make it a tuple instead of a list.)\n\ -@returns: a list of buffers containing the requested shares\n\ +@returns: a list of buffers containing the requested shares; Note that if any of the input shares were 'primary shares', i.e. their shareid was < k, then the result sequence will contain a Python reference to the same Python object as was passed in. As long as the Python object in question is immutable (i.e. a string) then you don't have to think about this detail, but if it is mutable (i.e. an array), then you have to be aware that if you subsequently mutate the contents of that object then that will also change the contents of the sequence that was returned from this call to encode().\n\ "; static PyObject * -- 2.45.2