Skip to content
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

Must _p_mtime activate a ghost? #26

Closed
tseaver opened this issue May 19, 2015 · 2 comments
Closed

Must _p_mtime activate a ghost? #26

tseaver opened this issue May 19, 2015 · 2 comments
Labels

Comments

@tseaver
Copy link
Member

tseaver commented May 19, 2015

The C implementation does forcibly activate it, while the pure-Python version (until #20) did not.

See: #20

@jamadden
Copy link
Member

Is there any other reliable way to know that an object has definitively been saved at least once, besides the fact that it has a _p_mtime? That's what our code uses it for.

It's a convenience, in that case, that _p_mtime activates the object. If it did not, code like this:

if obj._p_mtime:
   # we've been saved before
else:
   # we're a brand new object, do first-time stuff

has to become:

obj._p_activate()
if obj._p_mtime:
   # ...
...

Could that code be changed everywhere? Sure. Would it be moderately annoying and an easily-missed source of bugs? Sure.

@tseaver
Copy link
Member Author

tseaver commented Aug 10, 2016

I believe the consensus answer is "Yes, _p_mtime must activate the object." I don't know that we every got the rationale documented, but #20 makes it so for pure-Python.

@tseaver tseaver closed this as completed Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants