Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Christian Gollwitzer
Am 03.09.16 um 02:31 schrieb Marco Sulla: On 2 September 2016 at 21:12, Christian Gollwitzer wrote: Am 02.09.16 um 19:24 schrieb Marco Sulla: Because Python has no long double type? Python no of course, but C++ yes, and CPython is written in C++. However, I think the answer is here: https://e

Re: Pythons for .Net

2016-09-02 Thread Denis Akhiyarov
On Sunday, July 24, 2016 at 11:30:09 PM UTC-5, Steven D'Aprano wrote: > Yes, I said Pythons plural :-) > > For those wanting to use Python on .Net or Mono, there is some good news. > > Firstly, the venerable old "Python for .Net" project is still alive, and now > supports up to Python 3.5 on .Net

Re: *args and **kwargs

2016-09-02 Thread Gregory Ewing
Ben Finney wrote: in the definition of the function, parameters are neither positional nor keyword. In Python 3 that's not quite true -- it's possible to define "keyword only" parameters that can't be passed positionally. However, it's true that any of the "ordinary" parameters (ones that aren

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Marco Sulla
On 3 September 2016 at 02:31, Marco Sulla wrote: > Python no of course, but C++ yes, and CPython is written in C++. Sorry, I just founded CppPython... -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Marco Sulla
On 2 September 2016 at 21:12, Christian Gollwitzer wrote: > Am 02.09.16 um 19:24 schrieb Marco Sulla: > Because Python has no long double type? Python no of course, but C++ yes, and CPython is written in C++. However, I think the answer is here: https://en.wikipedia.org/wiki/Long_double#Implement

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread MRAB
On 2016-09-02 20:47, Random832 wrote: On Fri, Sep 2, 2016, at 15:12, Christian Gollwitzer wrote: Tradition? All languages I know of treat a number with an exponent as floating point. Scheme does allow you to give integers (and rationals) in decimal and/or exponential notation with the "#e" pre

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Random832
On Fri, Sep 2, 2016, at 15:12, Christian Gollwitzer wrote: > Tradition? All languages I know of treat a number with an exponent as > floating point. Scheme does allow you to give integers (and rationals) in decimal and/or exponential notation with the "#e" prefix. -- https://mail.python.org/mail

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Marko Rauhamaa
Christian Gollwitzer : > Am 02.09.16 um 19:24 schrieb Marco Sulla: >> float has an 'exponentfloat' syntax. Why integers does not have an >> equivalent syntax? > > Tradition? All languages I know of treat a number with an exponent as > floating point. Approximate real numbers are mostly needed by

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Christian Gollwitzer
Am 02.09.16 um 19:24 schrieb Marco Sulla: Excuse me, I forgot to include the python list mail addess. I repost the mail. On Fri, Sep 2, 2016 at 6:18 PM, Christian Gollwitzer wrote: 1e26 denotes a *floating point number* Floating point has finite precision, in CPython it is a 64bit IEEE numb

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Random832
On Fri, Sep 2, 2016, at 13:02, Marco Sulla wrote: > On Fri, Sep 2, 2016 at 6:17 PM, Random832 wrote: > > Trying to add 1 gets it rounded off again, and the value is simply > > printed as 1e+26 by default because this is the shortest representation > > that gives the same number, even if "1

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Marco Sulla
Excuse me, I forgot to include the python list mail addess. I repost the mail. On Fri, Sep 2, 2016 at 6:18 PM, Christian Gollwitzer wrote: > 1e26 denotes a *floating point number* Floating point has finite precision, > in CPython it is a 64bit IEEE number. The largest exact integer there is >

Re: urllib2 timeout not working - stalls for an hour or so

2016-09-02 Thread Sumeet Sandhu
On Friday, September 2, 2016 at 6:05:05 AM UTC-7, Peter Otten wrote: > Sumeet Sandhu wrote: > > > Hi, > > > > I use urllib2 to grab google.com webpages on my Mac over my Comcast home > > network. > > > > I see about 1 error for every 50 pages grabbed. Most exceptions are > > ssl.SSLError, very f

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Christian Gollwitzer
Am 02.09.16 um 17:51 schrieb Marco Sulla: 10**26 - 1 99 1e26 - 1 1e+26 10**26 is computed with integer arithmetics. Python has bigints (i.e. as big as the memory allows) 1e26 denotes a *floating point number* Floating point has finite precision, in CPython it is

Re: Strange behaviour with numbers in exponential notation

2016-09-02 Thread Random832
On Fri, Sep 2, 2016, at 11:51, Marco Sulla wrote: > >>> 10**26 - 1 > 99 > >>> 1e26 - 1 > 1e+26 > > > Why? Exponential notation creates floating point numbers, which have a limited amount of precision in binary. Specifically (on my system which, as most modern computer

Re: *args and **kwargs

2016-09-02 Thread Smith
On 02/09/2016 16:52, alister wrote: On Fri, 02 Sep 2016 23:44:50 +1000, Ben Finney wrote: Smith writes: I'm trying to understand the concept of * args and ** kwarg with python3 Welcome. Your questions are fine in this forum; but you may also want to participate in our collaborative learnin

Re: *args and **kwargs

2016-09-02 Thread Smith
After specifying a keyword argument, you may not then specify any positional arguments. Hence the SyntaxError. thanks a lot -- https://mail.python.org/mailman/listinfo/python-list

Strange behaviour with numbers in exponential notation

2016-09-02 Thread Marco Sulla
>>> 10**26 - 1 99 >>> 1e26 - 1 1e+26 Why? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python slang

2016-09-02 Thread Random832
On Wed, Aug 10, 2016, at 12:19, Random832 wrote: > On Wed, Aug 10, 2016, at 07:59, Dennis Lee Bieber wrote: > > The use of = also has a long history... FORTRAN (where the > > comparison was .EQ.), BASIC (granted, K&K required assignment to > > start with the keyword LET, so the use of =

Re: *args and **kwargs

2016-09-02 Thread alister
On Fri, 02 Sep 2016 23:44:50 +1000, Ben Finney wrote: > Smith writes: > >> I'm trying to understand the concept of * args and ** kwarg with >> python3 > > Welcome. Your questions are fine in this forum; but you may also want to > participate in our collaborative learning forum for Python beginn

Re: *args and **kwargs

2016-09-02 Thread Ben Finney
Smith writes: > I'm trying to understand the concept of * args and ** kwarg with > python3 Welcome. Your questions are fine in this forum; but you may also want to participate in our collaborative learning forum for Python beginners, https://mail.python.org/mailman/listinfo/tutor>. > But I can

*args and **kwargs

2016-09-02 Thread Smith
Hello to all, I'm trying to understand the concept of * args and ** kwarg with python3 But I can not understand why I returns the error message "SyntaxError: positional argument follows the keyword argument" when I insert values. You can help me? def start(data=None, *args, **kwargs): prin

Re: urllib2 timeout not working - stalls for an hour or so

2016-09-02 Thread Peter Otten
Sumeet Sandhu wrote: > Hi, > > I use urllib2 to grab google.com webpages on my Mac over my Comcast home > network. > > I see about 1 error for every 50 pages grabbed. Most exceptions are > ssl.SSLError, very few are socket.error and urllib2.URLError. > > The problem is - after a first exception

urllib2 timeout not working - stalls for an hour or so

2016-09-02 Thread Sumeet Sandhu
Hi, I use urllib2 to grab google.com webpages on my Mac over my Comcast home network. I see about 1 error for every 50 pages grabbed. Most exceptions are ssl.SSLError, very few are socket.error and urllib2.URLError. The problem is - after a first exception, urllib2 occasionally stalls for upt