Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73456

Re: how to check if a value is a floating point or not

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: how to check if a value is a floating point or not
Date 2014-06-20 14:40 +0100
References <d5ca21d7-23e6-4240-83d8-262d0f877f7e@googlegroups.com> <c21b1d32-a716-4629-aad6-357b62a8f529@googlegroups.com> <1496766103424961606.682559sturla.molden-gmail.com@news.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.11166.1403271661.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 20/06/2014 14:16, Sturla Molden wrote:
> Nicholas Cannon <nicholascannon1@gmail.com> wrote:
>
>> Guys i am only a beginner at python most of the stuff you are saying i
>> need to do i dont understand.
>
> Then listen and try to learn :-)
>
> But don't use try/except everywhere! Some exceptions might be due to an
> error in your own code, i.e. not in the user input. Those errors you should
> not silence, but let your program crash and abort. Then you will know there
> is an error in your code. That is what an unhandled exception will do, and
> in addition it will tell you where the error is and what it is, so just
> leave those exceptions unhandled.
>

For the OP a very important rule of thumb is never use a bare except, so 
this is right out.

try:
     doSomething()
except:
     WTF()

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to check if a value is a floating point or not nicholascannon1@gmail.com - 2014-06-18 22:53 -0700
  Re: how to check if a value is a floating point or not Gary Herron <gary.herron@islandtraining.com> - 2014-06-18 23:22 -0700
  Re: how to check if a value is a floating point or not Nicholas Cannon <nicholascannon1@gmail.com> - 2014-06-18 23:48 -0700
    Re: how to check if a value is a floating point or not Ben Finney <ben@benfinney.id.au> - 2014-06-19 17:19 +1000
    Re: how to check if a value is a floating point or not Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-19 01:23 -0600
    Re: how to check if a value is a floating point or not Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-19 01:37 -0600
  Re: how to check if a value is a floating point or not Sturla Molden <sturla.molden@gmail.com> - 2014-06-19 13:46 +0000
  Re: how to check if a value is a floating point or not Nicholas Cannon <nicholascannon1@gmail.com> - 2014-06-19 23:14 -0700
    Re: how to check if a value is a floating point or not Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-20 00:22 -0600
    Re: how to check if a value is a floating point or not Sturla Molden <sturla.molden@gmail.com> - 2014-06-20 13:16 +0000
    Re: how to check if a value is a floating point or not Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-06-20 14:40 +0100
      Re: how to check if a value is a floating point or not Grant Edwards <invalid@invalid.invalid> - 2014-06-20 14:28 +0000
        Re: how to check if a value is a floating point or not alister <alister.nospam.ware@ntlworld.com> - 2014-06-20 15:15 +0000
        Re: how to check if a value is a floating point or not Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-20 09:44 -0600

csiph-web