Skip to content

added __claim__ and __release__ methods to all TPyDelphiObjects to… #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

ElminsterAU
Copy link

...allow controlling ownership from python. methods return Self to allow chaining

…low controlling ownership from python. methods return Self to allow chaining
@lmbelo
Copy link
Member

lmbelo commented Nov 23, 2021

Can you please describe a use case?

@ElminsterAU
Copy link
Author

claim: you called a function on a delphi object that returned a new object for which you are responsible for freeing it, by claiming it the object will be freed once no more python references exist

release: you created a delphi object in a way that python has ownership, you want to pass that object as a parameter to a call, where called function will then take ownership of that object and you are no longer allowed to just free it yourself at anytime, you can use release to prevent python from automatically freeing the delphi object when the last python reference to it is gone.

@pyscripter
Copy link
Collaborator

Interesting.
Could you please write unit tests and submit it to pyscripter/python4delphi.

@pyscripter
Copy link
Collaborator

pyscripter commented Jul 19, 2022

Wouldn't it be simpler just to make the owned property writable?

pyscripter added a commit to pyscripter/python4delphi that referenced this pull request Dec 29, 2022
__owned__ is now Read-Write property
Copy link
Collaborator

@checkdigits checkdigits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No response from OP.

Rejecting PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy