On 2018-06-25, Alister wrote:
> for i in range(len(list)): is a python anti-pattern it is almost a 100%
> guarantee that you are doing something wrong*
>
> *as with all rules of thumb there is probably at least 1
> exception that the python experts will now point out.
When you need look-ahead or
On 27/06/2018 12:42, Peter J. Holzer wrote:
On 2018-06-27 11:11:37 +1200, Gregory Ewing wrote:
Bart wrote:
x = set(range(10_000_000))
This used up 460MB of RAM (the original 100M I tried exhausted the memory).
The advantage of Pascal-style sets is that that same set will occupy
only 1.25M
On 2018-06-27 11:11:37 +1200, Gregory Ewing wrote:
> Bart wrote:
> >x = set(range(10_000_000))
> >
> > This used up 460MB of RAM (the original 100M I tried exhausted the memory).
> >
> > The advantage of Pascal-style sets is that that same set will occupy
> > only 1.25MB, as it is a bit-map.
Bart wrote:
I don't know whether there is a direct equivalent in Python (I thought
somebody would point it out)
Not built-in, but a tiny bit of googling turns this up:
https://pypi.org/project/bitarray/
"This module provides an object type which efficiently represents an array of
booleans. B
Bart wrote:
x = set(range(10_000_000))
This used up 460MB of RAM (the original 100M I tried exhausted the memory).
The advantage of Pascal-style sets is that that same set will occupy
only 1.25MB, as it is a bit-map.
That's true, but they're also extremely limited compared to
the things y
On 26/06/18 12:39, Chris Angelico wrote:
On Tue, Jun 26, 2018 at 9:30 PM, Bart wrote:
On 19/06/2018 11:33, Steven D'Aprano wrote:
On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
* Integer sets (Pascal-like sets)
Why do you need them if you have real sets?
I tried Python sets for the f
From: Mark Lawrence
On 25/06/18 17:15, jkn wrote:
> On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote:
>> On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote:
>>> (as well as pedanticism ;-o).
>>
>> Pedantry.
>>
>> ChrisA
>> (You know I can't let that one pass.)
>
> I was chanel[l]ing t
From: Mark Lawrence
On 25/06/18 10:10, Alister via Python-list wrote:
> On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote:
>
>> i think he means like for a loop to iterate over a list you might do
>>
>> list = [1,2,3]
>> for i in range(len(list)):
>> print(list[i])
>>
>>
>>
From: Mark Lawrence
On 24/06/18 00:44, boB Stepp wrote:
> I imagine that the
> transition from version 2 to 3 was not undertaken halfheartedly, but
> only after much thought and discussion since it did break backwards
> compatibility.
>
So much so that a specific mailing list was set up just to
To: boB Stepp
From: "Bart"
To: boB Stepp
From: Bart
On 24/06/2018 16:37, boB Stepp wrote:
> On Sun, Jun 24, 2018 at 5:21 AM Bart wrote:
> "... And of course, you would have to know how to use Python properly in
> idiomatic style.
No. I want to program in /my/ style, one more like the pse
To: Chris Angelico
From: "Bart"
To: Chris Angelico
From: Bart
On 24/06/2018 15:46, Chris Angelico wrote:
> On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano
> wrote:
>> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
>>
>>> I wonder why it is just me that constantly needs to justify his
>>>
To: Steven D'Aprano
From: Rick Johnson
On Monday, June 25, 2018 at 5:56:04 AM UTC-5, Steven D'Aprano wrote:
> Nearly everybody misses the fact that the Zen is a joke,
> not to be taken *too* seriously. A particularly subtle
> joke, but still a joke.
The Python Zen is not merely a joke. But it
To: Steven D'Aprano
From: "Rick Johnson"
To: Steven D'Aprano
From: Rick Johnson
On Sunday, June 24, 2018 at 10:05:14 AM UTC-5, Steven D'Aprano wrote: [...]
> Be fair. It's more like 50% of the time. Let's not dogpile
> onto Bart. He asked a question, I answered it, we don't all
> need to si
To: Steven D'Aprano
From: "Stefan Ram"
To: Steven D'Aprano
From: r...@zedat.fu-berlin.de (Stefan Ram)
Steven D'Aprano writes:
>It has been a long, long time since Python has been a "simple" language
>suitable for rank beginners, if it ever was. Python is not Scratch.
Python is simpler in
To: Ben Bacarisse
From: "Bart"
To: Ben Bacarisse
From: Bart
On 24/06/2018 01:53, Ben Bacarisse wrote:
> Bart writes:
>> Wow. (Just think of all the times you write a function containing a
>> neat bunch of local functions, every time it's called it has to create
>> a new function instances
To: boB Stepp
From: "Bart"
To: boB Stepp
From: Bart
On 24/06/2018 00:44, boB Stepp wrote:
> On Sat, Jun 23, 2018 at 5:35 PM Bart wrote:
>> I'm not a user...
>
> Then I am truly puzzled, Bart. Why do you even bother to hang out on
> this list? If you do not want to use Python and you do
To: Bart
From: "Gregory Ewing"
To: Bart
From: Gregory Ewing
Bart wrote:
> But 40 years
> ago it was just 'readln a,b,c'; it was just taken for granted.
The problem with something like that is that it's really only useful for
throwaway code. For any serious application, you need to deal wit
To: Bart
From: "Gregory Ewing"
To: Bart
From: Gregory Ewing
Bart wrote:
> Wow. (Just think of all the times you write a function containing a neat
> bunch of local functions, every time it's called it has to create a new
> function instances for each of those functions, even if they are not
To: boB Stepp
From: "Bart"
To: boB Stepp
From: Bart
On 23/06/2018 20:52, boB Stepp wrote:
> I've finally found time to examine this rather long, rambling thread.
>> There is a place for various levels of programming language. I'm saying that
Python which is always touted as a 'simple' lang
To: Bart
From: "Ben Bacarisse"
To: Bart
From: Ben Bacarisse
Bart writes:
> On 23/06/2018 23:25, Ben Bacarisse wrote:
>> Bart writes:
>>
>>> On 23/06/2018 21:13, Chris Angelico wrote:
On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>>>
> (At what point would that happen anyway; if
To: Bart
From: "Ben Bacarisse"
To: Bart
From: Ben Bacarisse
Bart writes:
> On 23/06/2018 21:13, Chris Angelico wrote:
>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>
>>> (At what point would that happen anyway; if you do this:
>
>> NONE of your examples are taking copies of the functi
To: Ben Bacarisse
From: "Bart"
To: Ben Bacarisse
From: Bart
On 23/06/2018 23:25, Ben Bacarisse wrote:
> Bart writes:
>
>> On 23/06/2018 21:13, Chris Angelico wrote:
>>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>>
(At what point would that happen anyway; if you do this:
>>
>>> NO
To: Chris Angelico
From: "Bart"
To: Chris Angelico
From: Bart
On 23/06/2018 21:13, Chris Angelico wrote:
> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>> (At what point would that happen anyway; if you do this:
> NONE of your examples are taking copies of the function. They all are
> m
To: Chris Angelico
From: jkn
On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote:
> On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote:
> > (as well as pedanticism ;-o).
>
> Pedantry.
>
> ChrisA
> (You know I can't let that one pass.)
I was chanel[l]ing the TimBot, as any fule kno...
To: Mark Lawrence
From: Alister
On Mon, 25 Jun 2018 11:42:27 +0100, Mark Lawrence wrote:
> On 25/06/18 10:10, Alister via Python-list wrote:
>> On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote:
>>
>>> i think he means like for a loop to iterate over a list you might do
>>>
>>
From: Chris Angelico
On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote:
> (as well as pedanticism ;-o).
Pedantry.
ChrisA
(You know I can't let that one pass.)
--- BBBS/Li6 v4.10 Toy-3
* Origin: Prism bbs (1:261/38)
--
https://mail.python.org/mailman/listinfo/python-list
To: Paul Moore
From: jkn
On Monday, June 25, 2018 at 12:17:29 PM UTC+1, Paul Moore wrote:
> On 25 June 2018 at 11:53, Steven D'Aprano
> wrote:
>
> > And the specific line you reference is *especially* a joke, one which
> > flies past nearly everyone's head:
> >
> > There should be one-- and p
From: Grant Edwards
On 2018-06-25, Steven D'Aprano wrote:
> And the specific line you reference is *especially* a joke, one which
> flies past nearly everyone's head:
>
> There should be one-- and preferably only one --obvious way to do it.
>
> Notice the dashes? There are *two* traditional wa
From: Steven D'Aprano
On Sun, 24 Jun 2018 10:46:09 -0700, Jim Lee wrote:
> On 06/24/2018 04:35 AM, Steven D'Aprano wrote:
>>
>> Indeed. That's one of the beauties of Python -- even when there's an
>> advanced way to do it, there's generally a simple way too.
>>
>>
> What happened to the Python m
From: Paul Moore
On 25 June 2018 at 11:53, Steven D'Aprano
wrote:
> And the specific line you reference is *especially* a joke, one which
> flies past nearly everyone's head:
>
> There should be one-- and preferably only one --obvious way to do it.
>
>
> Notice the dashes? There are *two* tradi
To: Steven D'Aprano
From: Bart
On 25/06/2018 01:52, Steven D'Aprano wrote:
> On Sun, 24 Jun 2018 21:21:57 +0100, Bart wrote:
>
>> I've had half a dozen users
>
> Come back when you've had *half a million users* then we'll take your
> experiences seriously.
That being the case with Python (mayb
To: Abdur-Rahmaan Janhangeer
From: Alister
On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote:
> i think he means like for a loop to iterate over a list you might do
>
> list = [1,2,3]
> for i in range(len(list)):
> print(list[i])
>
>
> but the you might as well go for the
From: Abdur-Rahmaan Janhangeer
we must maybe fibd an example where both are pythonic but one is simpler unless
my type of example was intented by @steve
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
>
--- BBBS/Li6 v4.10 Toy-3
* Origin: Prism bbs (1:261/38)
--
https://mail.pyth
From: Jim Lee
On 06/24/2018 04:35 AM, Steven D'Aprano wrote:
>
> Indeed. That's one of the beauties of Python -- even when there's an
> advanced way to do it, there's generally a simple way too.
>
>
What happened to the Python maxim "There should be oneΓ ÷and preferably only
oneΓ ÷obvious way t
From: Abdur-Rahmaan Janhangeer
i think he means like for a loop to iterate over a list you might do
list = [1,2,3]
for i in range(len(list)):
print(list[i])
but the you might as well go for the simpler :
for elem in list:
print(elem)
Abdur-Rahmaan Janhangeer
https://github.com/Abd
From: Steven D'Aprano
On Sun, 24 Jun 2018 21:21:57 +0100, Bart wrote:
> I've had half a dozen users
Come back when you've had *half a million users* then we'll take your
experiences seriously.
https://blog.pythonanywhere.com/67/
https://stackoverflow.blog/2017/09/06/incredible-growth-python/
To: Steven D'Aprano
From: Bart
On 24/06/2018 20:02, Steven D'Aprano wrote:
> On Sun, 24 Jun 2018 19:37:33 +0100, Bart wrote:
>
>> I want to program in /my/ style
>
> Python is not Java, and Java is not Python either. Nor is it "Bart's
> Language", or C, or Forth, or Lisp, or bash.
>
> https://d
To: Stefan Ram
From: r...@zedat.fu-berlin.de (Stefan Ram)
r...@zedat.fu-berlin.de (Stefan Ram) writes:
>Still, one must not forget that learning Python encompasses
>all the hard work it takes to learn how to program in every
>language.
"Beginner", however, is a very vague term. A good scienti
From: Abdur-Rahmaan Janhangeer
naaa it was not meant to be python ^^
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
>
>
--- BBBS/Li6 v4.10 Toy-3
* Origin: Prism bbs (1:261/38)
--
https://mail.python.org/mailman/listinfo/python-list
To: Stefan Ram
From: "Bart"
To: Stefan Ram
From: Bart
On 23/06/2018 14:32, Stefan Ram wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>> def f():
>> def g():
>> g.x += 1
>> return g.x
>> g.x = 0
>> return g
>
>Or, "for all g to share the same x":
>
>
To: Stefan Ram
From: "Stefan Ram"
To: Stefan Ram
From: r...@zedat.fu-berlin.de (Stefan Ram)
r...@zedat.fu-berlin.de (Stefan Ram) writes:
>def f():
>def g():
>g.x += 1
>return g.x
>g.x = 0
>return g
Or, "for all g to share the same x":
main.py
def f():
d
To: Steven D'Aprano
From: "Stefan Ram"
To: Steven D'Aprano
From: r...@zedat.fu-berlin.de (Stefan Ram)
Steven D'Aprano writes:
>def f():
>static x = 0
>def g():
>x += 1
>return x
>return g
What one can do today:
main.py
def g():
g.x += 1
return g.x
To: Steven D'Aprano
From: "Bart"
To: Steven D'Aprano
From: Bart
On 23/06/2018 04:51, Steven D'Aprano wrote:
> On Wed, 20 Jun 2018 14:18:19 +1000, Chris Angelico wrote:
>
>> Ah. Yeah, that would be a plausible feature to add to Python. But in C,
>> a static variable is basically the same thi
From: "Chris Angelico"
From: Chris Angelico
On Sat, Jun 23, 2018 at 1:51 PM, Steven D'Aprano
wrote:
> On Wed, 20 Jun 2018 14:18:19 +1000, Chris Angelico wrote:
>
>> Ah. Yeah, that would be a plausible feature to add to Python. But in C,
>> a static variable is basically the same thing as a glo
From: "Chris Angelico"
From: Chris Angelico
On Sat, Jun 23, 2018 at 2:16 PM, Chris Angelico wrote:
> For getting rid of the "len=len" trick, though, I would REALLY like to
> transform those into LOAD_CONST. That'd be a fun bytecode hack all on
> its own. In fact, I'm gonna have a shot at that.
From: "Steven D'Aprano"
From: Steven D'Aprano
On Wed, 20 Jun 2018 14:18:19 +1000, Chris Angelico wrote:
> Ah. Yeah, that would be a plausible feature to add to Python. But in C,
> a static variable is basically the same thing as a global variable,
> except that its name is scoped to the functi
From: Richard Damon
On 6/24/18 3:02 PM, Steven D'Aprano wrote:
> On Sun, 24 Jun 2018 19:37:33 +0100, Bart wrote:
>
>> I want to program in /my/ style
> Python is not Java, and Java is not Python either. Nor is it "Bart's
> Language", or C, or Forth, or Lisp, or bash.
>
> https://dirtsimple.org/20
To: Abdur-Rahmaan Janhangeer
From: Bart
On 24/06/2018 19:36, Abdur-Rahmaan Janhangeer wrote:
> see for example
>
> https://en.m.wikipedia.org/wiki/Bresenham%27s_line_algorithm
>
> see the pseudocode, i was implementing some raster algos when i found
> myself aux anges
>
> so close to py. i gues
From: Steven D'Aprano
On Sun, 24 Jun 2018 19:37:33 +0100, Bart wrote:
> I want to program in /my/ style
Python is not Java, and Java is not Python either. Nor is it "Bart's Language",
or C, or Forth, or Lisp, or bash.
https://dirtsimple.org/2004/12/python-is-not-java.html
https://dirtsimple.
From: Terry Reedy
On 6/24/2018 11:39 AM, Bart wrote:
Bart, I agree that people should not dogpile onto you. As with Rick, I read
your posts or not, depending on whether I feel like being entertained at the
moment, and usually move on without comment.
> I know I'm going to get flak for bringing
On 26-06-18 14:47, Bart wrote:
>
> [About bitsets]
>
> Here's the set of characters allowed in a C identifier (not using
> Python syntax):
>
> cident = {'A'..'Z', 'a'..'z', '0'..'9', '_', '9'}
>
> The characters allowed in a hex constant:
>
> {'0'..'9', 'A'..'F', 'a'..'f'}
>
> A set representin
On 26/06/2018 12:39, Chris Angelico wrote:
On Tue, Jun 26, 2018 at 9:30 PM, Bart wrote:
On 19/06/2018 11:33, Steven D'Aprano wrote:
On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
* Integer sets (Pascal-like sets)
Why do you need them if you have real sets?
I tried Python sets for the
On Tue, Jun 26, 2018 at 9:30 PM, Bart wrote:
> On 19/06/2018 11:33, Steven D'Aprano wrote:
>>
>> On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
>
>
>> * Integer sets (Pascal-like sets)
>>
>> Why do you need them if you have real sets?
>
>
> I tried Python sets for the first time. They seemed work
On 19/06/2018 11:33, Steven D'Aprano wrote:
On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
* Integer sets (Pascal-like sets)
Why do you need them if you have real sets?
I tried Python sets for the first time. They seemed workable but rather
clunky to set up. But here is one problem on my
On Mon, 25 Jun 2018 18:22:56 +, Grant Edwards wrote:
> On 2018-06-24, Steven D'Aprano wrote:
>
>> Building functions is cheap. Cheap is not free.
>>
>> Inner functions that aren't exposed to the outside cannot be tested in
>> isolation, you can't access them through help() interactively. Giv
On Mon, Jun 25, 2018 at 2:37 AM Mark Lawrence wrote:
>
> On 24/06/18 00:44, boB Stepp wrote:
> > I imagine that the
> > transition from version 2 to 3 was not undertaken halfheartedly, but
> > only after much thought and discussion since it did break backwards
> > compatibility.
> >
>
> So much so
On Tue, Jun 26, 2018 at 6:04 AM, Grant Edwards
wrote:
> On 2018-06-24, Steven D'Aprano wrote:
>
>> That's nothing, there are languages where the standard way to write
>> a for loop is to call an external program that generates a stream of
>> numeric strings separated by spaces in a subprocess, an
On 2018-06-24, Steven D'Aprano wrote:
> That's nothing, there are languages where the standard way to write
> a for loop is to call an external program that generates a stream of
> numeric strings separated by spaces in a subprocess, and read the
> strings from standard input as text.
What langu
Grant Edwards :
> IOW, you use a local function instead of a global one for the exact
> same reasons you use local "variables" instead of global ones.
>
> In Python, functions are first class objects. Binding a name to a
> function is no different than binding it to an integer, list, string,
> or
On 2018-06-24, Steven D'Aprano wrote:
> Building functions is cheap. Cheap is not free.
>
> Inner functions that aren't exposed to the outside cannot be tested
> in isolation, you can't access them through help()
> interactively. Given the choice between:
[...]
> so not expensive, but not free
To: boB Stepp
From: Bart
On 24/06/2018 16:37, boB Stepp wrote:
> On Sun, Jun 24, 2018 at 5:21 AM Bart wrote:
> "... And of course, you would have to know how to use Python properly in
> idiomatic style.
No. I want to program in /my/ style, one more like the pseudo-code that was
mentioned els
From: Abdur-Rahmaan Janhangeer
see for example
https://en.m.wikipedia.org/wiki/Bresenham%27s_line_algorithm
see the pseudocode, i was implementing some raster algos when i found myself
aux anges
so close to py. i guess it was written in prehistoric times with the author
trying to simplify stuf
From: Chris Angelico
On Mon, Jun 25, 2018 at 2:23 AM, Abdur-Rahmaan Janhangeer
wrote:
> Python is rightly called executable pseudocode. i appreciated the fact that
> you can go on wikipaedia, find the pseudocode of algorithms remove curly
> braces and replace by py's more powerful syntax and po
From: Chris Angelico
On Mon, Jun 25, 2018 at 1:02 AM, Steven D'Aprano
wrote:
> On Mon, 25 Jun 2018 00:46:00 +1000, Chris Angelico wrote:
>
>> On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano
>> wrote:
>>> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
>>>
I wonder why it is just me that c
From: Steven D'Aprano
On Sun, 24 Jun 2018 16:39:19 +0100, Bart wrote:
> More like utter disbelief at how it works. Surely it cannot work like
> that because it would be too inefficient? Apparently, yes it can...
Apparently, no it doesn't, because the fact that Python is used by tens of
thousand
From: boB Stepp
On Sun, Jun 24, 2018 at 5:21 AM Bart wrote:
>
> On 24/06/2018 00:44, boB Stepp wrote:
> > On Sat, Jun 23, 2018 at 5:35 PM Bart wrote:
>
> >> I'm not a user...
> >
> > Then I am truly puzzled, Bart. Why do you even bother to hang out on
> > this list? If you do not want to use
To: Steven D'Aprano
From: Rick Johnson
On Sunday, June 24, 2018 at 10:05:14 AM UTC-5, Steven D'Aprano wrote: [...]
> Be fair. It's more like 50% of the time. Let's not dogpile
> onto Bart. He asked a question, I answered it, we don't all
> need to sink the boot in as well.
And why am i _not_ s
From: Abdur-Rahmaan Janhangeer
Python is rightly called executable pseudocode. i appreciated the fact that you
can go on wikipaedia, find the pseudocode of algorithms remove curly braces
and replace by py's more powerful syntax and poof, suddenly it becomes too
easy.
Abdur-Rahmaan Janhangeer
h
From: Steven D'Aprano
On Mon, 25 Jun 2018 00:46:00 +1000, Chris Angelico wrote:
> On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano
> wrote:
>> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
>>
>>> I wonder why it is just me that constantly needs to justify his
>>> existence in this group?
>>
>
To: Chris Angelico
From: Bart
On 24/06/2018 15:46, Chris Angelico wrote:
> On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano
> wrote:
>> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
>>
>>> I wonder why it is just me that constantly needs to justify his
>>> existence in this group?
>>
>> Beca
From: Chris Angelico
On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano
wrote:
> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
>
>> I wonder why it is just me that constantly needs to justify his
>> existence in this group?
>
> Because its just you who spends 90% of his time here complaining abo
From: Steven D'Aprano
On Sat, 23 Jun 2018 14:52:24 -0500, boB Stepp wrote:
[...]
>> There is a place for various levels of programming language. I'm saying
>> that Python which is always touted as a 'simple' language suitable for
>> beginners, is missing a surprising number of basics.
>
> I stil
To: Steven D'Aprano
From: r...@zedat.fu-berlin.de (Stefan Ram)
Steven D'Aprano writes:
>It has been a long, long time since Python has been a "simple" language
>suitable for rank beginners, if it ever was. Python is not Scratch.
Python is simpler insofar as you can write on a higher level
To: Ben Bacarisse
From: Bart
On 24/06/2018 01:53, Ben Bacarisse wrote:
> Bart writes:
>> Wow. (Just think of all the times you write a function containing a
>> neat bunch of local functions, every time it's called it has to create
>> a new function instances for each of those functions, even
From: Steven D'Aprano
On Sun, 24 Jun 2018 11:23:12 +0100, Bart wrote:
> On 24/06/2018 01:53, Ben Bacarisse wrote:
>> Bart writes:
>
>>> Wow. (Just think of all the times you write a function containing a
>>> neat bunch of local functions, every time it's called it has to create
>>> a new functi
From: Steven D'Aprano
On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
> I wonder why it is just me that constantly needs to justify his
> existence in this group?
Because its just you who spends 90% of his time here complaining about how
Python does it wrong.
--
Steven D'Aprano
"Ever since I
To: boB Stepp
From: Bart
On 24/06/2018 00:44, boB Stepp wrote:
> On Sat, Jun 23, 2018 at 5:35 PM Bart wrote:
>> I'm not a user...
>
> Then I am truly puzzled, Bart. Why do you even bother to hang out on
> this list? If you do not want to use Python and you do not want to
> improve Python's
From: Steven D'Aprano
On Sat, 23 Jun 2018 18:29:51 +0100, MRAB wrote:
> You can already do something similar like this:
>
> def f():
> f.x += 1
> return f.x
> f.x = 0
>
> [snip]
You can, but only as an illustration, not as a serious implementation.
The whole point of static local v
From: Steven D'Aprano
On Sat, 23 Jun 2018 21:44:00 +0100, Bart wrote:
> Since these references are created via the return g statement here:
>
> def f():
> def g():
>
> return g
>
> (say to create function references i and j like this:
>
> i = f()
>
From: Steven D'Aprano
On Sun, 24 Jun 2018 00:37:36 +0100, Bart wrote:
> Do you mean that if the same 'def' block is re-executed, it will create
> a different instance of the function? (Same byte-code, but a different
> set of everything else the function uses.)
That's not as slow as you think i
To: Bart
From: Gregory Ewing
Bart wrote:
> Wow. (Just think of all the times you write a function containing a neat
> bunch of local functions, every time it's called it has to create a new
> function instances for each of those functions, even if they are not used.)
Fortunately, function obje
From: boB Stepp
On Sat, Jun 23, 2018 at 5:35 PM Bart wrote:
>
> On 23/06/2018 20:52, boB Stepp wrote:
> The first programming exercise I ever did involved asking for three
> numbers, then determining whether those numbers could form the sides of
> a triangle.
>
> Then [40 years ago], the easy p
From: Steven D'Aprano
On Sat, 23 Jun 2018 23:26:43 +0100, Bart wrote:
> Then [40 years ago], the easy part was reading the three numbers. Now
> that would be the more challenging part.
# Get three numbers, separated by spaces, with no error-recovery.
# If you try to read bad data, the process w
To: Bart
From: Gregory Ewing
Bart wrote:
> But 40 years
> ago it was just 'readln a,b,c'; it was just taken for granted.
The problem with something like that is that it's really only useful for
throwaway code. For any serious application, you need to deal with the
possibility of malformed inpu
From: Chris Angelico
On Sun, Jun 24, 2018 at 9:37 AM, Bart wrote:
> On 23/06/2018 23:25, Ben Bacarisse wrote:
>>
>> Bart writes:
>>
>>> On 23/06/2018 21:13, Chris Angelico wrote:
On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>>>
>>>
> (At what point would that happen anyway; if y
To: boB Stepp
From: Bart
On 23/06/2018 20:52, boB Stepp wrote:
> I've finally found time to examine this rather long, rambling thread.
>> There is a place for various levels of programming language. I'm saying that
Python which is always touted as a 'simple' language suitable for beginners, is
To: Bart
From: Ben Bacarisse
Bart writes:
> On 23/06/2018 23:25, Ben Bacarisse wrote:
>> Bart writes:
>>
>>> On 23/06/2018 21:13, Chris Angelico wrote:
On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>>>
> (At what point would that happen anyway; if you do this:
>>>
NONE of your
To: Bart
From: Ben Bacarisse
Bart writes:
> On 23/06/2018 21:13, Chris Angelico wrote:
>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>
>>> (At what point would that happen anyway; if you do this:
>
>> NONE of your examples are taking copies of the function. They all are
>> making REFERENC
To: Ben Bacarisse
From: Bart
On 23/06/2018 23:25, Ben Bacarisse wrote:
> Bart writes:
>
>> On 23/06/2018 21:13, Chris Angelico wrote:
>>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>>
(At what point would that happen anyway; if you do this:
>>
>>> NONE of your examples are taking copi
From: boB Stepp
I've finally found time to examine this rather long, rambling thread.
On Wed, Jun 20, 2018 at 5:46 AM wrote:
>
> Yeah, people keep bringing that up when they run out of arguments.
>
> So, every programmer must always use the most advanced, most esoteric
features possible at ever
To: Chris Angelico
From: Bart
On 23/06/2018 21:13, Chris Angelico wrote:
> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
>> (At what point would that happen anyway; if you do this:
> NONE of your examples are taking copies of the function. They all are
> making REFERENCES to the same functio
From: Chris Angelico
On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote:
> This is an example of a simple concept getting so out of hand that it will
> either never be implemented, or the resulting implementation becomes
> impractical to use.
>
> This is what we're trying to do:
>
> def nextx():
>
On 25/06/18 17:15, jkn wrote:
On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote:
On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote:
(as well as pedanticism ;-o).
Pedantry.
ChrisA
(You know I can't let that one pass.)
I was chanel[l]ing the TimBot, as any fule kno...
Ritten b
On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote:
> On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote:
> > (as well as pedanticism ;-o).
>
> Pedantry.
>
> ChrisA
> (You know I can't let that one pass.)
I was chanel[l]ing the TimBot, as any fule kno...
--
https://mail.python.org/mai
On Mon, 25 Jun 2018 11:42:27 +0100, Mark Lawrence wrote:
> On 25/06/18 10:10, Alister via Python-list wrote:
>> On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote:
>>
>>> i think he means like for a loop to iterate over a list you might do
>>>
>>> list = [1,2,3]
>>> for i in range
On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote:
> (as well as pedanticism ;-o).
Pedantry.
ChrisA
(You know I can't let that one pass.)
--
https://mail.python.org/mailman/listinfo/python-list
On 2018-06-25, Steven D'Aprano wrote:
> And the specific line you reference is *especially* a joke, one which
> flies past nearly everyone's head:
>
> There should be one-- and preferably only one --obvious way to do it.
>
> Notice the dashes? There are *two* traditional ways to use an pair
> o
On Monday, June 25, 2018 at 12:17:29 PM UTC+1, Paul Moore wrote:
> On 25 June 2018 at 11:53, Steven D'Aprano
> wrote:
>
> > And the specific line you reference is *especially* a joke, one which
> > flies past nearly everyone's head:
> >
> > There should be one-- and preferably only one --obvious
On 25/06/18 10:10, Alister via Python-list wrote:
On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote:
i think he means like for a loop to iterate over a list you might do
list = [1,2,3]
for i in range(len(list)):
print(list[i])
but the you might as well go for the simple
On 25 June 2018 at 11:53, Steven D'Aprano
wrote:
> And the specific line you reference is *especially* a joke, one which
> flies past nearly everyone's head:
>
> There should be one-- and preferably only one --obvious way to do it.
>
>
> Notice the dashes? There are *two* traditional ways to use
1 - 100 of 340 matches
Mail list logo