There is no binascii.py
file in the Python standard library. The binascii
module in Python is entirely written in C; it's implemented in the Modules/binascii.c
source file.
When Python is installed on a system, available as a shared library object, so as a .so
or .dll
file in a lib/pythonx.x/lib-dynload
directory somewhere.
What you found instead is a stub file, to aid an IDE in introspection and autocompletion tasks. Such a file is needed because extension modules written in C usually are not introspectable, you can't always use the normal introspection techniques to figure out what arguments a function written in a compiled language will accept.
Note that such files are slowly becoming obsolete as more and more code in the standard library is being converted to using the new argument clinic system, which enables introspection support. The binascii
module has been updated to use the AC syntax starting in Python 3.4, so you could ask the module directly:
>>> import inspect, binascii
>>> inspect.signature(binascii.a2b_base64)
<Signature (data, /)>
The function accepts a single positional-only argument named data
(see Python: What does the slash mean in the output of help(range)? for an explanation for what the /
in the signature means or what positional only means).