Steve D'Aprano writes:
> Since it is *optional*, it is only a hint, not a fact. You can tell the
> compiler that you believe that n will be an int, but it's not guaranteed.
The runtime could check at the entry to the function that n is an int,
and then it wouldn't have to keep re-checking on the
On Mon, 17 Apr 2017 05:16 am, bartc wrote:
> But it was OK for Steve to 'win' the benchmark by substituting my test
> code with something only vaguely related, and much simpler?
Okay, you're now being obnoxious, and telling lies about me.
What I said was
"FOR WHAT IT'S WORTH [emphasis added],
On Mon, 17 Apr 2017 05:49 am, Dennis Lee Bieber wrote:
> On Mon, 17 Apr 2017 02:48:08 +1000, Steve D'Aprano
> declaimed the following:
>
>>On Sun, 16 Apr 2017 11:57 pm, bartc wrote:
>>
>>> But people just don't want it.
>>
>>Damn straight. Now you get it. It's not about how easy it is to impleme
I'm having difficulty matching the Python docs suggested folders for Python
stuff with where I actually find things (or not find things)
Especially for packages. I've got a packages folder in my installation folder,
but none in the apps data folder, though the docs point there.
Could someone pr
bartc wrote:
> - describing the various syntax forms;
> - explaining how they differ;
> - tutorials for beginners showing each form;
And you don't have to explain how an endless loop should be written as
'while True', meanwhile advising against using 'while 1'?
You don't have to mention i
On 16/04/2017 19:42, Chris Angelico wrote:
On Mon, Apr 17, 2017 at 4:21 AM, bartc wrote:
Here is a function from some old CPython source that appears to be something
to do with While statements:
static int
validate_while(node *tree)
{
...
Look, no comments! Are you going to castigate the dev
hello i have create a select django form with list of images for per user.
How to take that select request in my views.py ?
i have success only to create correct that select list but i need take that
select request but i dont know how.
models.py
class MyModel(models.Model):
user = models
On Mon, Apr 17, 2017 at 5:16 AM, bartc wrote:
> On 16/04/2017 20:00, Chris Angelico wrote:
>>
>> On Mon, Apr 17, 2017 at 4:43 AM, bartc wrote:
>
>
>> Sure! If all you care about is winning benchmarks,
>
>
> The benchmarks should be about comparing things. But they have to be like
> for like.
You
On 16/04/2017 20:00, Chris Angelico wrote:
On Mon, Apr 17, 2017 at 4:43 AM, bartc wrote:
Sure! If all you care about is winning benchmarks,
The benchmarks should be about comparing things. But they have to be
like for like.
Since this was about the effects of type annotations, it would b
On Mon, Apr 17, 2017 at 4:43 AM, bartc wrote:
>>
>> For what it's worth, on my machine (2GB RAM and 1.2GHz CPU) I can add up
>> 100
>> million ints in 14 seconds:
>>
>> py> with Stopwatch():
>> ... sum(range(1))
>> ...
>> 49995000
>> time taken: 14.032116 seconds
>
>
> I'm surp
On 16/04/2017 18:13, Steve D'Aprano wrote:
On Mon, 17 Apr 2017 02:20 am, justin walters wrote:
On Sun, Apr 16, 2017 at 8:46 AM, bartc wrote:
What were the results with Python on your machine?
Well, at first I tried to implement it with a generator. I gave up on
waiting for the program to
On Mon, Apr 17, 2017 at 4:21 AM, bartc wrote:
> Here is a function from some old CPython source that appears to be something
> to do with While statements:
>
> static int
> validate_while(node *tree)
> {
> int nch = NCH(tree);
> int res = (validate_ntype(tree, while_stmt)
>
On 16/04/2017 17:30, Steve D'Aprano wrote:
On Sun, 16 Apr 2017 10:06 pm, bartc wrote:
(The 30 Loc figure is with support for loops /in
general/ already in place, and is for /adding/ a new loop statement, in
this case 'while')
What part of *testing* and *documenting* do you not understand?
On Mon, 17 Apr 2017 03:00 am, Rustom Mody wrote:
> BTW I regard Steven's long list of things that youve missed such as
> regression tests, docs etc to be somewhat off the mark
> To see that try this experiment:
> Just add a feature to python that matters to you along with all these
> requirements
Peter Otten wrote, on Saturday, April 15, 2017 12:44 AM
>
> Deborah Swanson wrote:
>
> > I know it's your "ugly" answer, but can I ask what the '**' in
> >
> > fix = {label: max(values, key=len)}
> > group[:] = [record._replace(**fix) for record in group]
> >
> > means?
>
> d = {"a": 1, "b": 2
On Mon, 17 Apr 2017 02:20 am, justin walters wrote:
> On Sun, Apr 16, 2017 at 8:46 AM, bartc wrote:
>
>> What were the results with Python on your machine?
>
>
>
> Well, at first I tried to implement it with a generator. I gave up on
> waiting for the program to complete
> after about 6 minut
Hi all,
I've followed the instructions in the 1st chapter (Getting Started) of the
Python Developers's Guide to compile python 3.6 from source, using VS 2017 on a
Windows 7 SP1. I successfully built 35 of the 40 subprojects, and the python
interpreter in cpython\PCbuild\amd64 is working fine.
On 4/16/2017 11:35 AM, Michael Torrie wrote:
On 04/16/2017 07:57 AM, bartc wrote:
But people just don't want it.
/That/ is what surprises me, when people reject things that to me are
no-brainers.
Whereas to me, it is a no-brainer that we are better off *without*
multiple while/loop construct
Hi all,
I've followed the instructions in the 1st chapter (Getting Started) of the
Python Developers's Guide to compile python 3.6 from source, using VS 2017 on a
Windows 7 SP1. I successfully built 35 of the 40 subprojects, and the python
interpreter in cpython\PCbuild\amd64 is working fine.
On Sunday, April 16, 2017 at 7:27:49 PM UTC+5:30, bartc wrote:
> Technically, adding this one feature to Python /is/ trivial,
^
You are not paying attention bart and I am not likely to pursue this beyond this
post. I tried to say as are others that the substantive reasons to reject a
On Sun, 16 Apr 2017 11:57 pm, bartc wrote:
> Yet countless other, far more elaborate features /are/ added all the time.
Indeed. Because they are needed. Because they add functionality that Python
doesn't already have, or seriously improves the interface to that
functionality.
> Technically, add
On Sun, 16 Apr 2017 10:06 pm, bartc wrote:
> On 16/04/2017 03:51, Steve D'Aprano wrote:
>> On Sat, 15 Apr 2017 10:17 pm, bartc wrote:
>
>>> Yes, I'm constantly surprised at this, as such syntax has a very low
>>> cost (in my last compiler, supporting 'while' for example only added 30
>>> lines to
On Sun, Apr 16, 2017 at 8:46 AM, bartc wrote:
> What were the results with Python on your machine?
Well, at first I tried to implement it with a generator. I gave up on
waiting for the program to complete
after about 6 minutes.
After using your code almost exactly I get:
>>> Sum: 1499850
On 16/04/2017 15:22, Chris Angelico wrote:
On Sun, Apr 16, 2017 at 11:57 PM, bartc wrote:
Technically, adding this one feature to Python /is/ trivial, for example,
allowing while: as a synonym for while True:, but preferably using a new
keyword such as loop. Nothing else needs to be touched. An
On 16/04/2017 16:00, justin walters wrote:
On Sun, Apr 16, 2017 at 3:55 AM, bartc wrote:
Example C of the same silly program in Python:
def add(a,b):
return a+b
def testfn():
sum=a=b=0
for i in range(1):
sum += add(a,b)
a += 1
b += 2
print (a,
On 04/16/2017 07:57 AM, bartc wrote:
> But people just don't want it.
>
> /That/ is what surprises me, when people reject things that to me are
> no-brainers.
I simply don't care about these missing loop constructs. Python works
great for what I use it for, and apparently works well for many pe
On Sun, Apr 16, 2017 at 3:55 AM, bartc wrote:
> Example C of the same silly program in Python:
>
> def add(a,b):
> return a+b
>
> def testfn():
> sum=a=b=0
> for i in range(1):
> sum += add(a,b)
> a += 1
> b += 2
>
> print (a,b,sum)
>
> testfn()
>
>
Le 16/04/17 à 15:19, Wolfgang Maier a écrit :
On 16.04.2017 10:56, Vincent Vande Vyvre wrote:
Hi,
I'm using Python 3.5 and 3.6 in venv and I see a strange behaviour in
the interactive interpreter.
The arrow keys can't be used to move the cursor into the current line of
code or to rewrite the l
On 16-4-2017 14:28, jorge.conr...@cptec.inpe.br wrote:
> Hi,
>
> I'm new on Python software. I would like to write on disk arrays in binary or
> ascii
> format. Can someone please help me?
>
> Thanks,
>
> Conrado
What kind of data is in the arrays?
Who or what will be reading the files?
And mo
On Sun, Apr 16, 2017 at 11:57 PM, bartc wrote:
> Technically, adding this one feature to Python /is/ trivial, for example,
> allowing while: as a synonym for while True:, but preferably using a new
> keyword such as loop. Nothing else needs to be touched. And it could have
> been done right at the
On 16/04/2017 13:22, Rustom Mody wrote:
On Sunday, April 16, 2017 at 5:36:28 PM UTC+5:30, bartc wrote:
On 16/04/2017 03:51, Steve D'Aprano wrote:
On Sat, 15 Apr 2017 10:17 pm, bartc wrote:
Yes, I'm constantly surprised at this, as such syntax has a very low
cost (in my last compiler, support
On 16.04.2017 10:56, Vincent Vande Vyvre wrote:
Hi,
I'm using Python 3.5 and 3.6 in venv and I see a strange behaviour in
the interactive interpreter.
The arrow keys can't be used to move the cursor into the current line of
code or to rewrite the last lines.
With the 3.5 I can use the backspac
On Sun, Apr 16, 2017 at 8:55 PM, bartc wrote:
> On 16/04/2017 05:27, Steve D'Aprano wrote:
>>
>> On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
>>
>>> apparently, the py-devs believe we
>>> only deserve type declarations that do nothing to speed up
>>> code execution (aka: type-hints), instead
Hi,
I'm new on Python software. I would like to write on disk arrays in
binary or ascii format. Can someone please help me?
Thanks,
Conrado
--
https://mail.python.org/mailman/listinfo/python-list
On Sunday, April 16, 2017 at 5:36:28 PM UTC+5:30, bartc wrote:
> On 16/04/2017 03:51, Steve D'Aprano wrote:
> > On Sat, 15 Apr 2017 10:17 pm, bartc wrote:
>
> >> Yes, I'm constantly surprised at this, as such syntax has a very low
> >> cost (in my last compiler, supporting 'while' for example only
On 16/04/2017 03:51, Steve D'Aprano wrote:
On Sat, 15 Apr 2017 10:17 pm, bartc wrote:
Yes, I'm constantly surprised at this, as such syntax has a very low
cost (in my last compiler, supporting 'while' for example only added 30
lines to the project).
That's the advantage of writing your own p
Steve D'Aprano writes:
> I don't remember the language, but I remember seeing one generalisation of
> the repeat/do loop that puts the test in the middle, rather than at the
> start or end of the loop. If I remember it was something like:
>
> DO
> setup code # executed once only
> REPEAT
>
On 16/04/2017 05:27, Steve D'Aprano wrote:
On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
apparently, the py-devs believe we
only deserve type declarations that do nothing to speed up
code execution (aka: type-hints), instead of type
declarations that could actually speed up the code. Go
fig
On Sun, 16 Apr 2017 09:48:15 +, alister wrote:
> On Sun, 16 Apr 2017 14:27:28 +1000, Steve D'Aprano wrote:
>
>> On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
>>
>>> apparently, the py-devs believe we only deserve type declarations that
>>> do nothing to speed up code execution (aka: type
On Sun, 16 Apr 2017 14:27:28 +1000, Steve D'Aprano wrote:
> On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
>
>> apparently, the py-devs believe we only deserve type declarations that
>> do nothing to speed up code execution (aka: type-hints), instead of
>> type declarations that could actually
On Sun, Apr 16, 2017 at 5:21 PM, Mikhail V wrote:
> I am in the category "I just want to express some
> algorithm and don't want to learn every year new concepts".
> I tend to think that extremely restricted syntax, in the sence
> of having only few flow control instructions actually helps with
>
Hi,
I'm using Python 3.5 and 3.6 in venv and I see a strange behaviour in
the interactive interpreter.
The arrow keys can't be used to move the cursor into the current line of
code or to rewrite the last lines.
With the 3.5 I can use the backspace and erase the code but not in 3.6
Python 3
On 14 April 2017 at 03:44, Steve D'Aprano wrote:
> On Fri, 14 Apr 2017 12:52 am, bartc wrote:
>
>> I know this isn't the Python need-for-speed thread, but this is a
>> classic example where the lack of one simple feature leads to using
>> slower, more cumbersome ones.
>
> Dear gods, have I fallen
43 matches
Mail list logo