Re: requests.{get,post} timeout

2017-08-25 Thread dieter
Chris Angelico  writes:
> ...
> That looks like an exception to me. Not a "process is now terminated".
> That's what happened when I pressed Ctrl-C (the IP address was
> deliberately picked as one that doesn't currently exist on my network,
> so it took time).

What Jon argues about: signals are delivered to Python's main thread;
if a thread is informed (e.g. via a signal induced exception) that
a request (running in a different thread) should terminate, he needs
a way to make the different thread do that.


You may have argued before that in case of a signal, the request
fails anyway due to an EINTR exception from the IO library.

This may no longer work. Long ago, I have often been plagued
by such EINTR exceptions, and I have wished heavily that in those
cases the IO operation should be automatically resumed. In recent time,
I have no longer seen such exceptions - and I concluded that my wish
has been fulfilled (at least for many signal types).

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Chris Angelico
On Fri, Aug 25, 2017 at 4:26 PM, Paul Rubin  wrote:
> Chris Angelico  writes:
>>> And there are numbers which repeat in decimal but not binary,
>> Which ones repeat in decimal but not binary? An example, please.
>
> That should really have said binary but not decimal, since 2 divides 10.

Well, those that repeat in binary but not decimal are the ones that
have a 5 in the denominator, which loops us right back to what I
originally said :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Proposed new syntax

2017-08-25 Thread Ned Batchelder
On 8/25/17 12:10 AM, Paul Rubin wrote:
> Steve D'Aprano  writes:
>> Did __next__ cache the most recently generated value?
> No but if they're going to change stuff, they might as well actually
> improve it instead of just renaming it to break code gratutiously.

The vast majority of iteration has no need for the last-returned value
again, so why add it to every iteration? You can provide it yourself (or
propose it!) with a small wrapper class.  One of the beautiful things
about Python's iteration model is that it does just one thing well. 
This means it can be applied in more situations to more kinds of data. 
Then if you need more, you build on top of it.

--Ned.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Steve D'Aprano
On Fri, 25 Aug 2017 04:12 pm, Chris Angelico wrote:

>> And there are numbers which repeat in decimal but not binary, and numbers
>> which repeat in both, and numbers which don't repeat in either.
> 
> Which ones repeat in decimal but not binary? An example, please.

What? No. I never said that, that would be silly. You must be replying to some
other Steven.

*wink*

Quoting Wikipedia:

"A rational number has a terminating sequence after the radix point if all the
prime factors of the denominator of the fully reduced fractional form are also
factors of the base. [...]

A rational number has an infinitely repeating sequence of [digits] if the
reduced fraction's denominator contains a prime factor that is not a factor of
the base."

https://en.wikipedia.org/wiki/Repeating_decimal#Extension_to_other_bases


Fractions will terminate in decimal if their denominator is a power of two, a
power of five, or a multiple of such, e.g.:

2, 4, 8, 16, 32, 64, ...
5, 25, 125, 625, ...
10, 20, 40, 50, 80, 100, ...

and will terminate in binary if their denominator is:

2, 4, 8, 16, 32, ...

so obviously any number which terminates in binary will also terminate in
decimal, but not necessarily vice versa.

Fractions will repeat in decimal if their denominator is a multiple of any of
the following primes:

3, 7, 11, 13, 17, ... 

and fractions will repeat in binary if their denominator is a multiple of:

3, 5, 7, 11, 13, 17, ...

so clearly any number which repeats in decimal will also repeat in binary. Like
I said.[1]



How did we get onto prime factors of denominators? The point I was making is
that there are plenty of fractions which are not multiples of 1/5 which
nevertheless lead to unintuitive "wrong answers" in both Decimal and binary
floating point. It is not necessary for the fraction to have a denominator
which is a multiple of 5 to run into issues.





[1] Just now. What may have been said in the past is the past, and long
forgotten. *wink*

-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Chris Angelico
On Fri, Aug 25, 2017 at 11:01 PM, Steve D'Aprano
 wrote:
> How did we get onto prime factors of denominators? The point I was making is
> that there are plenty of fractions which are not multiples of 1/5 which
> nevertheless lead to unintuitive "wrong answers" in both Decimal and binary
> floating point. It is not necessary for the fraction to have a denominator
> which is a multiple of 5 to run into issues.

Yep. We're in agreement on that. My only point about the confusion was
the way in which you could get "wrong answers" in binary but "right
answers" in decimal, leading to the "0.1 + 0.2 != 0.3" problem. That's
a sum that works flawlessly in decimal but not in binary.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Turtle graphics under the console under Windows

2017-08-25 Thread Michael Torrie
On 08/25/2017 06:10 AM, Stefan Ram wrote:
>   Do I miss any means to make the turtle graphics window
>   behave more normally and at the same time be able to draw
>   graphics interactivley from the console, watching the result
>   of one move command and then interacticely typing in more
>   move commands that will continue to move the turtle from
>   where it was left by the preceding move commands?

You have not indicated what operating system version you are using. Or
Python version. I suspect you are using an unsupported version of Windows.

I just tested Python 3.4 on Windows 10 and Linux, and on neither OS do I
see the problems you indicate.  It is indeed interactive and I can
control the turtle from the interactive python console window and there
are no problems with the drawing being delayed or the window going into
a non-responsive state.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Paul Moore
On Friday, 25 August 2017 14:16:05 UTC+1, Chris Angelico  wrote:
> Yep. We're in agreement on that. My only point about the confusion was
> the way in which you could get "wrong answers" in binary but "right
> answers" in decimal, leading to the "0.1 + 0.2 != 0.3" problem. That's
> a sum that works flawlessly in decimal but not in binary.

And in practice this *is* the example that causes the most confusion, in terms 
of people thinking what Python does is "wrong". The usual "explanation" is 
something along the lines of "floats aren't exact" or "rounding", neither of 
which is the real explanation (and "floats aren't exact" isn't even true!)

The real explanation is that "0.1" is a textual representation in your source, 
that gets converted into a value in your code that doesn't actually equate to 
what you *meant* by 0.1 (i.e. 1/10). Explaining the difference between the form 
of a literal, and the resulting actual value used in your program, is 
surprisingly hard (I say this after having recently spent rather longer than I 
thought I'd need to explaining the difference between a "date literal" and a 
"date object" to a colleague who's far from being a "dumb newbie").

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Ian Kelly
On Thu, Aug 24, 2017 at 11:02 PM, Gene Heskett  wrote:
> On Thursday 24 August 2017 23:21:22 Larry Martell wrote:
>
>> I think Chomsky is a jerk, and I'm angry at media outlets like CNN
>> giving him a forum to spew his idiocies.
>
> I agree Larry, Chomsky can be described in even more flowery terms, but
> since its CNN, what else should we expect?  That site has not been on my
> nightly news tour for at least 18 months.

And I'm also angry with CNN because they give *far* more face time to
noted plagiarist and failed human being Ann Coulter than they give to
one of the most cited scholar in academia.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico  wrote:
> That looks like an exception to me. Not a "process is now terminated".
> That's what happened when I pressed Ctrl-C (the IP address was
> deliberately picked as one that doesn't currently exist on my network,
> so it took time).

Ok yes, so ctrl-C is sending SIGINT which interrupts the system call
and is then caught as a Python exception, so this is very similar to
the SIGALRM idea you already suggested, in that it doesn't work with
threads, except it also relies on there being a person there to press
ctrl-C. So we still don't have any workable solution to the problem.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, dieter  wrote:
> This may no longer work. Long ago, I have often been plagued
> by such EINTR exceptions, and I have wished heavily that in those
> cases the IO operation should be automatically resumed. In recent time,
> I have no longer seen such exceptions - and I concluded that my wish
> has been fulfilled (at least for many signal types).

You are correct, this was addressed in PEP 475 which was implemented
in Python 3.5 and it was indeed a good thing.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Chris Angelico
On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens  wrote:
> On 2017-08-25, Chris Angelico  wrote:
>> That looks like an exception to me. Not a "process is now terminated".
>> That's what happened when I pressed Ctrl-C (the IP address was
>> deliberately picked as one that doesn't currently exist on my network,
>> so it took time).
>
> Ok yes, so ctrl-C is sending SIGINT which interrupts the system call
> and is then caught as a Python exception, so this is very similar to
> the SIGALRM idea you already suggested, in that it doesn't work with
> threads, except it also relies on there being a person there to press
> ctrl-C. So we still don't have any workable solution to the problem.

The two complement each other. Want something on a specified clock?
SIGALRM. Want to handle that fuzzy notion of "it's been too long"? Let
the user hit Ctrl-C. They work basically the same way, from different
causes.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread MRAB

On 2017-08-25 15:40, Dennis Lee Bieber wrote:

On Thu, 24 Aug 2017 21:47:41 -0700 (PDT), Rustom Mody
 declaimed the following:



This was true of Britain 100 years ago
It was true of Rome 1000 years ago


Rome was still a problem in 1017? That's only 50 years away from the
Battle of Hastings and the Norman conquest.


Well, the Byzantine Empire still existed.


Rome was basically washed up 1500 years ago. The first crusade fell
about 900 years ago.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Rustom Mody
On Friday, August 25, 2017 at 11:23:26 PM UTC+5:30, MRAB wrote:
> On 2017-08-25 15:40, Dennis Lee Bieber wrote:
> > On Thu, 24 Aug 2017 21:47:41 -0700 (PDT), Rustom Mody declaimed the 
> > following:
> > 
> > 
> >>This was true of Britain 100 years ago
> >>It was true of Rome 1000 years ago
> > 
> > Rome was still a problem in 1017? That's only 50 years away from the
> > Battle of Hastings and the Norman conquest.
> > 
> Well, the Byzantine Empire still existed.
> 
> > Rome was basically washed up 1500 years ago. The first crusade fell
> > about 900 years ago.
> >

I meant to say: Rome → 2000 years

[And Denis I dont see your mails (thanks to your settings?) unless someone else
quotes them]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Express thanks

2017-08-25 Thread Tim Golden

On 21/08/2017 15:34, Hamish MacDonald wrote:

I wanted to give a shout out to the wonderfully passionate contributions to
python I've witnessed following this and   other mailing lists over the
last little bit.

The level of knowledge and willingness to help I've seen are truly
inspiring. Super motivating.

Probably the wrong forum for such a message but what the hey.


Late in replying, but: thank you for taking the trouble. Speaking both 
as a long-time list user, but also as one of the list owners/moderators.


We often enough hear people grumbling about things, but too rarely 
calling positive things out.


TJG
--
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico  wrote:
> On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens  
> wrote:
>> On 2017-08-25, Chris Angelico  wrote:
>>> That looks like an exception to me. Not a "process is now terminated".
>>> That's what happened when I pressed Ctrl-C (the IP address was
>>> deliberately picked as one that doesn't currently exist on my network,
>>> so it took time).
>>
>> Ok yes, so ctrl-C is sending SIGINT which interrupts the system call
>> and is then caught as a Python exception, so this is very similar to
>> the SIGALRM idea you already suggested, in that it doesn't work with
>> threads, except it also relies on there being a person there to press
>> ctrl-C. So we still don't have any workable solution to the problem.
>
> The two complement each other. Want something on a specified clock?
> SIGALRM. Want to handle that fuzzy notion of "it's been too long"? Let
> the user hit Ctrl-C. They work basically the same way, from different
> causes.

Neither works with threads. Threads, neither of them work with.
With threads, neither of them works. Works, threads with, neither
of them does. Of them, working with threads, does neither. Threads!
Them work with! Does not!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Chris Angelico
On Sat, Aug 26, 2017 at 5:40 AM, Jon Ribbens  wrote:
> On 2017-08-25, Chris Angelico  wrote:
>> On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens  
>> wrote:
>>> On 2017-08-25, Chris Angelico  wrote:
 That looks like an exception to me. Not a "process is now terminated".
 That's what happened when I pressed Ctrl-C (the IP address was
 deliberately picked as one that doesn't currently exist on my network,
 so it took time).
>>>
>>> Ok yes, so ctrl-C is sending SIGINT which interrupts the system call
>>> and is then caught as a Python exception, so this is very similar to
>>> the SIGALRM idea you already suggested, in that it doesn't work with
>>> threads, except it also relies on there being a person there to press
>>> ctrl-C. So we still don't have any workable solution to the problem.
>>
>> The two complement each other. Want something on a specified clock?
>> SIGALRM. Want to handle that fuzzy notion of "it's been too long"? Let
>> the user hit Ctrl-C. They work basically the same way, from different
>> causes.
>
> Neither works with threads. Threads, neither of them work with.
> With threads, neither of them works. Works, threads with, neither
> of them does. Of them, working with threads, does neither. Threads!
> Them work with! Does not!

So why are you using multiple threads? You never said that part.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes:

>>On Fri, 25 Aug 2017 11:25 am, Ben Bacarisse wrote:
>>With that in mind, "an Integral" is a shorthand for "an Integral value",
>
>   In math, an integral value is called an /integer/.
>   Therefore, in math, it would seem strange to avoid the noun
>   /integer/ using /integral/ as a noun.
>
>   In a programming language with formal types, however,
>   "an integer value" can be something different than 
>   "an Integer value", which in turn can be something 
>   different than "an Integral value".

I think you are agreeing with the text you quote, yes?  (But including
the part you cut that gives meaning to "With that in mind".)  I ask
because I am often not sure if you are making some subtle point I've
missed.


-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico  wrote:
> On Sat, Aug 26, 2017 at 5:40 AM, Jon Ribbens  
> wrote:
>> On 2017-08-25, Chris Angelico  wrote:
>>> On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens  
>>> wrote:
 On 2017-08-25, Chris Angelico  wrote:
> That looks like an exception to me. Not a "process is now terminated".
> That's what happened when I pressed Ctrl-C (the IP address was
> deliberately picked as one that doesn't currently exist on my network,
> so it took time).

 Ok yes, so ctrl-C is sending SIGINT which interrupts the system call
 and is then caught as a Python exception, so this is very similar to
 the SIGALRM idea you already suggested, in that it doesn't work with
 threads, except it also relies on there being a person there to press
 ctrl-C. So we still don't have any workable solution to the problem.
>>>
>>> The two complement each other. Want something on a specified clock?
>>> SIGALRM. Want to handle that fuzzy notion of "it's been too long"? Let
>>> the user hit Ctrl-C. They work basically the same way, from different
>>> causes.
>>
>> Neither works with threads. Threads, neither of them work with.
>> With threads, neither of them works. Works, threads with, neither
>> of them does. Of them, working with threads, does neither. Threads!
>> Them work with! Does not!
>
> So why are you using multiple threads? You never said that part.

I said it in the majority of the posts I've made in this thread.
I said it in the post you were responding to just now. I'm using
threads. Now I've said it again.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Chris Angelico
On Sat, Aug 26, 2017 at 6:16 AM, Jon Ribbens  wrote:
> On 2017-08-25, Chris Angelico  wrote:
>> On Sat, Aug 26, 2017 at 5:40 AM, Jon Ribbens  
>> wrote:
>>> On 2017-08-25, Chris Angelico  wrote:
 On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens  
 wrote:
> On 2017-08-25, Chris Angelico  wrote:
>> That looks like an exception to me. Not a "process is now terminated".
>> That's what happened when I pressed Ctrl-C (the IP address was
>> deliberately picked as one that doesn't currently exist on my network,
>> so it took time).
>
> Ok yes, so ctrl-C is sending SIGINT which interrupts the system call
> and is then caught as a Python exception, so this is very similar to
> the SIGALRM idea you already suggested, in that it doesn't work with
> threads, except it also relies on there being a person there to press
> ctrl-C. So we still don't have any workable solution to the problem.

 The two complement each other. Want something on a specified clock?
 SIGALRM. Want to handle that fuzzy notion of "it's been too long"? Let
 the user hit Ctrl-C. They work basically the same way, from different
 causes.
>>>
>>> Neither works with threads. Threads, neither of them work with.
>>> With threads, neither of them works. Works, threads with, neither
>>> of them does. Of them, working with threads, does neither. Threads!
>>> Them work with! Does not!
>>
>> So why are you using multiple threads? You never said that part.
>
> I said it in the majority of the posts I've made in this thread.
> I said it in the post you were responding to just now. I'm using
> threads. Now I've said it again.

You said WHY you are using multiple threads? I can't find it.

But if you're using threads, then you can use other techniques, like
reaching into the request and closing its socket. You get what you pay
for.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico  wrote:
> On Sat, Aug 26, 2017 at 6:16 AM, Jon Ribbens  
> wrote:
>> I said it in the majority of the posts I've made in this thread.
>> I said it in the post you were responding to just now. I'm using
>> threads. Now I've said it again.
>
> You said WHY you are using multiple threads? I can't find it.

What's that got to do with anything? Because my program is doing
multiple things at once.

> But if you're using threads, then you can use other techniques, like
> reaching into the request and closing its socket.

There's no documented way of doing that that I'm aware of.

> You get what you pay for.

Are you saying people should expect free software to be rubbish
because it's free? If not, what are you saying?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Test Bank for Essentials of Sociology 6th Edition by Basirico

2017-08-25 Thread candyrainey
On Wednesday, July 12, 2017 at 5:05:41 PM UTC-4, Test Banks wrote:
> Greetings, 
> 
> You can get Test Bank for " Essentials of Sociology 6th Edition by Richard P. 
> Appelbaum, Deborah Carr, Mitchell Duneier, Anthony Giddens " at very 
> reasonable price. Our team is available 24/7 and 365 days / year to respond 
> your requests. Send us an email at pro.fast(@)hotmail(dot)com 
> 
> Place your order at PRO.FAST(@)HOTMAIL(DOT)COM 
> 
> ISBN Numbers for this book (ISBN-10: 0393614298 and ISBN-13: 9780393614299) 
> 
> ESSENTIALS OF SOCIOLOGY 6TH EDITION BY APPELBAUM TEST BANK 
> 
> You can also email for other Sociology books Solutions and Test Bank at low 
> prices and our team will try to get all resources you need. 
> 
> Do not post your reply here. Simply send us an email at PRO.FAST (AT) HOTMAIL 
> (DOT) COM 
> 
> Cheers,

I need TB/SM for 
 
Essentials of Sociology Sixth Edition
 
Title  Essentials in Sociology, 6th Edition  
Author  Basirico, et al  
ISBN   978-1-62751-352-4 
Publisher  BVT Publishing
Publication Date  2014



On Wednesday, July 12, 2017 at 5:05:41 PM UTC-4, Test Banks wrote:
> Greetings, 
> 
> You can get Test Bank for " Essentials of Sociology 6th Edition by Richard P. 
> Appelbaum, Deborah Carr, Mitchell Duneier, Anthony Giddens " at very 
> reasonable price. Our team is available 24/7 and 365 days / year to respond 
> your requests. Send us an email at pro.fast(@)hotmail(dot)com 
> 
> Place your order at PRO.FAST(@)HOTMAIL(DOT)COM 
> 
> ISBN Numbers for this book (ISBN-10: 0393614298 and ISBN-13: 9780393614299) 
> 
> ESSENTIALS OF SOCIOLOGY 6TH EDITION BY APPELBAUM TEST BANK 
> 
> You can also email for other Sociology books Solutions and Test Bank at low 
> prices and our team will try to get all resources you need. 
> 
> Do not post your reply here. Simply send us an email at PRO.FAST (AT) HOTMAIL 
> (DOT) COM 
> 
> Cheers,

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading the documentation

2017-08-25 Thread Rick Johnson
Steve D'Aprano wrote:
> Rustom Mody wrote:
> > Ian wrote:
> >> "Larry Martell"  wrote:
> >> 9:21 PM Rustom Mody wrote:
> > > > Statement 1: Aeroplanes fly. Statement 2: Submarines swim.
> > > > Are these two statements equally acceptable?  [Inspired
> > > > by a talk by Noam Chomsky]
> > > There should be a corollary of Godwin's law for that
> > > idiot.
> [...]
> > [Larry seems to be angry about/at somethin'… No idea who/what…]
> 
> Chomsky challenges the prevailing world-view that the USA
> is a force for good, by documenting the many, many, many
> ways that the USA's actions are harmful, unjust, illegal
> (occasionally all three at once) and in contradiction to
> the nation's stated values. Many people don't like it when
> you challenge their cherished myths.

Nor when you glorify their most hated enemy. 

Chomsky may be under the impression that heroes are without
flaw, however, many of us do not share such naive beliefs,
As any random historian of "super-hero comic book lore" can
testify, heroes are deeply flawed.

So jump on Chomsky's "Let's all bash America" bandwagon if
you must, but please do remember: that the short history of
America has presented a social transformation the likes of
which this world has never seen. So instead of wasting
energy complaining about past events that cannot be changed,
you and Chomsky, should spend your "energy capital"
convincing people that there is a better way.

And calling people names or engaging in endless emotional
battles is never going to work. Yes, the history of America
has been a dark history of many horrors, but it has also
been, at moments, a bright light illuminating the world with
the ideals of liberty. At some point we must realize that
progress cannot _proceed_ until we bury the hatchet.

And that's why Daryl Davis is one of my personal heroes!

Daryl Davis is the perfect example of a man who is fighting
against the ills of our society in the "right way", by
winning hearts and minds. You should learn about this great
man and watch his documentary titled "Accidental Courtesy:
Daryl Davis, Race & America" -- which you can find on the
American PBS website, or in the following links.

The Man:

https://en.wikipedia.org/wiki/Daryl_Davis

The Documentary:
   
http://accidentalcourtesy.com/
   
https://www.netflix.com/title/80105514
   
http://www.imdb.com/title/tt5390430/

-- 
https://mail.python.org/mailman/listinfo/python-list