Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'completeness': 0.05; 'message-----': 0.12; 'wrote:': 0.15; "'int'": 0.16; '712': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'imho,': 0.16; 'it).': 0.16; 'privilege,': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:155.180.234.122': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:169.70': 0.16; 'received:169.70.190': 0.16; 'received:172.18.0': 0.16; 'received:172.18.0.232': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:se3.svr.bankone.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'subject:Convert': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'case.': 0.16; "subject:' ": 0.16; 'int': 0.19; 'purposes,': 0.19; 'that?': 0.19; 'convert': 0.19; 'solution.': 0.19; "aren't": 0.22; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'gregory': 0.23; 'sunday,': 0.23; 'code': 0.24; 'greg': 0.25; "python's": 0.25; 'received:169': 0.25; 'received:169.254': 0.25; 'expect': 0.25; 'string': 0.26; 'function': 0.26; '(you': 0.28; '24,': 0.29; 'subject:': 0.30; 'ewing': 0.30; 'received:155': 0.30; 'received:159': 0.30; 'received:169.254.1': 0.30; 'to:name:python- list@python.org': 0.30; 'header:Received:8': 0.32; 'to:addr :python-list': 0.34; 'sent:': 0.34; 'phone:': 0.35; 'integer': 0.35; 'received:172.18': 0.35; 'here,': 0.35; 'from:': 0.36; 'charset:us-ascii': 0.36; 'accuracy': 0.37; 'minimum': 0.37; 'but': 0.37; 'subject:: ': 0.38; 'think': 0.38; 'to:addr:python.org': 0.39; 'might': 0.39; 'your': 0.60; 'subject': 0.62; 'july': 0.64; 'information,': 0.64; 'therefore,': 0.66; 'receive': 0.68; 'skip:= 30': 0.69; 'legal': 0.69; 'url:email': 0.75; 'sale': 0.76; 'bank': 0.76; 'investment': 0.78; 'dead': 0.80; 'purchase': 0.84; 'horse': 0.84 X-DKIM: Sendmail DKIM Filter v2.5.6 sj1.jpmchase.com p720Wd8X008651 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=jpmorgan.com; s=smtpout; t=1312245159; bh=yGGB8floi2AM1RULxxhLft3u3QlKnFOQJtzAHJe uLvg=; h=From:To:Date:Subject:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=mJBWKqR+SSc jpsuxyD2F+YNGYSa1kprPYV5rFFs3yekj6gM0+x0Ya19fwj0m4GUdLzdCsbjjGlB+oe X/eZ9HA+9oqOi7TAworfp9GPTybww3Lp7Am1QrdNAbn3fzF/g0Vft69dc0nywqKsQ40 evipXpH70WoI+Ag1Vw3pPw4Pwo= From: "Prasad, Ramit" To: "python-list@python.org" Date: Mon, 1 Aug 2011 20:32:32 -0400 Subject: RE: Convert '165.0' to int Thread-Topic: Convert '165.0' to int Thread-Index: AcxKXzq1NJw6s5EqSAWj+B4ReAfN6AGS6tmA References: <4e281f97$0$16404$426a74cc@news.free.fr> <4230ed8b-5173-4408-938f-3777dcd60588@t7g2000vbv.googlegroups.com> <3d6b3ab4-6682-4e33-ab03-098d2f82c20d@o18g2000yqm.googlegroups.com> <58cdafad-e1ea-4774-984f-aa13cf2a9ef1@fq4g2000vbb.googlegroups.com> <993q91FebkU2@mid.individual.net> In-Reply-To: <993q91FebkU2@mid.individual.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312248487 news.xs4all.nl 23980 [2001:888:2000:d::a6]:51218 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10691 -----Original Message-----=0D=0AFrom: python-list-bounces+ramit=2Eprasad=3D= jpmchase=2Ecom@python=2Eorg [mailto:python-list-bounces+ramit=2Eprasad=3Djp= mchase=2Ecom@python=2Eorg] On Behalf Of Gregory Ewing=0D=0ASent: Sunday, Ju= ly 24, 2011 7:05 PM=0D=0ATo: python-list@python=2Eorg=0D=0ASubject: Re: Con= vert '165=2E0' to int=0D=0A=0D=0AFrank Millman wrote:=0D=0A=0D=0A> I know I= am flogging a dead horse here, but IMHO, '165', '165=2E',=0D=0A> '165=2E0'= , and '165=2E00' are all valid string representations of the=0D=0A> integer= 165=2E[1]=0D=0A> =0D=0A> Therefore, for practical purposes, it would not b= e wrong for python's=0D=0A> 'int' function to accept these without complain= ing=2E=0D=0A=0D=0AHow far would you go with that? Would you also accept=0D= =0A'1=2E65e2' as a valid representation of the integer 165?=0D=0A=0D=0A-- = =0D=0AGreg=0D=0A-- =0D=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A=0D=0ANo, YAGNI (You = Aren't Going To Need It)=2E Do the minimum that works for your use case=2E = If you only expect ###=2E# then code for that=2E Avoid trying to over-engin= eer your solution=2E *If* you think you are going to receive information th= at might be like '1=2E65e2' then code for it, otherwise spend your time wor= king on other problems=2E=0D=0A=0D=0ARamit=0D=0A=0D=0A=0D=0ARamit Prasad | = JPMorgan Chase Investment Bank | Currencies Technology=0D=0A712 Main Street= | Houston, TX 77002=0D=0Awork phone: 713 - 216 - 5423=0D=0A=0D=0A=0D=0A=0D= =0AThis email is confidential and subject to important disclaimers and=0D= =0Aconditions including on offers for the purchase or sale of=0D=0Asecuriti= es, accuracy and completeness of information, viruses,=0D=0Aconfidentiality= , legal privilege, and legal entity disclaimers,=0D=0Aavailable at http://w= ww=2Ejpmorgan=2Ecom/pages/disclosures/email=2E