Commit Graph

525 Commits

Author SHA1 Message Date
rdb fdcfaf69b0 interrogate: Optimizate creating Python wrapper instances
Fewer function pointer calls by moving the wrapper creation logic to the downcast function

This also paves the way for some classes to have custom wrapper creation logic
2022-12-15 20:25:48 +01:00
rdb a5610f217e Merge branch 'release/1.10.x' into incoming 2022-11-29 20:58:51 +01:00
rdb 5aad1d8404 interrogate: Change error message to mention interrogate
This makes it more obvious that the error is coming from interrogate when encountering a parse error in a build log
2022-11-29 20:14:33 +01:00
rdb e09f78b987 interrogate: Do not consider `make()` with explicit kwargs for coercion
Unless this parameter has a default value
2022-11-07 18:05:34 +01:00
rdb 68111b2c42 Merge branch 'release/1.10.x' 2022-11-07 18:05:03 +01:00
rdb 11746457ff interrogate: Fix invalid syntax for `make()` coerce ctor with kwargs
[skip ci]
2022-11-07 18:03:41 +01:00
rdb 7f707de384 interrogate: rename `operator [] =` to `operator []=` 2022-10-24 13:24:30 +02:00
rdb a28b641bf3 interrogatedb: Indicate whether types/function wrappers are deprecated 2022-10-24 13:24:20 +02:00
rdb 61ff260ee3 Merge branch 'release/1.10.x' 2022-10-20 20:59:45 +02:00
rdb bb8b08a690 interrogatedb: Add `interrogate_wrapper_is_extension()` function 2022-10-20 10:09:45 +02:00
rdb 834be5c7a0 interrogate: Fix some badly formatted code 2022-10-10 15:10:53 +02:00
rdb e6036b5209 interrogatedb: More queries for function wrappers:
- `interrogate_wrapper_function(wrapper)`
- `interrogate_wrapper_is_copy_constructor(wrapper)`
- `interrogate_wrapper_is_coerce_constructor(wrapper)`
2022-10-10 15:09:28 +02:00
rdb ecf4d19e83 Merge branch 'release/1.10.x' 2022-05-10 16:12:36 +02:00
rdb 3d55945535 interrogatedb: Add new functions to interrogate_interface.h:
- `interrogate_function_is_constructor()`
- `interrogate_function_is_destructor()`
- `interrogate_wrapper_parameter_is_optional()`
- `interrogate_wrapper_parameter_is_scoped_enum()`
- `interrogate_wrapper_parameter_is_final()`

Only `interrogate_wrapper_parameter_is_optional()` requires a rebuild of the database with the new changes.
2022-05-10 15:58:34 +02:00
rdb 6ab6acfbaf interrogate: Do not write wrappers taking rvalue reference to interrogatedb
These are not actually exported by the Python binding generator anyway
2022-05-10 15:58:34 +02:00
rdb 657a8f890c interrogate: Squelch weird "Manifests" output from interrogate_module 2022-03-09 16:23:37 +01:00
rdb a0be50c769 general: Fix assorted compiler warnings 2022-03-01 16:09:07 +01:00
rdb 21377c8de5 Use secure versions of CRT getenv etc. when compiling with MSVC 2022-03-01 16:09:07 +01:00
rdb a354b774b3 interrogate: Add __reduce_ex__ to methods that shouldn't be renamed 2021-12-14 11:31:37 +01:00
rdb 98054d1bbd interrogate: Support reverse binary operators as extension methods
Necessary for implementing #1048
2021-07-05 14:12:39 +02:00
rdb 18e8918138 interrogate: Reimplement subscript assignment "operator"
This redoes the handling of `obj[n] = item` to occur in InterrogateBuilder instead so that it doesn't prevent the same remap from being used as getitem.

This fixes the non-const variant of InstanceList[n].
2021-04-25 11:27:18 +02:00
rdb e4ecb548bf interrogate: Use __bool__ for default name of operator bool 2021-03-09 19:33:50 +01:00
rdb 179f316b36 interrogate: Wrap anonymous parameter names as positional-only args 2021-03-01 19:33:43 +01:00
rdb f6b1b6dbb0 interrogate: Support three-way comparison operator <=> 2021-03-01 19:33:35 +01:00
rdb 684992cf8f cppparser: C++20 features: spaceship operator, char8_t, constinit/eval 2021-03-01 19:33:31 +01:00
rdb 8cbe36b352 Merge branch 'release/1.10.x' 2021-03-01 19:33:27 +01:00
rdb eab1308438 interrogate: Fix bug sorting overloads of AsyncFuture::set_result() 2021-03-01 10:59:02 +01:00
rdb 5ae08eadf7 Merge branch 'release/1.10.x' 2021-02-22 19:38:49 +01:00
rdb 7ed9f573e7 interrogate: Map operator / to true divide unless it takes an int
This is a little less conservative than the previous behaviour of only mapping if it takes a float, but this behaviour is more intuitive for non-scalar operands such as for Filename's operator /.
2021-02-22 19:14:18 +01:00
rdb 601ca323f5 interrogate: Support __truediv__, __floordiv__, etc. special methods 2021-02-22 18:13:34 +01:00
rdb 613441060b Merge branch 'release/1.10.x' 2021-01-18 23:47:36 +01:00
rdb 0b53355347 interrogate: respect SOURCE_DATE_EPOCH setting for file identifiers
This can be used to ensure that the build is bit-for-bit reproducible.

See https://reproducible-builds.org/docs/source-date-epoch/
2021-01-18 02:34:16 +01:00
rdb e099d9e787 Merge branch 'release/1.10.x' 2021-01-02 02:33:35 +01:00
rdb 99f9352e76 interrogate: improvements to __setstate__ handling:
* Force single arg variant, easing argument parsing
* Allow defining __setstate__ taking multiple args, leading to tuple unpack
* Allow __setstate__ to be called on already initialized object (useful with __reduce__)
2021-01-01 15:57:41 +01:00
rdb 3e1d4aa6b5 interrogate: Fix memory leak in __setstate__ 2020-12-31 18:12:52 +01:00
rdb 1793c9a938 interrogate: Fix __setstate__ not working for subclasses 2020-12-31 18:11:50 +01:00
rdb a6e6826939 interrogate: support __getstate__ and __setstate__
The latter in particular will be called instead of __init__, so must construct the object.
2020-11-17 22:35:25 +01:00
rdb c788912070 Merge branch 'release/1.10.x' 2020-10-02 12:20:58 +02:00
rdb 5655e97ec1 interrogate: fix misbehaving == and != operator if only < is defined
Fixes comparison of two empty RenderEffects objects
2020-09-16 23:21:16 +02:00
rdb 66ac3be604 Merge branch 'release/1.10.x' into master 2020-09-12 23:23:58 +02:00
rdb dabab90415 interrogate: Fix compilation error of bindings with Python 3.9+ 2020-09-12 22:50:03 +02:00
rdb 707ea089cb Merge remote-tracking branch 'origin/release/1.10.x' 2020-09-01 11:09:29 +02:00
rdb ab6bf5f4f7 general: Add workaround for Windows bug in various uses of isprint()
See #994; there is a regression in certain versions of the Windows CRT that gives the wrong result for isprint().  This adds workarounds to various potentially affected locations where isprint() is being used.
2020-08-21 14:51:42 +02:00
rdb a203ff11fc interrogate: support __getstate__ and __setstate__
The latter in particular will be called instead of __init__, so must construct the object.
2020-04-01 18:59:44 +02:00
rdb a34867ae4f interrogate: support __int__ -> nb_int slot mapping 2020-04-01 18:59:44 +02:00
rdb c59b91f503 Merge branch 'release/1.10.x' 2020-02-23 14:53:16 +01:00
rdb 4ef8e5228e interrogate: fix ability to return ReferenceCount-like classes
Classes with virtual ref(), unref() and get_ref_count() methods, like RecorderBase, could not be returned by PT() from methods because they didn't inherit from ReferenceCount.  However, classes do not need to inherit ReferenceCount to be able to be tracked by a PointerTo, and defining an abstract base class with pure virtual ref()/unref()/get_ref_count() is a way to avoid dual inheritance of ReferenceCount.
2020-02-22 12:10:55 +01:00
rdb b272af8bbf Merge branch 'cmake' 2020-01-22 11:20:51 +01:00
pmp-p 8615e25a12 interrogate: use fully qualified module name in PyModule_Create
This is helpful when static linking and explicitly initializing the modules.

Closes #308
2019-12-11 16:49:42 +01:00
Sam Edwards 4556059c90 CMake: Use find_program to detect host tools when cross-compiling
In the future, we should also try to do find_package(Panda3D) to use
the host tools even if Panda3D isn't in a system path.
2019-11-13 15:30:26 -07:00