On Fri, 29 Jul 2016, 09:20 Steven D'Aprano, wrote:
> I'm not sure that partial is intended as an optimization. It may end up
> saving time by avoiding evaluating arguments, but that's not why it exists.
> It exists to enable the functional programming idiom of partial evaluation
> in a simpler, m
Below is a short program that illustrate the problem
It works with python2, whether you use the -c option or not.
It only works with python3 if you use the -c option.
The problem seems to come from my expectation that a file
is its own iterator and in python3 that is no longer true
for a NamedTemp
c...@zip.com.au wrote:
>On 28Jul2016 19:28, Gordon Levi wrote:
>>Arshpreet Singh wrote:
>>>I am writing Imdb scrapper, and getting available list of titles from IMDB
>>>website which provide txt file in very raw format, Here is the one part of
>>>file(http://pastebin.com/fpMgBAjc) as the file
Op 23-07-16 om 16:19 schreef Chris Angelico:
> On Sun, Jul 24, 2016 at 12:00 AM, BartC wrote:
>> Or, for debugging or other reasons, when you need to comment out the
>> contents of a block. Then pass needs to be added.
> How often do you comment out an entire block and not its header? I
> don't re
Can someone explain in layman's terms what "float" means ?
>>> x = float(input("Write a number"))
Write a number 16
--
https://mail.python.org/mailman/listinfo/python-list
Am 07/29/2016 um 11:44 AM schrieb Cai Gengyang:
Can someone explain in layman's terms what "float" means ?
The Python builtin float[1]
> Return a floating point number constructed from a number or string x.
A floating point number[2] is number that is not an integer (and not a
complex number
Cai Gengyang writes:
> Can someone explain in layman's terms what "float" means ?
They are a compromise: in a known number of bits and with explict
very-fast hardware support, represent numbers at a large range of
scales. The compromise is that the values have limited precision for
representing
On Fri, 29 Jul 2016 10:58:35 +0200
Antoon Pardon wrote:
> As BartC already mentions it happens fairly often during debugging.
> Something like.
>
> try:
>Some code
> except Some_Exception:
># Commented code for when I am debugging
>pass
I realize that that's a simplified example but
On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon
wrote:
>
> The problem seems to come from my expectation that a file
> is its own iterator and in python3 that is no longer true
> for a NamedTemporaryFile.
For some reason it uses a generator function for __iter__ instead of
returning self, which wo
On 29/07/2016 12:14, D'Arcy J.M. Cain wrote:
On Fri, 29 Jul 2016 10:58:35 +0200
Antoon Pardon wrote:
As BartC already mentions it happens fairly often during debugging.
Something like.
try:
Some code
except Some_Exception:
# Commented code for when I am debugging
pass
I realize tha
On Jul 29, 2016 7:22 AM, "BartC" wrote:
>
> On 29/07/2016 12:14, D'Arcy J.M. Cain wrote:
>>
>> On Fri, 29 Jul 2016 10:58:35 +0200
>> Antoon Pardon wrote:
>>>
>>> As BartC already mentions it happens fairly often during debugging.
>>> Something like.
>>>
>>> try:
>>>Some code
>>> except Some_E
On Fri, 29 Jul 2016 11:15 pm, BartC wrote:
> On 29/07/2016 12:14, D'Arcy J.M. Cain wrote:
>> On Fri, 29 Jul 2016 10:58:35 +0200
>> Antoon Pardon wrote:
>>> As BartC already mentions it happens fairly often during debugging.
>>> Something like.
>>>
>>> try:
>>>Some code
>>> except Some_Excepti
Op 29-07-16 om 13:14 schreef D'Arcy J.M. Cain:
> On Fri, 29 Jul 2016 10:58:35 +0200
> Antoon Pardon wrote:
>> As BartC already mentions it happens fairly often during debugging.
>> Something like.
>>
>> try:
>>Some code
>> except Some_Exception:
>># Commented code for when I am debugging
Op 29-07-16 om 15:43 schreef Steven D'Aprano:
> Of course it won't, which is why I don't believe all these folks who claim
> that they regularly ("all the time", "fairly often") replace except blocks
> with `pass`. I call shenanigans -- perhaps you do it *occasionally*, but as
> a general rule, you
On Fri, 29 Jul 2016 07:44 pm, Cai Gengyang wrote:
> Can someone explain in layman's terms what "float" means ?
Floating point number:
https://en.wikipedia.org/wiki/Floating_point
As opposed to fixed point numbers:
https://en.wikipedia.org/wiki/Fixed-point_arithmetic
Python floats use 64 bits
On Fri, 29 Jul 2016 11:55 pm, Antoon Pardon wrote:
> Op 29-07-16 om 15:43 schreef Steven D'Aprano:
>> Of course it won't, which is why I don't believe all these folks who
>> claim that they regularly ("all the time", "fairly often") replace except
>> blocks with `pass`. I call shenanigans -- perha
On Saturday, December 12, 2015 at 1:05:29 AM UTC-8, Harbey Leke wrote:
> Create a class called BankAccount
>
> .Create a constructor that takes in an integer and assigns this to a
> `balance` property.
>
> .Create a method called `deposit` that takes in cash deposit amount and
> updates the bal
On Fri, 29 Jul 2016 14:15:01 +0100
BartC wrote:
> > try:
> >Some code
> > # except Some_Exception:
> ># Commented code for when I am debugging
>
> Will it behave the same way when there is a Some_Exception exception?
Of course not. The person writing that was an idiot.
Oh wait - I wro
On Fri, 29 Jul 2016 15:55:07 +0200
Antoon Pardon wrote:
> I think the case where you just want to ignore the exception, but it
> can at times be useful to get some extra logging information for
> debuging purposes, is not that rare as you seem to suggest.
The way I handle that is:
DEBUG = False
Greetings!
I may have a need in the immediate future to work with SOAP and WSDL services,
and a quick search
turned up Zeep (http://docs.python-zeep.org/en/latest/) -- does anyone have any
experience with it?
Or any other libraries that can be recommended?
Thanks.
--
~Ethan~
--
https://mail.p
Op 29-07-16 om 16:38 schreef Steven D'Aprano:
> On Fri, 29 Jul 2016 11:55 pm, Antoon Pardon wrote:
>
>> Op 29-07-16 om 15:43 schreef Steven D'Aprano:
>>> Of course it won't, which is why I don't believe all these folks who
>>> claim that they regularly ("all the time", "fairly often") replace exce
On 7/29/2016 4:43 AM, Antoon Pardon wrote:
Below is a short program that illustrate the problem
It works with python2, whether you use the -c option or not.
It only works with python3 if you use the -c option.
The problem seems to come from my expectation that a file
is its own iterator and in p
On 7/29/2016 7:59 AM, eryk sun wrote:
On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon
wrote:
The problem seems to come from my expectation that a file
is its own iterator and in python3 that is no longer true
for a NamedTemporaryFile.
For some reason it uses a generator function for __iter__
On 7/29/2016 4:58 AM, Antoon Pardon wrote:
Op 23-07-16 om 16:19 schreef Chris Angelico:
On Sun, Jul 24, 2016 at 12:00 AM, BartC wrote:
Or, for debugging or other reasons, when you need to comment out the
contents of a block. Then pass needs to be added.
How often do you comment out an entire
On 29/07/2016 20:43, Terry Reedy wrote:
On 7/29/2016 4:58 AM, Antoon Pardon wrote:
Something like.
try:
Some code
except Some_Exception:
# Commented code for when I am debugging
pass
So put in 'pass' whether or not there is no debugging code,
commented-out debugging code, or debug
Rather than do this:
if test['method'] == 'GET':
res = requests.get(test['endpoint'],auth=test['auth'],
verify=False)
elif test['method'] == 'POST':
res = requests.post(test['endpoint'], auth=test['auth'],
verify=False, json=test['bod
On 2016-07-29, TUA wrote:
> Rather than do this:
>
> if test['method'] == 'GET':
> res = requests.get(test['endpoint'],auth=test['auth'],
> verify=False)
> elif test['method'] == 'POST':
> res = requests.post(test['endpoint'], auth=tes
On Fri, Jul 29, 2016 at 2:35 PM, TUA wrote:
> Rather than do this:
>
> if test['method'] == 'GET':
> res = requests.get(test['endpoint'],auth=test['auth'],
> verify=False)
> elif test['method'] == 'POST':
> res = requests.post(test['endpoint'],
BartC :
> On 29/07/2016 20:43, Terry Reedy wrote:
>> So put in 'pass' whether or not there is no debugging code,
>> commented-out debugging code, or debugging code that runs, or whatever.
>
> But that's inelegant.
>
> The language requires that blocks always contains 1 or more
> statements. Fair en
On Friday, 29 July 2016 13:35:30 UTC-7, TUA wrote:
> Rather than do this:
>
> if test['method'] == 'GET':
> res = requests.get(test['endpoint'],auth=test['auth'],
> verify=False)
> elif test['method'] == 'POST':
> res = requests.post(te
Calls to my REST api may either return a dict (for single results) or a list of
dicts (for multiple results).
I receive these results using the requests library.
I want to retrieve the value for a key 'ID' but only if I have a single result
and, obviously, if ID is present.
How can I do this w
> Or any other libraries that can be recommended?
I'd recommend Spyne, code and docs are good, but more importantly the
lead dev is responsive and very helpful. Can't speak highly enough about him...
http://spyne.io/
hth,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Jul 29, 2016 at 7:34 PM, Terry Reedy wrote:
> On 7/29/2016 7:59 AM, eryk sun wrote:
>>
>> On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon
>> wrote:
>>>
>>> The problem seems to come from my expectation that a file
>>> is its own iterator and in python3 that is no longer true
>>> for a Name
On 29Jul2016 18:42, Gordon Levi wrote:
c...@zip.com.au wrote:
On 28Jul2016 19:28, Gordon Levi wrote:
Arshpreet Singh wrote:
I am writing Imdb scrapper, and getting available list of titles from IMDB
website which provide txt file in very raw format, Here is the one part of
file(http://past
In TUA
writes:
> I want to retrieve the value for a key 'ID' but only if I have a single
> result and, obviously, if ID is present.
> How can I do this with pythonic elegance?
> Thanks for all suggestions!
if len(results) == 1 and 'ID' in results:
return results['ID']
else:
On Sat, 30 Jul 2016 06:19 am, BartC wrote:
> The language requires that blocks always contains 1 or more statements.
> Fair enough, except that 0 statements are often needed
They really aren't.
The standard library uses more "pass" statements than most code I've seen,
because of the large number
On Sat, 30 Jul 2016 04:32 am, Antoon Pardon wrote:
> Op 29-07-16 om 16:38 schreef Steven D'Aprano:
>> On Fri, 29 Jul 2016 11:55 pm, Antoon Pardon wrote:
>>
>>> Op 29-07-16 om 15:43 schreef Steven D'Aprano:
Of course it won't, which is why I don't believe all these folks who
claim that t
On Thursday, June 30, 2016 at 11:33:58 PM UTC+5:30, Steven D'Aprano wrote:
> On Fri, 1 Jul 2016 01:28 am, Rustom Mody wrote:
>
> > On Thursday, June 30, 2016 at 1:55:18 PM UTC+5:30, Steven D'Aprano wrote:
> >
> >> you state that Turing "believes in souls" and that he "wishes to
> >> put the soul
38 matches
Mail list logo