Selecting objects... what do turquoise dots mean?

This might be a general question, but its related to a python problem of mine, so I’ll post it here:
In Object Mode, selected objects are usually marked with a pink dot that represents their pivot. I have a rather large python script that creates objects during execution and relies on querying which objects are selected later on.

My problem is that while this initially worked fine, somewhere along the line, I must have introduced code that does something wrong, and I can’t figure out where to look for it. The objects my script creates have blue-ish/turquoise dots instead of the pink ones when I select them, and querying whether they’re selected always returns false (the_object.sel is always 0 and Blender.Object.GetSelected() doesn’t list them).

Any hints what those turquoise dots might indicate? Something like reference objects instead of unique objects or some such thing?

This is an evil python API problem we need to fix!

Objects with more then 1 user are drawn turquoise, so this is meant to mean if an object is in 2 scenes you can tell by the fact its blue.

BUT- at the moment the blender python Obs also add a user, your script must somehow not deallocate the python users.

It would be nice to have a test-case script that does this since I have the same problem for a script thats ~4000 lines and too tricky to debug.

Though I think the real solution is to stop python types being object users. (this is done to stop objects from being de-allocated from memory when they have 0 users but are still referenced from Python)

Thanks very much for the explanation, it sounds like it touches on the root of my problem.
I’m a bit unclear though on what you refer to when you say “user” - are you saying that turquoise objects indicate that they are referenced by more than one python variable? Or are you saying that a python user is created upon a call to Blender.Object.New() and my problem is that the garbage collector isn’t removing it as it should (which is entirely possible - I have a lot of circular references which could probably cause this problem)? Any links to further documentation of this issue?

yep, blenders users are used for its garbage collector. the only thing that should use a blender object is a scene of a fake user. python does but I believe this wasnt a good design decision, not sure who made it. it does fix some problems but creates others.