◐ Shell
clean mode source ↗

Issue 11081: from struct import * misses pack_into

the following issue was introduced in r81947:

>>> from struct import *
>>> pack_into
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    pack_into
NameError: name 'pack_into' is not defined

struct.__all__ has a duplicate entry for "unpack" and misses "pack_into".

Patch is attached, test passes. Seems quite innocent to me, could it make into 3.2, George?

Related: #8973 and #11078
I would say if anything can go in after rc2 at all, this should be accepted.  George?

I ran a few sanity checks with the patch applied:

>>> set(struct.__all__) - set(dir(struct))
set()
>>> set(dir(struct)) - set(struct.__all__)
{'_clearcache', '__all__', '__builtins__', '__file__', '__package__', '__cached__', '__name__', '__doc__'}
>>> len(set(struct.__all__)) == len(struct.__all__)
True

LGTM.  Maybe one of the tests above can be converted to a unit test.