Expose RID.is_null() to scripting#107141
Expose RID.is_null() to scripting#107141aaronfranke wants to merge 1 commit intogodotengine:masterfrom
RID.is_null() to scripting#107141Conversation
|
I'm not sure we need both. I suppose it comes down to if we ever expect there to emerge an actual implementation difference in the future. If not, we shouldn't expose both, and in my opinion, even consider removing one of the two functions altogether. |
|
@Ivorforce I'm fine with not having both if that's the consensus, but only if the internal one is removed too. The internal and external APIs should match for trivial things like this. |
|
I'm in favor of binding this, it's far clearer and the exposed API should match IMO |
e1af4be to
74f385a
Compare
Mickeon
left a comment
There was a problem hiding this comment.
If C++ normally supported not there would be no discussion, but alas. Doc is fine
RID.is_null() to scripting
|
Makes sense for the sake of GDExtension and C++ modules compatibility. |
Ivorforce
left a comment
There was a problem hiding this comment.
As I said above, I'm not at all convinced we should expose the same functionality twice.
If it's alright with everyone, I'd like to discuss this at the core meeting next Wednesday.
Yes, let's discuss. We definitely shouldn't be exposing an API "for consistency" with an internal API when we don't even have consensus on the internal API |
|
In C# Rid is a separate wrapper and I agree |
|
If one is kept, I agree that |
|
For |
74f385a to
51a0dcc
Compare
51a0dcc to
79dc52a
Compare
79dc52a to
bcdbc86
Compare
bcdbc86 to
7205fbe
Compare
7205fbe to
e243ab3
Compare
e243ab3 to
1dd203f
Compare
1dd203f to
8b93eb6
Compare
I was working on some C++ code and trying to make it compatible with both in-engine module code and GDExtension C++ godot-cpp, and I found that the code uses
.is_null()on an RID, which works in-engine (used 390 times), but not in GDExtension because the API is not exposed. This PR exposes it. Regardless of this PR, a workaround that is compatible with the currently released godot-cpp API is to use!with.is_valid()on an RID instead of.is_null().