You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Backport pandas-dev#14695] BUG: Fix move_into_mutable_buffer for python 3.6.
In python 3.6, the CALL_FUNCTION handling was updated. One change is
that when calling a C function from a python function python now
counts the reference owned by the argument tuple. This means that
move was always seeing objects with two references instead of the
expected one. Python 3.6 also removed a copy in the argument tuple
when *unpacking functions. This means that if a user does: tuple =
(create_string(),) move_into_mutable_buffer(*tuple) where
create_string() creates a string object with one reference then we
will fail to raise a BadMove even though the user could later retrieve
that string with tuple[0]. There is no way to detect this case so this
patch adds a warning to the docstring advising against star unpacking.
xref: pandas-dev#14679 I played around with removing the extra reference that
was added in 3.6 but it looks like playing with borrowed refs
everywhere will be a bit tricky. This change should clear things up
for 3.6 while continuing to work for older versions. In 3.6 you
__could__ get a shared mutable string from this but you need to try
pretty hard for it.
Author: Joe Jevnik <[email protected]>
Closespandas-dev#14695 from llllllllll/move-3.6-compat and squashes the following commits:
d1e8b1b [Joe Jevnik] BUG: Fix move_into_mutable_buffer for python 3.6.
(cherry picked from commit f609640)
0 commit comments