Hi Istvan,
this behavior is specific to classes that undergo a transformation  
when unpickled, like SourceURL, and could be easily changed if you can  
define what you want.  Pygr.Data caches objects saved or loaded by  
it.  That means that requesting a given ID that was previously saved  
or loaded will simply return the same object as was previously saved  
or loaded, without actually doing anything to get it -- because it  
already has it in cache.  SourceURL will only download the target data  
when it is unpickled; retrieving the SourceURL object from cache will  
not do that.  Forcing a reload of the pygr.Data module gives you a  
clean copy of the module with an empty cache, so now requesting the ID  
will trigger unpickling of the SourceURL and therefore downloading.

In a nutshell, you're hitting a clash between two behaviors:
- pygr.Data caches objects within a session;
- SourceURL undergoes a transformation when unpickled, so getting it  
back from cache is not the same thing as loading (unpickling) it.

The only question is what behavior you want.  Why would anyone want to  
save an object to pygr.Data only to immediately ask for it back  
again?  This seems more like test-code, rather than a real-world usage  
case...

-- Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to