#20 atom cache has no public interface

closed-fixed
nobody
None
5
2007-03-17
2006-09-18
Nick Welch
No

get_atom is implemented for _BaseDisplay but is not
available on Display. One can get at it by doing
.display.get_atom(...), but this is an undocumented hack.

Adding it is as simple as adding the following to Display:

def get_atom(self, name):
....return self.display.get_atom(name)

Discussion

  • Mike Grant
    Mike Grant
    2006-11-22

    Logged In: YES
    user_id=1175208
    Originator: NO

    This seems like a reasonable thing to add if it fits with the philosophy of the project (thin layer or some padding?) - any opinions from others?

    Looking over the code quickly, I don't see any risk of caching problems by doing this.

    Sidenote: one can always get the atom without caching using intern_atom(), in case some other reader doesn't know about that.

     
  • Logged In: YES
    user_id=68375
    Originator: NO

    intern_atom() is the proper interface in X11R6, the cache is merely a performance improvement. But I can concede that the standard name is somewhat obscure (but exists in e.g. lisp and python with similar meaning) and a get_atom() alias wouldn't degrade anything.

     
  • Mike Grant
    Mike Grant
    2007-03-17

    • status: open --> closed-fixed
     
  • Mike Grant
    Mike Grant
    2007-03-17

    Logged In: YES
    user_id=1175208
    Originator: NO

    Alias added to Display class (and a little tweaking on the caching) - in CVS now.