mirror of https://github.com/swig/swig.git
These are the .pyi stub file equivalents of %pythoncode and %pythonbegin, for adding Python code to the stub file generated by the -pyi and -pyifile options. They do nothing unless a stub file is being generated. %pythonstubcode inserts the code at the point the directive appears, indenting it into the class body when used inside a class. %pythonstubbegin inserts the code just after the SWIG banner, before any real code. The stub file is generated independently of the .py file, so code added with %pythoncode or %pythonbegin does not appear in it. Classes configured with %pythonabc use names from collections.abc as generated base classes and pyabc.i imports this module into the .py file, but a separately generated stub had no import, leaving its base class unresolved. Add the equivalent %pythonstubcode block to pyabc.i. Extend the python_pyi test with a collections.abc base class and blocks exercising both new directives. See #3473. Assisted-by: Claude Code (Opus 5) |
||
|---|---|---|
| .. | ||
| Makefile.in | ||
| README | ||
| argcargv.i | ||
| attribute.i | ||
| boost_shared_ptr.i | ||
| builtin.swg | ||
| carrays.i | ||
| ccomplex.i | ||
| cmalloc.i | ||
| complex.i | ||
| cpointer.i | ||
| cstring.i | ||
| cwstring.i | ||
| director.swg | ||
| director_py_mutex.swg | ||
| exception.i | ||
| factory.i | ||
| file.i | ||
| implicit.i | ||
| pyabc.i | ||
| pyapi.swg | ||
| pybackward.swg | ||
| pybuffer.i | ||
| pyclasses.swg | ||
| pycomplex.swg | ||
| pycontainer.swg | ||
| pydocs.swg | ||
| pyerrors.swg | ||
| pyfragments.swg | ||
| pyhead.swg | ||
| pyinit.swg | ||
| pyiterators.swg | ||
| pymacros.swg | ||
| pyopers.swg | ||
| pyprimtypes.swg | ||
| pyrun.swg | ||
| pyruntime.swg | ||
| pystdcommon.swg | ||
| pystrings.swg | ||
| python.swg | ||
| pythonkw.swg | ||
| pythreads.swg | ||
| pytypemaps.swg | ||
| pytyping.swg | ||
| pyuserdir.swg | ||
| pywstrings.swg | ||
| std_alloc.i | ||
| std_array.i | ||
| std_auto_ptr.i | ||
| std_basic_string.i | ||
| std_char_traits.i | ||
| std_common.i | ||
| std_complex.i | ||
| std_container.i | ||
| std_deque.i | ||
| std_except.i | ||
| std_filesystem.i | ||
| std_ios.i | ||
| std_iostream.i | ||
| std_list.i | ||
| std_map.i | ||
| std_multimap.i | ||
| std_multiset.i | ||
| std_pair.i | ||
| std_set.i | ||
| std_shared_ptr.i | ||
| std_sstream.i | ||
| std_streambuf.i | ||
| std_string.i | ||
| std_string_view.i | ||
| std_unique_ptr.i | ||
| std_unordered_map.i | ||
| std_unordered_multimap.i | ||
| std_unordered_multiset.i | ||
| std_unordered_set.i | ||
| std_vector.i | ||
| std_vectora.i | ||
| std_wios.i | ||
| std_wiostream.i | ||
| std_wsstream.i | ||
| std_wstreambuf.i | ||
| std_wstring.i | ||
| stl.i | ||
| swigmove.i | ||
| typemaps.i | ||
| wchar.i | ||
README
/* ----------------------------------------------------------------------------- * * User interfaces: include these ones as needed * * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * Special types and user helpers * ----------------------------------------------------------------------------- */ argcargv.i Handler for (int argc, char **argv) attribute.i Convert a pair of set/get methods into a "native" python attribute ccomplex.i C99 complex type complex.i C99 or C++ complex type cstring.i Various forms of C character string handling cwstring.i Various forms of C wchar_t string handling embed.i embedding the Python interpreter in something else file.i FILE C type implicit.i Allow the use of implicit C++ constructors wchar.i wchar_t C type /* ----------------------------------------------------------------------------- * C++ STD + STL * ----------------------------------------------------------------------------- */ std_alloc.i allocator std_basic_string.i basic string std_char_traits.i char traits std_complex.i complex std_deque.i deque std_except.i exceptions std_ios.i ios std_iostream.i istream/ostream std_list.i list std_map.i map std_multimap.i multimap std_multiset.i multiset std_pair.i pair std_set.i set std_sstream.i string stream std_streambuf.i streambuf std_string.i string std_vector.i vector std_wios.i wios std_wiostream.i wistream/wostream std_wsstream.i wstring stream std_wstreambuf.i wstreambuf std_wstring.i wstring /* ----------------------------------------------------------------------------- /* * Implementation files: don't look at them unless you are really drunk * * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * Basic files * ----------------------------------------------------------------------------- */ python.swg Main language file, it just includes what is needed. pyuserdir.swg User visible directives (%pythonnondynamic, etc) pymacros.swg Internal macros used for typemaps pyfragments.swg Allow the user to overload the default fragments pyopers.swg Python operations (+=, *=, etc) pythonkw.swg Python keywords and special names pyinit.swg Python Init method /* ----------------------------------------------------------------------------- * The runtime part * ----------------------------------------------------------------------------- */ pyruntime.swg Main runtime file definition pyapi.swg SWIG/Python API declarations pyrun.swg Python run-time code /* ----------------------------------------------------------------------------- * Internal typemap specializations * ----------------------------------------------------------------------------- */ pyswigtype.swg SWIGTYPE pystrings.swg Char strings (char *) pywstrings.swg Wchar Strings (wchar_t *) pyprimtypes.swg Primitive types (shot,int,double,etc) pycomplex.swg PyComplex and helper for C/C++ complex types pydocs.swg Typemaps documentation pytyping.swg PEP 484 type hints /* ----------------------------------------------------------------------------- * C++ STD + STL * ----------------------------------------------------------------------------- */ pycontainer.swg python container iterators std_common.i general common code for the STD/STL implementation std_container.i general common code for the STD/STL containers /*----------------------------------------------------------------------------- * Backward compatibility and deprecated * ----------------------------------------------------------------------------- */ std_vectora.i vector + allocator (allocators are now supported in STD/STL) typemaps.i old in/out typemaps (doesn't need to be included)