Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.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; '(especially': 0.07; 'sized': 0.07; 'variables': 0.07; 'arguments,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'typed': 0.09; 'variant': 0.09; 'python': 0.11; 'assembler': 0.16; 'byte,': 0.16; 'bytes).': 0.16; 'indirectly': 0.16; 'mapped': 0.16; 'message- id:@4ax.com': 0.16; 'mov': 0.16; 'rather,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'registers.': 0.16; 'index': 0.16; 'sat,': 0.16; "python's": 0.19; 'machine': 0.22; 'memory': 0.22; 'separate': 0.22; 'load': 0.23; "aren't": 0.24; 'byte': 0.24; 'url:home': 0.24; 'references': 0.26; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'instruction': 0.29; 'direction': 0.30; 'becoming': 0.31; 'addresses': 0.33; 'could': 0.34; "can't": 0.35; 'representing': 0.36; 'charset:us-ascii': 0.36; 'similar': 0.36; 'two': 0.37; 'being': 0.38; 'generic': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'address': 0.63; 'act': 0.63; 'field': 0.63; 'determine': 0.67; 'registers': 0.68; 'other.': 0.75; 'address,': 0.75; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Values and objects Date: Sat, 10 May 2014 12:07:20 -0400 Organization: IISS Elusive Unicorn References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <5368681D.8070602@islandtraining.com> <87ppjpwafk.fsf@elektro.pacujo.net> <536ad8f2$0$29965$c3e8da3$5496439d@news.astraweb.com> <87zjiqbmy5.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-222-144.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.15 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399738054 news.xs4all.nl 2933 [2001:888:2000:d::a6]:51895 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71254 On Sat, 10 May 2014 01:34:58 +0300, Marko Rauhamaa declaimed the following: > >Right, Python's variables aren't like variables in C. Rather, Python's >variables are like CPU registers. They cannot hold typed or structured >objects and you can't pass references to them. > They aren't like CPU registers either (especially not on the machine I learned on -- in which the general purpose registers mapped to address 0-15 (longword addresses -- 64 bytes). While the opcodes did have a field sized for one register, a register<>register move used the same opcode as a register<>memory move LD,9 MYMEM ;some symbol representing a location in memory LD,9 8 ;"location" 8, general purpose register as memory LDB,9 *8,3 ;load a byte, indirectly using the longword ;whose address is in register 8, using the ;contents of register 3 as a byte index into ;the word, into register 9 (yes, the machine used separate LoaD and STore instruction for direction control... not a generic MOV with two arguments, either of which could be memory address, and an assembler that had to determine which variant format was to be generated) For CPU registers to act similar to Python you'd have to be alias, at run-time, register names (and you'd need some other instruction to load a register value as mov A, B would result in both A and B becoming the same register -- not one being a copy of the other. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/