Re: constant folding - why not more

2020-11-11 Thread Serhiy Storchaka
11.11.20 02:46, Skip Montanaro пише: > I can think of two reasons. One, this kind of comparison will almost never > appear in production code (maybe in unit tests?). Unlike the C family of > languages, Python doesn't have a macro processor which would give symbolic > names to numeric constants or s

Re: constant folding - why not more

2020-11-10 Thread Skip Montanaro
> > On the contrary, comparison remains for runtime: > >>> dis.dis(compile('1 < 2', filename='', mode='eval', > >>> optimize=2)) > 1 0 LOAD_CONST 0 (1) > 2 LOAD_CONST 1 (2) > 4 COMPARE_OP 0 (<) > 6 RETUR

Re: constant folding - why not more

2020-11-10 Thread Chris Angelico
On Wed, Nov 11, 2020 at 4:01 AM David Kolovratník wrote: > On the contrary, comparison remains for runtime: > >>> dis.dis(compile('1 < 2', filename='', mode='eval', > >>> optimize=2)) > 1 0 LOAD_CONST 0 (1) > 2 LOAD_CONST 1 (2) >

Re: constant folding - why not more

2020-11-10 Thread Terry Reedy
On 11/10/2020 1:03 PM, Barry Scott wrote: On 10 Nov 2020, at 14:45, David Kolovratník wrote: Dear all, I would like to learn about constant folding optimisation in Python. It seems to be implemented in Python/ast_opt.c. In order to get impression I used python3 and dis module: $ python3 -V

Re: constant folding - why not more

2020-11-10 Thread Barry Scott
> On 10 Nov 2020, at 14:45, David Kolovratník wrote: > > Dear all, > > I would like to learn about constant folding optimisation in Python. It seems > to be implemented in Python/ast_opt.c. In order to get impression I used > python3 and dis module: > > $ python3 -V > Python 3.7.3 I do not h

constant folding - why not more

2020-11-10 Thread David Kolovratník
Dear all, I would like to learn about constant folding optimisation in Python. It seems to be implemented in Python/ast_opt.c. In order to get impression I used python3 and dis module: $ python3 -V Python 3.7.3 Arithmetics expression is folded as expected: >>> dis.dis(compile('1 * 2', filename=

Re: Why not being able to call modules from lib folder into test folder although I have __init__.py file both?

2019-04-26 Thread Arup Rakshit
On 26/04/19 11:14 AM, dieter wrote: Arup Rakshit writes: I am not able to call modules from lib folder in my test folder, but outside of tests folder I can access them. How should I fix this? Mocks$ tree . . ├── lib │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │

Re: Why not being able to call modules from lib folder into test folder although I have __init__.py file both?

2019-04-25 Thread dieter
Arup Rakshit writes: > I am not able to call modules from lib folder in my test folder, but outside > of tests folder I can access them. How should I fix this? > > Mocks$ tree . > . > ├── lib > │ ├── __init__.py > │ ├── __pycache__ > │ │ ├── __init__.cpython-37.pyc > │ │ └── product.c

Why not being able to call modules from lib folder into test folder although I have __init__.py file both?

2019-04-25 Thread Arup Rakshit
I am not able to call modules from lib folder in my test folder, but outside of tests folder I can access them. How should I fix this? Mocks$ tree . . ├── lib │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── product.cpython-37.pyc │ └── product.py └── test

Re: Why not have a recvall method?

2018-02-04 Thread 陶青云
Thank you, it's very helpful. I think the recvall should builtin to the _socket module like sendall. -- Original -- From: "Dan Stromberg"; Date: Mon, Feb 5, 2018 06:01 AM To: "陶青云"; Cc: "python-list"; Subject: Re: Why

Re: Why not have a recvall method?

2018-02-04 Thread Dan Stromberg
On Sun, Feb 4, 2018 at 5:26 AM, 陶青云 wrote: > Hello, all > The socket object has a `sendall` method that can send all bytes you > specified. > Oppositely, socket only has a recv method. I wonder why there is not a > `recvall` method? > To workaround this, I use `f = socket.makefile('rb')`, then a

Re: Why not have a recvall method?

2018-02-04 Thread 陶青云
is reached first). -- Original -- From: "Steven D'Aprano"; Date: Sun, Feb 4, 2018 09:31 PM To: "python-list"; Subject: Re: Why not have a recvall method? On Sun, 04 Feb 2018 19:26:36 +0800, 陶青云 wrote: > Hello, allThe socket objec

Re: Why not have a recvall method?

2018-02-04 Thread Steven D'Aprano
On Sun, 04 Feb 2018 19:26:36 +0800, 陶青云 wrote: > Hello, allThe socket object has a `sendall` method that can send all > bytes you specified. Oppositely, socket only has a recv method. I wonder > why there is not a `recvall` method? To workaround this, I use `f = > socket.makefile('rb')`, then `cal

Why not have a recvall method?

2018-02-04 Thread 陶青云
Hello, all The socket object has a `sendall` method that can send all bytes you specified. Oppositely, socket only has a recv method. I wonder why there is not a `recvall` method? To workaround this, I use `f = socket.makefile('rb')`, then all `f.read(n)` Thanks. -- https://mail.python.or

Why not have a recvall method?

2018-02-04 Thread 陶青云
Hello, allThe socket object has a `sendall` method that can send all bytes you specified. Oppositely, socket only has a recv method. I wonder why there is not a `recvall` method? To workaround this, I use `f = socket.makefile('rb')`, then `call f.read(n)` Thanks. -- https://mail.python.org/mailma

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 4:37 AM, Terry Reedy wrote: > Making repeat a keyword would have such an extremely high cost > that it is out of the question and not a sane proposal. > To start with, it is used in two major, widely used APIs. > > itertools.repeat + 50 uses in other itertools and tests > ti

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Terry Reedy
Making repeat a keyword would have such an extremely high cost that it is out of the question and not a sane proposal. To start with, it is used in two major, widely used APIs. itertools.repeat + 50 uses in other itertools and tests + all the imports and and uses of repeat() in code all over th

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Steven D'Aprano
On Thursday 04 August 2016 19:13, BartC wrote: > On 04/08/2016 04:23, Steven D'Aprano wrote: >> On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > >>> So the idea that remembering 'repeat N' is a cognitive burden, and the >>> myriad string operations for example are not, is ridiculous. >> >> Who says it

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Chris Angelico
On Thu, Aug 4, 2016 at 7:13 PM, BartC wrote: > On 04/08/2016 04:23, Steven D'Aprano wrote: >> >> On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > > >>> So the idea that remembering 'repeat N' is a cognitive burden, and the >>> myriad string operations for example are not, is ridiculous. >> >> >> Who sa

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread BartC
On 04/08/2016 04:23, Steven D'Aprano wrote: On Wed, 3 Aug 2016 08:16 pm, BartC wrote: So the idea that remembering 'repeat N' is a cognitive burden, and the myriad string operations for example are not, is ridiculous. Who says it isn't a cognitive burden? Of course it is. The difference is

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-03 Thread Steven D'Aprano
On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > On 03/08/2016 06:43, Steven D'Aprano wrote: > >> Not everything that is done is worth the cognitive burden of memorising a >> special case. > > >> In some ways, Python is a more minimalist language than you like. That's >> okay, you're allowed to

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 03/08/2016 23:31, Chris Angelico wrote: On Thu, Aug 4, 2016 at 8:21 AM, BartC wrote: But is this a generic mechanism that works for /any/ .dll file, or does there have to be dedicated support for each of the 60 built-in modules? I'm talking about the former. Frankly, I don't want that. Mo

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 04/08/2016 00:25, Paul Rubin wrote: BartC writes: sometimes you try to find a .py import module and it doesn't seem to exist anywhere. (sys.py for example). I would like to see how such references are translated to Lisp. (require 'sys) What does that do? Don't tell me that every Lisp c

Re: Why not allow empty code blocks?

2016-08-03 Thread Paul Rubin
BartC writes: > sometimes you try to find a .py import module and it > doesn't seem to exist anywhere. (sys.py for example). > I would like to see how such references are translated to Lisp. (require 'sys) -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-08-03 Thread Chris Angelico
On Thu, Aug 4, 2016 at 8:21 AM, BartC wrote: > But is this a generic mechanism that works for /any/ .dll file, or does > there have to be dedicated support for each of the 60 built-in modules? > > I'm talking about the former. Frankly, I don't want that. Most C APIs are horrendously unPythonic, s

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 03/08/2016 22:39, Chris Angelico wrote: On Thu, Aug 4, 2016 at 6:53 AM, BartC wrote: On 03/08/2016 21:12, Chris Angelico wrote: Fairly common approach - and it means you'll never find those .py files. So it's no different from looking for sys.py and not finding it, except that in the case

Re: Why not allow empty code blocks?

2016-08-03 Thread Chris Angelico
On Thu, Aug 4, 2016 at 6:53 AM, BartC wrote: > On 03/08/2016 21:12, Chris Angelico wrote: >> >> Fairly common approach - and it means you'll never find those .py >> files. So it's no different from looking for sys.py and not finding >> it, except that in the case of CPython's sys, it's not even a

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 03/08/2016 21:12, Chris Angelico wrote: On Thu, Aug 4, 2016 at 4:52 AM, BartC wrote: On 03/08/2016 14:31, Chris Angelico wrote: On Wed, Aug 3, 2016 at 11:23 PM, BartC wrote: On 03/08/2016 09:58, Steven D'Aprano wrote: But sometimes you try to find a .py import module and it doesn't see

Re: Why not allow empty code blocks?

2016-08-03 Thread alister
On Wed, 03 Aug 2016 14:06:06 +, Grant Edwards wrote: > On 2016-08-03, Rustom Mody wrote: > >> The first nokia I used never crashed but could still run out of battery >> And the round-dial landlines of 30 years ago had not even that problem > > Yes, technically, it did. Except the batteries

Re: Why not allow empty code blocks?

2016-08-03 Thread Chris Angelico
On Thu, Aug 4, 2016 at 4:52 AM, BartC wrote: > On 03/08/2016 14:31, Chris Angelico wrote: >> >> On Wed, Aug 3, 2016 at 11:23 PM, BartC wrote: >>> >>> On 03/08/2016 09:58, Steven D'Aprano wrote: >>> >>> But sometimes you try to find a .py import module and it doesn't seem to >>> exist anywhere. (s

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 03/08/2016 14:31, Chris Angelico wrote: On Wed, Aug 3, 2016 at 11:23 PM, BartC wrote: On 03/08/2016 09:58, Steven D'Aprano wrote: Python is sometimes described as a Lisp with more sensible syntax, so its not surprising that it is relatively simple to translate Python to Lisp and visa versa

Re: Why not allow empty code blocks?

2016-08-03 Thread Grant Edwards
On 2016-08-03, Rustom Mody wrote: > The first nokia I used never crashed but could still run out of > battery And the round-dial landlines of 30 years ago had not even > that problem Yes, technically, it did. Except the batteries were kept elsewhere, and the telco went to a lot of trouble to ma

Re: Why not allow empty code blocks?

2016-08-03 Thread Gordon Levi
"D'Arcy J.M. Cain" wrote: >On Mon, 01 Aug 2016 00:25:58 +1000 >Gordon Levi wrote: >> "D'Arcy J.M. Cain" wrote: >> >I don't care if you are using carrier pigeon. If you send an email >> >address, make it a valid one. >> >> I admire those who use a valid email address on Usenet but it is an >>

Re: Why not allow empty code blocks?

2016-08-03 Thread Chris Angelico
On Wed, Aug 3, 2016 at 11:23 PM, BartC wrote: > On 03/08/2016 09:58, Steven D'Aprano wrote: > >> Python is sometimes described as a Lisp with more sensible syntax, so its >> not >> surprising that it is relatively simple to translate Python to Lisp and >> visa >> versa. > > > Translating Python wo

Re: Why not allow empty code blocks?

2016-08-03 Thread Chris Angelico
On Wed, Aug 3, 2016 at 11:04 PM, BartC wrote: > On 03/08/2016 13:36, Chris Angelico wrote: >> >> On Wed, Aug 3, 2016 at 10:16 PM, Rustom Mody >> wrote: >>> >>> There he comes waddling in… Your cute-n-cudly strawman!! >>> A more realistic analogy would be phones >>> The cellphones we use today of

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 03/08/2016 09:58, Steven D'Aprano wrote: Python is sometimes described as a Lisp with more sensible syntax, so its not surprising that it is relatively simple to translate Python to Lisp and visa versa. Translating Python would be easier if everything was implemented as Python. But sometim

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-03 Thread Chris Angelico
On Wed, Aug 3, 2016 at 8:16 PM, BartC wrote: > On 03/08/2016 06:43, Steven D'Aprano wrote: > >> Not everything that is done is worth the cognitive burden of memorising a >> special case. > > > >> In some ways, Python is a more minimalist language than you like. That's >> okay, >> you're allow

Re: Why not allow empty code blocks?

2016-08-03 Thread BartC
On 03/08/2016 13:36, Chris Angelico wrote: On Wed, Aug 3, 2016 at 10:16 PM, Rustom Mody wrote: There he comes waddling in… Your cute-n-cudly strawman!! A more realistic analogy would be phones The cellphones we use today often crash The first nokia I used never crashed but could still run out

Re: Why not allow empty code blocks?

2016-08-03 Thread Rustom Mody
On Wednesday, August 3, 2016 at 6:08:08 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody : > > > Note: You CAN use python scheme-ishly but few people do that. > > eg here is SICP in python with the first examples pure useful powerful > > functions: > > http://www-inst.eecs.berkeley.edu/~cs61a/sp12

Re: Why not allow empty code blocks?

2016-08-03 Thread Marko Rauhamaa
Rustom Mody : > Note: You CAN use python scheme-ishly but few people do that. > eg here is SICP in python with the first examples pure useful powerful > functions: > http://www-inst.eecs.berkeley.edu/~cs61a/sp12/book/functions.html#first-example I see nothing there that is not ordinary Python.

Re: Why not allow empty code blocks?

2016-08-03 Thread Chris Angelico
On Wed, Aug 3, 2016 at 10:16 PM, Rustom Mody wrote: > There he comes waddling in… Your cute-n-cudly strawman!! > A more realistic analogy would be phones > The cellphones we use today often crash > The first nokia I used never crashed but could still run out of battery > And the round-dial landli

Re: Why not allow empty code blocks?

2016-08-03 Thread Marko Rauhamaa
Rustom Mody : > As I said earlier what they (the MIT profs) seem to be saying is that > the topical relevance of python — a library for making robots — trumps > scheme’s abstract beauty Python is an excellent choice. As far as abstract beauty is concerned, I'm wondering why Python abolished brace

Re: Why not allow empty code blocks?

2016-08-03 Thread Rustom Mody
On Wednesday, August 3, 2016 at 5:53:44 PM UTC+5:30, Rustom Mody wrote: > On Wednesday, August 3, 2016 at 5:39:25 PM UTC+5:30, Marko Rauhamaa wrote: > > Rustom Mody : > > I don't know who or what you are referring to. > > I put it in the next line! > > > Scheme for beginning programmers could be

Re: Why not allow empty code blocks?

2016-08-03 Thread Rustom Mody
On Wednesday, August 3, 2016 at 5:39:25 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody : > > So yes scheme are python have similar underbellies but the culture of > > use is quite different. > > I don't know if there's enough Scheme activity out there to call it a > culture. > > As far as under

Re: Why not allow empty code blocks?

2016-08-03 Thread Rustom Mody
On Wednesday, August 3, 2016 at 5:11:23 PM UTC+5:30, Steven D'Aprano wrote: > On Wednesday 03 August 2016 05:22, Paul Rubin wrote: > > >> The Halting Problem is easily solved for Bloop languages: they always > >> halt. > > > > If Bloop is powerful enough to "solve the halting problem" as you > >

Re: Why not allow empty code blocks?

2016-08-03 Thread Marko Rauhamaa
Rustom Mody : > So yes scheme are python have similar underbellies but the culture of > use is quite different. I don't know if there's enough Scheme activity out there to call it a culture. As far as underbellies go, Scheme macros and operators are not first-class. The Kernel programming languag

Re: Why not allow empty code blocks?

2016-08-03 Thread Rustom Mody
On Wednesday, August 3, 2016 at 1:57:43 PM UTC+5:30, Antoon Pardon wrote: > Op 02-08-16 om 14:29 schreef Rustom Mody: > > So I was talking of 3 very different levels: > > > > 1. print x vs print(x) > > — a difference too petty for me to waste my time with > > > > 2. Procedure vs Function as somethi

Re: Why not allow empty code blocks?

2016-08-03 Thread Steven D'Aprano
On Wednesday 03 August 2016 05:22, Paul Rubin wrote: >> The Halting Problem is easily solved for Bloop languages: they always >> halt. > > If Bloop is powerful enough to "solve the halting problem" as you > describe, that gives it capabilities that Turing-complete languages > lack. (Of course it

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-03 Thread BartC
On 03/08/2016 06:43, Steven D'Aprano wrote: Not everything that is done is worth the cognitive burden of memorising a special case. In some ways, Python is a more minimalist language than you like. That's okay, you're allowed to disagree with some design decisions. Well it's minimalist

Re: Why not allow empty code blocks?

2016-08-03 Thread Rustom Mody
On Wednesday, August 3, 2016 at 12:53:02 AM UTC+5:30, Paul Rubin wrote: > Steven D'Aprano writes: > > where power is defined (rather fuzzily) as the expressiveness > > of the language, how easy it is for the programmer to read, write and > > maintain code, how efficient/fast you can implement it,

Re: Why not allow empty code blocks?

2016-08-03 Thread Antoon Pardon
Op 02-08-16 om 14:29 schreef Rustom Mody: > So I was talking of 3 very different levels: > > 1. print x vs print(x) > — a difference too petty for me to waste my time with > > 2. Procedure vs Function as something very necessary for beginner > thinking-ontology which Pascal gets right > > 3. The fa

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Steven D'Aprano
On Wednesday 03 August 2016 05:14, BartC wrote: > It's fundamental in that, when giving instructions or commands in > English, it frequently comes up when you want something done a set > number of times: > > "Give me 20 push-ups" At which point the person will invariable drop to the ground and s

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 02/08/2016 22:27, Terry Reedy wrote: On 8/2/2016 7:05 AM, BartC wrote: Your objection to a feature such as 'repeat N' doesn't really stack up. My objection is that there is a real cost that MUST be stacked up against the benefit. ... Anyway, if that was a valid objection, it would apply

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Paul Rubin
Terry Reedy writes: > I think it is you who is unwilling to admit that nearly everything > that would be useful also has a cost, and that the ultimate cost of > adding every useful feature, especially syntax features, would be to > make python less unusable. I think you meant "usable" ;). Some o

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Terry Reedy
On 8/2/2016 7:05 AM, BartC wrote: On 31/07/2016 19:58, Terry Reedy wrote: On 7/31/2016 6:18 AM, BartC wrote: repeat N: The benefit is not so much performance, but being able to express something very easily and quickly. The cost of the 'repeat' contraction is that one cannot use the loo

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Chris Angelico
On Wed, Aug 3, 2016 at 5:55 AM, Christian Gollwitzer wrote: >> - Arbitrary-precision non-integers > > > https://pypi.python.org/pypi/bigfloat/ > > ? Wasn't aware of that. Cool. Not that I need it very often (and when I do, I can use Pike, which has MPFR support built-in). Or I can use decimal.Dec

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Christian Gollwitzer
Am 02.08.16 um 16:58 schrieb Chris Angelico: - A more free-form declarative syntax for laying out GUI code Actually, the Tkinter wrapper misses one feature of grid in Tcl/Tk: You can write something like grid .a .b grid .c .d to lay out a GUI 2x2 grid using "ASCII-art". There is a package i

Re: Why not allow empty code blocks?

2016-08-02 Thread Julien Salort
Steven D'Aprano wrote: > It could be, but won't be. Outside of a very few tiny niches, including > Squeak which is designed for children, such user-interfaces are far too > cumbersome to ever get widespread use. Unfortunately, many people use LabView in my field... even for sufficiently complex

Re: Why not allow empty code blocks?

2016-08-02 Thread Grant Edwards
On 2016-08-02, BartC wrote: > On 02/08/2016 18:54, Steven D'Aprano wrote: >> On Wed, 3 Aug 2016 02:56 am, BartC wrote: >> >>> (And I expect that next they will eliminate languages altogether. All >>> you need is some way of specifying a sequence of calls to library >>> functions and sprinkling aro

Re: Why not allow empty code blocks?

2016-08-02 Thread Paul Rubin
Steven D'Aprano writes: > where power is defined (rather fuzzily) as the expressiveness > of the language, how easy it is for the programmer to read, write and > maintain code, how efficient/fast you can implement it, etc. Scheme guru Matthias Felleisen takes a stab at a precise definition here (

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Chris Angelico
, that can be an important distinction. I don't like seeing code like this: def f(): x = g() y = h(x) return 5 + x What's y for? Why not just call h(x) and ignore its return value? Should the last line say "5 + y"? It looks _wrong_ to have a local variable that's ne

Re: Why not allow empty code blocks?

2016-08-02 Thread BartC
On 02/08/2016 18:54, Steven D'Aprano wrote: On Wed, 3 Aug 2016 02:56 am, BartC wrote: (And I expect that next they will eliminate languages altogether. All you need is some way of specifying a sequence of calls to library functions and sprinkling around some control statements; That would be

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 02/08/2016 18:57, Steven D'Aprano wrote: On Wed, 3 Aug 2016 03:12 am, BartC wrote: That's not a fundamental language feature. Repeat-N is. And if properly designed, isn't an extra feature at all but a special case of a generic loop. Which means it is NOT a fundamental language feature. "R

Re: Why not allow empty code blocks?

2016-08-02 Thread Chris Angelico
for children, such user-interfaces are far too > cumbersome to ever get widespread use. > > But for limited niches, like generating GUIs, form designers, or even > assembling regular expressions, sure, why not? They do exist, and IMO they're languages just as much as textual ones ar

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Steven D'Aprano
On Wed, 3 Aug 2016 03:12 am, BartC wrote: > That's not a fundamental language feature. Repeat-N is. And if properly > designed, isn't an extra feature at all but a special case of a generic > loop. Which means it is NOT a fundamental language feature. "Repeat N without tracking the loop variable

Re: Why not allow empty code blocks?

2016-08-02 Thread Steven D'Aprano
On Tue, 2 Aug 2016 11:28 pm, Rustom Mody wrote: >> I think the real reason is not willing to admit that the language lacks >> something that could actually be useful, and especially not to an >> upstart on usenet who is not even an expert in that language. > > And earlier you said: > >> But dedi

Re: Why not allow empty code blocks?

2016-08-02 Thread Steven D'Aprano
enerating GUIs, form designers, or even assembling regular expressions, sure, why not? -- 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: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 02/08/2016 15:58, Chris Angelico wrote: On Tue, Aug 2, 2016 at 9:05 PM, BartC wrote: I think the real reason is not willing to admit that the language lacks something that could actually be useful, and especially not to an upstart on usenet who is not even an expert in that language. I kno

Re: Why not allow empty code blocks?

2016-08-02 Thread BartC
On 02/08/2016 14:28, Rustom Mody wrote: I think the real reason is not willing to admit that the language lacks something that could actually be useful, and especially not to an upstart on usenet who is not even an expert in that language. However a case may be made that syntax is one of the m

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Chris Angelico
On Tue, Aug 2, 2016 at 9:05 PM, BartC wrote: > I think the real reason is not willing to admit that the language lacks > something that could actually be useful, and especially not to an upstart on > usenet who is not even an expert in that language. I know what features I miss from the languages

Re: Why not allow empty code blocks?

2016-08-02 Thread Rustom Mody
> I think the real reason is not willing to admit that the language lacks > something that could actually be useful, and especially not to an > upstart on usenet who is not even an expert in that language. And earlier you said: > But dedicated forms (even if they just map to 'while' or 'for') wou

Re: Why not allow empty code blocks?

2016-08-02 Thread Rustom Mody
On Tuesday, August 2, 2016 at 4:01:25 PM UTC+5:30, Antoon Pardon wrote: > Op 30-07-16 om 18:15 schreef Rustom Mody: > > > > The more general baby that is significant is that beginners should have > > it easy to distinguish procedure and function and python does not naturally > > aid that. print w

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 31/07/2016 19:58, Terry Reedy wrote: On 7/31/2016 6:18 AM, BartC wrote: repeat N: The benefit is not so much performance, but being able to express something very easily and quickly. The cost of the 'repeat' contraction is that one cannot use the loop variable, either as part of a mod

Re: Why not allow empty code blocks?

2016-08-02 Thread Antoon Pardon
Op 30-07-16 om 18:15 schreef Rustom Mody: > > The more general baby that is significant is that beginners should have > it easy to distinguish procedure and function and python does not naturally > aid that. print was something procedure-ish in python2 but the general > notion being > absent is

Re: Why not allow empty code blocks?

2016-08-02 Thread Antoon Pardon
Op 30-07-16 om 05:49 schreef Steven D'Aprano: > On Sat, 30 Jul 2016 04:32 am, Antoon Pardon wrote: > > > Perhaps its *you* who doesn't understand. The subject line talks > about "empty code blocks", and Bart has suggested that instead of having to > write > > ... > > So now you're changing your sto

Re: Why not allow empty code blocks?

2016-08-01 Thread bartc
On Monday, 1 August 2016 11:12:30 UTC+1, Steven D'Aprano wrote: > On Monday 01 August 2016 18:05, bart4...@gmail.com wrote: > No offense intended Bart, but for all we know every single one of your > benchmarks are faked, your interpreters are buggy pieces of garbage, and for > all your self-pro

Re: Why not allow empty code blocks?

2016-08-01 Thread Marko Rauhamaa
Gordon Levi : > In contrast, your valid email address will become the target of many > spam emails even if you manage to block them. It will also be used as > the source of spam so somebody at vex.net may be fooled into believing > that they are receiving a proper email. Spammers aren't going to c

Re: Why not allow empty code blocks?

2016-08-01 Thread Gordon Levi
"D'Arcy J.M. Cain" wrote: >On Sun, 31 Jul 2016 11:53:47 -0400 >"D'Arcy J.M. Cain" wrote: >> On Mon, 01 Aug 2016 00:25:58 +1000 >> On the other hand I have no throwaway accounts. Every address I use >> is a primary one. I have all sorts of methods to block spam. None of >> those methods involv

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 10:50:20 UTC+1, alister wrote: > Actually the more you make these claims the more I think you are > suffering from NIH (Not Invented Here) syndrome. That's not surprising. I started out developing hardware such as microprocessor boards and video displays. My languages

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 11:12:30 UTC+1, Steven D'Aprano wrote: > On Monday 01 August 2016 18:05, bart4...@gmail.com wrote: > > > You think that my nearly 30 years' experience of designing interpreted > > languages and writing fast bytecode interpreters doesn't make my opinions > > have any more

Re: Why not allow empty code blocks?

2016-08-01 Thread Steven D'Aprano
On Monday 01 August 2016 18:05, bart4...@gmail.com wrote: > You think that my nearly 30 years' experience of designing interpreted > languages and writing fast bytecode interpreters doesn't make my opinions > have any more merit, that's fine. If you are the only one who has ever seen or used the

Re: Why not allow empty code blocks?

2016-08-01 Thread alister
On Mon, 01 Aug 2016 01:05:53 -0700, bart4858 wrote: > On Monday, 1 August 2016 01:33:37 UTC+1, Chris Angelico wrote: >> On Mon, Aug 1, 2016 at 10:21 AM, wrote: > >> > However I do 'drive' as I've been programming for decades. And I can >> > have an opinion about a model of car that I don't nor

Re: Why not allow empty code blocks?

2016-08-01 Thread alister
On Mon, 01 Aug 2016 09:49:46 +1000, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 9:43 AM, wrote: >> On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: >> >>> That said, I wish he'd stop posting his arguments here on this list as >>> he clearly doesn't use Python for anything, and h

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 01:33:37 UTC+1, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 10:21 AM, wrote: > > However I do 'drive' as I've been programming for decades. And I can have > > an opinion about a model of car that I don't normally drive. An opinion > > which you might well not get f

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 01:22:02 UTC+1, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 10:11 AM, wrote: > > (128MB or 128KB? In the 1980s we were all running in 64KB to 640KB of > > memory. 128MB might be what a well-endowed mainframe might have had!) > > Yes, and we didn't have Python then.

Re: Why not allow empty code blocks?

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 12:09 PM, Paul Rubin wrote: > Chris Angelico writes: >> But out of 20MB, I easily had *space* for a compiler. The problem was >> compilation time. I could mess around in BASIC with reasonable >> turnaround times; I could mess around in DEBUG with excellent >> turnaround tim

Re: Why not allow empty code blocks?

2016-07-31 Thread Paul Rubin
Chris Angelico writes: > But out of 20MB, I easily had *space* for a compiler. The problem was > compilation time. I could mess around in BASIC with reasonable > turnaround times; I could mess around in DEBUG with excellent > turnaround times. Doing even the tiniest work in C meant delays long > e

Re: Why not allow empty code blocks?

2016-07-31 Thread Gene Heskett
On Sunday 31 July 2016 12:39:00 Dennis Lee Bieber wrote: > On Mon, 01 Aug 2016 01:31:42 +1000, Steven D'Aprano > > > declaimed the following: > >And you know what? That's fine. It's *good* that there are language > >designers with different ideas of what's valuable. That gives us a > > rich eco-s

Re: Why not allow empty code blocks?

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 10:55 AM, Paul Rubin wrote: > Chris Angelico writes: >> Yes, and we didn't have Python then. When I had a computer with 640KB >> of memory, my options were (1) BASIC or (2) 8086 assembly language, >> using DEBUG.EXE and its mini-assembler. Later on (much much later), I >> a

Re: Why not allow empty code blocks?

2016-07-31 Thread Paul Rubin
Chris Angelico writes: > Yes, and we didn't have Python then. When I had a computer with 640KB > of memory, my options were (1) BASIC or (2) 8086 assembly language, > using DEBUG.EXE and its mini-assembler. Later on (much much later), I > added C to the available languages, but it was tedious and

Re: Why not allow empty code blocks?

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 10:21 AM, wrote: > On Monday, 1 August 2016 00:50:09 UTC+1, Chris Angelico wrote: >> On Mon, Aug 1, 2016 at 9:43 AM, wrote: >> > On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: >> > >> >> That said, I wish he'd stop posting his arguments here on this list

Re: Why not allow empty code blocks?

2016-07-31 Thread bart4858
On Monday, 1 August 2016 00:50:09 UTC+1, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 9:43 AM, wrote: > > On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: > > > >> That said, I wish he'd stop posting his arguments here on this list as > >> he clearly doesn't use Python for anythi

Re: Why not allow empty code blocks?

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 10:11 AM, wrote: >> In that same thread, one of the lead Python devs Victor Stinner talks about >> some of his work on embedded devices where he has a hard limit of 128MB for >> *everything*: boot loader, kernel, OS, applications, etc. > > (128MB or 128KB? In the 1980s we w

Re: Why not allow empty code blocks?

2016-07-31 Thread bart4858
On Sunday, 31 July 2016 16:31:56 UTC+1, Steven D'Aprano wrote: > On Sun, 31 Jul 2016 08:18 pm, BartC wrote: > The whole point of an optimizing compiler is that you don't have to detect > patterns yourself. The compiler does it. There's a whole science to writing > optimizing compilers these days,

Re: Why not allow empty code blocks?

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 9:43 AM, wrote: > On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: > >> That said, I wish he'd stop posting his arguments here on this list as >> he clearly doesn't use Python for anything, and hasn't used Python for >> any real amount of coding. He has no ve

Re: Why not allow empty code blocks?

2016-07-31 Thread bart4858
On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: > That said, I wish he'd stop posting his arguments here on this list as > he clearly doesn't use Python for anything, and hasn't used Python for > any real amount of coding. He has no vested interest in Python so why > should his opi

Re: Why not allow empty code blocks?

2016-07-31 Thread Michael Torrie
On 07/31/2016 10:04 AM, D'Arcy J.M. Cain wrote: > On Sun, 31 Jul 2016 11:53:47 -0400 > "D'Arcy J.M. Cain" wrote: >> On Mon, 01 Aug 2016 00:25:58 +1000 >> On the other hand I have no throwaway accounts. Every address I use >> is a primary one. I have all sorts of methods to block spam. None of >

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 4:58 AM, Terry Reedy wrote: > > As for the original topic: Guido judged that a uniform rule "Compound > statement headers end with ':' and the next line has an additional indent" > would make correct code easier to write and parse and make it visually more > obvious. Some P

Re: Why not allow empty code blocks?

2016-07-31 Thread Jan Erik Moström
On 31 Jul 2016, at 19:22, Steven D'Aprano wrote: On Mon, 1 Aug 2016 12:25 am, Gordon Levi wrote: I admire those who use a valid email address on Usenet but it is an open invitation for spammers. I doubt if there is anybody who uses their primary email address. Spammers have moved on from U

Debugging (was Re: Why not allow empty code blocks?)

2016-07-31 Thread Terry Reedy
On 7/31/2016 6:18 AM, BartC wrote: The costs are near zero: at minimum, a syntactic construct such as: repeat N: that expands to: for _ in range(N): The benefit is not so much performance, but being able to express something very easily and quickly. The cost of the 'repeat' contraction i

  1   2   3   4   5   6   7   8   9   10   >