Skip to content

Does mojo guarantee that the __del__ destructor is always called when a value goes out of scope? #860

Closed Locked Answered by lattner
rarebreed asked this question in Q&A
Discussion options

You must be logged in to vote

We don't have answers to these questions, but I can give you MHO. These aren't "team" or "modular" opinions, just based on my experience of where I guess things will go:

  1. no we will not have an unsafe. I don't think this has played out well for Rust and Swift has a different approach that has worked out much better IMO.
  2. n/a, and it isn't clear to me that we should expose this anyway.
  3. Perhaps, we'll have to see.

Rust made a bunch of very specific an intertwined decisions that Mojo is not making, so while I can see that you're concerned about this, I wouldn't worry much about it.

Python doesn't even have access control (public/private) so we have a lot more fundamental things to work throu…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@rarebreed
Comment options

@lattner
Comment options

Answer selected by rarebreed
@rarebreed
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants