Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.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; 'python,': 0.02; 'syntax': 0.03; 'subject:Python': 0.05; 'context': 0.05; 'float': 0.05; 'needed,': 0.05; 'defines': 0.07; 'interpreted': 0.07; 'lines.': 0.07; 'null,': 0.07; 'objects,': 0.07; 'practice,': 0.07; 'problem?': 0.07; 'works.': 0.07; 'python': 0.09; 'cc:addr:googlegroups.com': 0.09; 'errors,': 0.09; 'none.': 0.09; 'prejudice': 0.09; 'similar,': 0.09; 'cc:addr:python-list': 0.10; "wouldn't": 0.11; 'suggest': 0.11; 'language': 0.14; '24,': 0.16; 'accordingly,': 0.16; 'dummy': 0.16; 'err...': 0.16; 'int.': 0.16; 'naming': 0.16; 'syntax.': 0.16; 'string': 0.17; 'wrote:': 0.17; 'variables': 0.17; 'memory': 0.18; 'feb': 0.19; 'code.': 0.20; 'variable': 0.20; 'define': 0.20; 'written': 0.20; 'trying': 0.21; 'init': 0.22; 'cc:no real name:2**0': 0.24; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'setting': 0.26; 'language.': 0.27; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'dictionary': 0.29; 'loop,': 0.29; 'unlikely': 0.29; 'url:mailman': 0.29; 'source': 0.29; 'probably': 0.29; "i'm": 0.29; 'code': 0.31; 'point': 0.31; 'url:python': 0.32; 'aside': 0.32; 'url:listinfo': 0.32; 'int': 0.33; 'another': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'doing': 0.35; 'pm,': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'wanted': 0.36; 'url:org': 0.36; 'totally': 0.36; 'thank': 0.36; 'two': 0.37; 'moment': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'speak': 0.38; 'performance': 0.39; 'help': 0.40; 'url:mail': 0.40; 'think': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'you.': 0.61; 'further': 0.61; 'excited': 0.63; 'ever': 0.63; 'taking': 0.65; 'offer': 0.65; 'hours': 0.66; 'study': 0.66; 'chinese': 0.78; '2013': 0.84; 'chinese,': 0.84; 'malicious': 0.84; 'ugly,': 0.84; 'joel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=1NZSsxv+Un7De2AFlwRfdi7k4HLhgzK0metNcWFuxAs=; b=ddPQYb60T1jnpHXEBVSUtDChA88cpxHbDnG6F/rVqbNwedznjKq7I0bqoaT7jwDozg AOdGktn1yOGaI0MIj8QjEVwlwaYHymTKXjgZ7lbK2hELGm81TAjpbF6DhqcPVx248QY2 y5mHbtwh9+uHg4p27F27xS8Xlqjos7qeZc19JeiUnvJ4AhwthLSMScIXsAc4+aTyIeNb gCNrtgiGifx1F6ll5UVjKOJXFwEqNZ4wLFTyalAOndFrKItF/rOFQVYIQEFnFCtpHYTT 7rbX2+ZEq/64Dq7rkriVXDq/mbKKDhpzAplwbHa3ozjahFbPOrT3q2wpIiskp/dkoho4 pCsw== MIME-Version: 1.0 X-Received: by 10.52.23.205 with SMTP id o13mr681291vdf.78.1361747125840; Sun, 24 Feb 2013 15:05:25 -0800 (PST) In-Reply-To: References: <5127848B.1060004@gmail.com> <928d2cf7-728b-4f35-b8c9-4c9b958507e5@googlegroups.com> <8eadd52c-d533-4333-8c7f-7bf3a6d7b046@googlegroups.com> <9p1ii899tkalvfd1cl7sneoqa9t1cqh4oj@invalid.netcom.com> <5129482F.3080402@gmail.com> <512a5199$0$29998$c3e8da3$5496439d@news.astraweb.com> <5a3bf25b-a08b-4084-a940-e1fd05a1045d@googlegroups.com> Date: Sun, 24 Feb 2013 18:05:25 -0500 Subject: Re: Python Newbie From: Joel Goldstick To: piterrr.dolinski@gmail.com Content-Type: multipart/alternative; boundary=20cf307ca364b5e11204d6807507 Cc: python-list , comp.lang.python@googlegroups.com 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: 122 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361747134 news.xs4all.nl 6922 [2001:888:2000:d::a6]:48082 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39813 --20cf307ca364b5e11204d6807507 Content-Type: text/plain; charset=UTF-8 On Sun, Feb 24, 2013 at 5:43 PM, wrote: > Josh, > > Not thank you for your malicious post. > I think you are missing the point here. > > My source code was just a dummy to offer context for the question I wanted > to ask. Further down the line, if I ever feel I don't need to > pseudo-declare variables I will stop doing it. But for the moment I am > trying to imitate familiar ground. > > My code as written has no syntax errors, so what's the problem? It is > highly unlikely you will ever read any of my Python code - no need to get > excited over a few of my lines. > > And you don't need to answer questions which were not posed, thank you. > > I wanted Python to register what type of variable I'm after. So I init my > vars accordingly, int might be 0, float 0.0 and string with null, err... > None. > In a language that defines Names that are bound to objects, there can't be a 'type' inferred. In C or similar, when you delcair the variable you are setting aside the memory to hold something of that type. This is compile time typing. That isn't how python works, so naming something an int will never make it an int. intMe = 'Joel' is totally valid in python. Sticking to ideas like this will hinder understanding of how python works. I suggest taking two hours to study the python documentation at python.org. I don't speak Chinese, but I know that I can't just use a dictionary of English to Chinese and use the same syntax. It won't be Chinese. Get over your prejudice and learn the new language.... or don't, but trying to shoe horn python into the concepts of another language won't help you understand python, it will produce ugly, messy, unsupportable code. > > In practice, I wouldn't define an intX_asString var, I would do "str > (num)" every time a string representation is needed, provided it isn't a > loop, as in that context the expression would probably negatively impact > performance in an interpreted language. > > Peter > -- > http://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com --20cf307ca364b5e11204d6807507 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Sun, Feb 24, 2013 at 5:43 PM, <piterrr.dolinski@gmail= .com> wrote:
Josh,

Not thank you for your malicious post.
I think you are missing the point here.

My source code was just a dummy to offer context for the question I wanted = to ask. Further down the line, if I ever feel I don't need to pseudo-de= clare variables I will stop doing it. But for the moment I am trying to imi= tate familiar ground.

My code as written has no syntax errors, so what's the problem? It is h= ighly unlikely you will ever read any of my Python code - no need to get ex= cited over a few of my lines.

And you don't need to answer questions which were not posed, thank you.=

I wanted Python to register what type of variable I'm after. So I init = my vars accordingly, int might be 0, float 0.0 and string with null, err...= None.

In a language that defines Names= that are bound to objects, there can't be a 'type' inferred.= =C2=A0 In C or similar, when you delcair the variable you are setting aside= the memory to hold something of that type.=C2=A0 This is compile time typi= ng.=C2=A0 That isn't how python works, so naming something an int will = never make it an int.=C2=A0 intMe =3D 'Joel' is totally valid in py= thon.

Sticking to ideas like this will hinder understanding of how= python works.=C2=A0 I suggest taking two hours to study the python documen= tation at python.org.=C2=A0 I don't s= peak Chinese, but I know that I can't just use a dictionary of English = to Chinese and use the same syntax.=C2=A0 It won't be Chinese.

Get over your prejudice and learn the new language.... or do= n't, but trying to shoe horn python into the concepts of another langua= ge won't help you understand python, it will produce ugly, messy, unsup= portable code.=C2=A0

In practice, I wouldn't define an intX_asString var, I would do "s= tr (num)" every time a string representation is needed, provided it is= n't a loop, as in that context the expression would probably negatively= impact performance in an interpreted language.

Peter
--
http://mail.python.org/mailman/listinfo/python-list



--
--20cf307ca364b5e11204d6807507--