Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.05; 'binary': 0.05; 'assign': 0.07; 'attributes': 0.07; 'type,': 0.07; 'languages:': 0.09; 'literal': 0.09; 'object;': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'aug': 0.13; '"x"': 0.16; 'means:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Objects': 0.16; 'integer': 0.17; 'pointed': 0.17; 'thu,': 0.17; '(in': 0.18; 'memory': 0.18; 'variable': 0.20; 'implicit': 0.22; 'location,': 0.22; 'example': 0.23; 'fixed': 0.28; 'header:X -Complaints-To:1': 0.28; 'chris': 0.28; '(possibly': 0.29; 'decimal': 0.29; 'convert': 0.29; '(including': 0.30; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'or,': 0.34; 'whatever': 0.35; 'received:org': 0.36; 'charset:us-ascii': 0.36; 'being': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'lower': 0.61; 'referred': 0.62; 'accessed.': 0.84; 'casting,': 0.84; 'inherent': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Objects in Python Date: Thu, 23 Aug 2012 14:30:48 -0400 Organization: > Bestiaria Support Staff < References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> <87d32i1ntc.fsf@benfinney.id.au> <5035B64D.2080008@cs.wisc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-24-126.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345746642 news.xs4all.nl 6844 [2001:888:2000:d::a6]:52381 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27756 On Thu, 23 Aug 2012 15:33:33 +1000, Chris Angelico declaimed the following in gmane.comp.python.general: > Simple example that'll work in many languages: > > x = 1; > > In C, this means: Assign the integer 1 to the variable x (possibly > with implicit type casting, eg to floating point). > Or, at an even lower level... Convert the decimal literal "1" to binary (including type casting) to the predeclared type given to the variable "x", and store that binary value into the predetermined memory associated with "x". Both the type, and the memory location, are fixed to the name "x" > > In Python, this means: Make the name x now refer to the object 1. > Whatever x had before is de-referenced by one (in a simple refcounting > situation, that may result in the object being destroyed), and the > object referred to by the literal 1 is now pointed to by x. > The type, and memory location, are inherent attributes of the integer object; "x" is just a name by which the object may be accessed. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/