Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Can global variable be passed into Python function? Date: Sun, 23 Feb 2014 13:01:25 +0200 Organization: A noiseless patient Spider Lines: 25 Message-ID: <87ob1yay9m.fsf@elektro.pacujo.net> References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <87sird7wuw.fsf@handshake.de> <8454E8CB-E6E3-452F-8E54-9A77BFF34EC2@gmail.com> <1m3gg9lbf2ln5m2kbki954t17mqni3b20k@4ax.com> <53095145$0$29985$c3e8da3$5496439d@news.astraweb.com> <877g8mcg1m.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="29817"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ylr7Xa9/5h7ogIJKJiPNT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:KvymCXMN8z2a6FlbwMcXfoEDV2w= sha1:NhRakHKww9lMmNi628DWW2aDTMY= Xref: csiph.com comp.lang.python:66936 Chris Angelico : > That's the exact line of thinking that leads to problems. You are not > placing a number at the address "xyz", you are pointing the name "xyz" > to the number 3. That number still exists elsewhere. And? In C, I can say: Number *o = malloc(sizeof *o); o->value = 3; Your statement is valid: the number 3 resides elsewhere than the variable o. As for Python, there's nothing in the Python specification that would prevent you from having, say, 63-bit integers as representing themselves. IOW, you could physically place such integers as themselves as the reference and the number would not physically exist elsewhere. Bottom line, there's no fundamental difference between C and Python variables. Marko