Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(except': 0.05; 'c++,': 0.07; 'python': 0.09; 'closest': 0.09; 'derived': 0.09; 'variables,': 0.09; 'void*': 0.09; 'stored': 0.10; 'subject:python': 0.11; 'classes)': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'old-style': 0.16; 'wrote:': 0.17; 'pointer': 0.17; 'variables': 0.17; 'jan': 0.18; 'variable': 0.20; 'object.': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'guess': 0.27; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; 'subject: ?': 0.30; 'could': 0.32; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'except': 0.36; 'but': 0.36; 'wanted': 0.36; 'compare': 0.36; 'does': 0.37; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'you.': 0.61; '*really*': 0.84; '2013': 0.84; 'casting': 0.84; 'local,': 0.84; 'angel': 0.93; 'subject:available': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Quia1RRWrlba3t+uIwBXYOi2LZcPivJ/ggb6zIyYpFo=; b=ChVb68AkYLsmmTwvucF+ERrWnocmWDTWTdAYF602m78BTDfrkNXxfXq/wdJI4ynas7 trb+duzuJRgfillH0Xk8Iaei2+xO+MM3Prge5OwvRc10E7j5IxRX3T9sCDO1J/kox8AI t7AenYa8r3eD3H8a395WNzqmps5QiVLnwoNWVAjUHR68HcOziI/35VIAXeLXjZtT8TBs kHrxYlrdakQUPNw7oReYns1+36yL9bDoqMMq5MFv4aM9raQycOfRevrsL91i3XzxisEV rGQ7v/hf3vinYbsM6OyDlMTtuhoGcXeokH/v9u9FGpm364t2/xwnqX8gASW1SxGlAUn7 coHA== MIME-Version: 1.0 In-Reply-To: <50EADF88.10605@davea.name> References: <1357513931.54941.YahooMailNeo@web125504.mail.ne1.yahoo.com> <50ea9ac2$0$21851$c3e8da3$76491128@news.astraweb.com> <1357569153.3330.140661174432761.5D8246E9@webmail.messagingengine.com> <50EADF88.10605@davea.name> Date: Tue, 8 Jan 2013 01:59:52 +1100 Subject: Re: Over 30 types of variables available in python ? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357570801 news.xs4all.nl 6854 [2001:888:2000:d::a6]:35204 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36354 On Tue, Jan 8, 2013 at 1:45 AM, Dave Angel wrote: > On 01/07/2013 09:32 AM, marduk wrote: >> So I guess if one *really* wanted to compare C variables to Python >> variables, you could say that all python variables are of type void* >> except Python does all mallocs/frees and the casting for you. > > A better analogy would be to C++, and all names would be something like > shared_ptr. And (except for old-style classes) all actual data > is of a type derived from object. But yes, a C pointer variable is closest to a Python local, with actual content always stored on the heap. ChrisA