def _setNewest(self, item):
        '''
        put a new or retrieved item at the top of the pile
        '''
        item.atime = time()

        if item is self._newest:                        # item is already on top
            return

        if item.nextItem or item.previousItem:          # this item is currently in the pile...
            self._pullout(item)                         # pull it out

        if self._newest:
            self._newest.nextItem = item                # point the previously newest item to this one...
            item.previousItem = self._newest            # and vice versa

        self._newest = item                             # reset the 'newest' pointer

        if not self._oldest:                            # this only applies if the pile was empty
            self._oldest = item

        put a new or retrieved item at the top of the pile
        
recipes/Python/498266_selfcleaning_dictlike_container_which_limits/recipe-498266.py