Pyplusplus

Latest version: v1.8.5

Safety actively analyzes 613460 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

1.7

-----------

1. Update due to changes in pygccxml 1.8.0.

2. Performance improvements.

3. Small documentation fixes.

-----------

1.6

-----------

1. Reorganize documentation, switch to readthedocs theme.

2. Misc. small fixes.

-----------

1.1

-----------

1. Added support for Python 3.

2. Added support for pygccxml 1.7 and castxml.

3. Switched to setuptools instead of distutils.

--------------------------

1.0.1

--------------------------

1. The bug related to exposing free operators was fixed. Many thanks to Andrei Vermel.

2. Few bugs were fixed for 64Bit platform. Many thanks to Carsten.

3. :mod:`ctypes` backend was introduced - :doc:`Py++ <index>` is able to
generate Python code, which uses :mod:`ctypes` package to call functions in
DLLs or shared libraries.

Massive refactoring, which preserve backward compatibility to previous releases,
was done.

4. From now on, :doc:`Py++ <index>` will use `Sphinx <http://sphinx.pocoo.org/>`_
for all documentation.

5. :doc:`Indexing Suite V2 <indexing_suite_v2.html>` introduces
few backward compatibility changes. The indexing suite became "headers only"
library and doesn't requier Boost.Python library patching.
See ":doc:`containers`" document for more information.

6. Support for `std::hash_map<...>` and `std::hash_set<...>` containers was added.

7. The bug related to transformed virtual function was fixed. Many thanks to Pertti Kellomäki.

8. Thanks to Benoît Leveau, the "Function Transformation" documentation
is much better now.

9. The following transformers were added:

* ``inout_static_array``
* ``input_static_matrix``
* ``output_static_matrix``
* ``inout_static_matrix``

Many thanks to Benoît Leveau.

10. Numerous bugs in "ctypes code generator" were fixed. Many thanks to Nikolaus Rath.

11. Thanks to Alan Birtles, for fixing a small issue on cygwin.

12. Thanks to Minh-Tri Pham, for reporting bug and providing patch for
"from_address" transformer, on 64 bit platforms.

13. Thanks to Aron Xu, for pointing out that it is better to use "os.name",
instead of "sys.platform" for platform specific logic

14. Thanks to Scott Sturdivant, for reporting the bug, related to bit fields code generation.
The bug was fixed.

-----------

1.0

-----------

1. The algorithm, which calculates what member functions should be redefined in
derived class wrappers, was improved. Many thanks to Julian Scheid for the bug
fix.

The change explanation.

.. code-block:: c++

struct A{
virtual void foo() {}
};

class B: public A{
};

Previous version of :doc:`Py++ <index>` didn't generate wrapper for class ``B``, even
though ``B`` inherits ``A``'s virtual function. Now if you have the following
Python code:

.. code-block:: python

class C(B):
def __init__( self ):
B.__init__(self)
def foo(self):
print "C.foo"

then when ``foo`` is invoked on this instance on the C++ side of things, the
Python code won't be executed as the wrapper was missing.

**Warning!** **There is a possibility that your generated code will not work!**
**Keep reading.**

If you use "function transformation" functionality, than it is possible the
generated code will **NOT** work. Consider the following example:

.. code-block:: c++

struct A{
virtual void foo(int& i) {/*do smth*/}
};

class B: public A{
virtual void foo(int& i) {/*do smth else*/}
};

The :doc:`Py++ <index>` code:

.. code-block:: python

from pyplusplus import module_builder
from pyplusplus import function_transformers as FT

mb = module_builder_t( ... )
foo = mb.member_functions( 'foo' )
foo.add_transformation( FT.output(0) )

The generated code, for class ``B``, is:

.. code-block:: c++

namespace bp = boost::python;

struct B_wrapper : B, bp::wrapper< B > {
virtual void foo( int & i ) const { ... }

static boost::python::tuple default_foo( ::B const & inst )
{ ... }

virtual void foo( int & i ) const
{ ... }

static boost::python::object default_foo( ::A const & inst )
{ ... }
};
...
bp::class_< B_wrapper, bp::bases< A > >( "B" )
.def( "foo", (boost::python::tuple (*)( ::B const & ))( &B_wrapper::default_foo ) )
.def( "foo", (boost::python::object (*)( ::A const & ))( &B_wrapper::default_foo ) );

As you can see, after applying the transformation both functions have same
signature. Do you know what function will be called in some situation? I do -
the wrong one :-(.

Unfortunately, there is no easy work around or some trick that you can use,
which will not break the existing code. I see few solutions to the problem:

* change the alias of the functions

.. code-block:: python

from pyplusplus import module_builder
from pyplusplus import function_transformers as FT

mb = module_builder_t( ... )
foo = mb.member_functions( '::A::foo' ).add_transformation( FT.output(0), alias="foo_a" )
foo = mb.member_functions( '::B::foo' ).add_transformation( FT.output(0), alias="foo_b" )

* use ``inout`` transformation - it preserves a function signature

* :doc:`Py++ <index>` can introduce a configuration, that will preserve the previous behaviour.
I think this is a wrong way to go and doing the API changes is the 'right'
longer term solution.

If you **absolutely need** to preserve API backward compatible, contact me
and I will introduce such configuration option.

Sorry for inconvenience.

2. Few bugs, related to Indexing Suite 2, were fixed. Many thanks to Oliver Schweitzer
for reporting them.

3. New and highly experimental feature was introduced -
:doc:`Boost.Python and ctypes integration <ctypes/ctypes_integration>`.

4. Support for :doc:`boost::python::make_constructor <functions/make_constructor>` functionality was added.

5. Support for unions and unnamed classes was added.

6. Doxygen documentation extractor was improved. Many thanks to Hernán Ordiales.

7. Py++ documentation was improved. Many thanks to Bernd Fritzke.

-------------

0.9.5

-------------

1. Bug fixes:

* Py++ will not expose free operators, if at least one of the classes, it works
on, is not exposed.
Many thanks to Meghana Haridev for reporting the bug.

2. Added ability to completely disable warnings reporting.

3. All logging is now done to ``stderr`` instead of ``stdout``.

4. Generated code improvements:

* ``default_call_policies`` is not generated

* ``return_internal_reference`` call policies - default arguments are not
generated

* STD containers are generated without default arguments. For example instead
of ``std::vector< int, std::allocator< int > >``, in many cases :doc:`Py++ <index>` will
generate ``std::vector< int >``.

5. :doc:`create_with_signature <functions/overloading>` algorithm was improved.
:doc:`Py++ <index>` will generate correct code in one more use case.

6. Added ability to exclude declarations from being exposed, if they will cause
compilation to fail.

7. Starting from this version, :doc:`Py++ <index>` provides a complete solution for
:doc:`multi-module development <multi_module_development>`.

8. Classes, which expose C arrays will be registered only once.

9. Starting from this version, :doc:`Py++ <index>` supports a code generation with different
encodings.

10. There is a new strategy to split code into files. It is IDE friendly. Be sure
to read :doc:`the updated documentation <split_module>`.

-------------

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.