Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Effects of caching frequently used objects, was Re: Explaining names vs variables in Python Date: Wed, 02 Mar 2016 09:16:31 -0500 Organization: IISS Elusive Unicorn Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de +csB4/CJP4yEMWWhJn+rXQNxgXbDCmNv0WnOScaHxD8g== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'puts': 0.07; 'message-id:@4ax.com': 0.09; 'none.': 0.09; 'objects.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'thread': 0.10; 'wed,': 0.15; '2016': 0.16; 'object()': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'sentinel': 0.16; 'true:': 0.16; 'url:home': 0.18; 'finished': 0.23; 'header:X-Complaints-To:1': 0.26; 'queue': 0.29; 'objects': 0.29; 'starts': 0.29; 'useful': 0.33; 'identity': 0.35; 'should': 0.36; 'created': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'stuff': 0.38; 'data': 0.39; 'to:addr:python.org': 0.40; 'subject: ': 0.61; 'mar': 0.65; '>you': 0.84; 'otten': 0.84; 'dennis': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-68-178-69.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103871 On Wed, 02 Mar 2016 10:12:48 +0100, Peter Otten <__peter__@web.de> declaimed the following: >You should not bother with object identity for objects other than None. It's useful for deliberately created sentinel objects. ENDDATA = object() ... #some thread starts that puts stuff onto a queue, and puts #ENDDATA on the queue when it is finished while True: data = q.get() if data is ENDDATA: break #do stuff -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/