Re: why del is not a function or method?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 04:07 pm, Steve D'Aprano wrote: > [1] Except in the loosest sense that any use of words to refer to a concept > is a reference, e.g. the words "Queen Elizabeth" is a reference to the > current monarch of the UK, Elizabeth Windsor. Oops, ignore this footnote! It belonged to a p

Re: why del is not a function or method?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 02:40 pm, Ben Finney wrote: > Steve D'Aprano writes: >> `del` cannot be a method or a function, because the argument to `del` >> is the name of the variable, not the contents of the variable. > > Since a Python “variable” does not have contents, this is IMO another > instanc

Re: Searching For Old Posts On Python

2017-10-16 Thread Cai Gengyang
https://duckduckgo.com/html/?q=%22Cai%20Gengyang%22%20python This seems to be the only method that works, using DuckDuckGo On Tue, Oct 17, 2017 at 4:54 AM, Thomas Jollans wrote: > On 16/10/17 22:04, Cai Gengyang wrote: > > I cannot remember where I posted the question it was a while ag

Re: Logging module stopped working

2017-10-16 Thread Chris Angelico
On Tue, Oct 17, 2017 at 3:06 PM, llanitedave wrote: > I'm building an application that contains some long-running operations in a > separate thread from the user interface. I've been using the logging module > writing logging.info() statements to a .log file to keep track of the data > interac

Re: how to read in the newsreader

2017-10-16 Thread Byung-Hee HWANG (황병희, 黃炳熙)
Andrew Z 께서 쓰시길, 《記事 全文 에서》: > Gents, > how do i get this group in a newsreader? The digest i'm getting is not > workable for me - i can't reply , can only read the replies from the > members of the group. Or. maybe, it shouldn't be a news reader > please advise.. > > P.S. Oh the comp.lang

Logging module stopped working

2017-10-16 Thread llanitedave
I'm building an application that contains some long-running operations in a separate thread from the user interface. I've been using the logging module writing logging.info() statements to a .log file to keep track of the data interactions while it runs. In the midst of a recent run, the loggi

Re: why del is not a function or method?

2017-10-16 Thread Ben Finney via Python-list
Steve D'Aprano writes: > On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: > > > That doesn't explain why `del` isn't a method though. > > `del` cannot be a method or a function, because the argument to `del` > is the name of the variable, not the contents of the variable. Since a Python “varia

Re: why del is not a function or method?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 01:12 pm, Ned Batchelder wrote: > On 10/16/17 9:06 PM, bartc wrote: >> On 17/10/2017 01:53, Steve D'Aprano wrote: [...] >>> `del` is kind of like an "anti-assignment" in that the argument to >>> `del` must >>> be exactly the same sort of expression that can appear on the left >

Re: why del is not a function or method?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 03:55 am, Oren Ben-Kiki wrote: > True... technically, "Deletion of a name removes the binding of that name > from the local or global namespace". Using `x.del()` can't do that. Indeed -- not without introducing magic special syntax into the parser, and effectively treating ".d

Re: Cooperative class tree filtering

2017-10-16 Thread Ian Kelly
On Mon, Oct 16, 2017 at 8:20 PM, Ian Kelly wrote: > On Thu, Oct 12, 2017 at 5:07 PM, Alberto Berti > wrote: >> I would really like to find a way to do this that doesn't involve >> decorating the methods in A subclasses to free the final developer to >> remember to import the decorator and apply

Re: Cooperative class tree filtering

2017-10-16 Thread Ian Kelly
On Thu, Oct 12, 2017 at 5:07 PM, Alberto Berti wrote: > Now, what i ideally want is to get rid of that super() call at the end of > the methods in classes B and c and to code that "fallback to what my > superclass says" coded into A's implementation, where it kicks in if the > method in the target

Re: why del is not a function or method?

2017-10-16 Thread Ned Batchelder
On 10/16/17 9:06 PM, bartc wrote: On 17/10/2017 01:53, Steve D'Aprano wrote: On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: That doesn't explain why `del` isn't a method though. `del` cannot be a method or a function, because the argument to `del` is the name of the variable, not the

Re: how to read in the newsreader

2017-10-16 Thread Cameron Simpson
On 15Oct2017 22:50, Andrew Z wrote: how do i get this group in a newsreader? The digest i'm getting is not workable for me - i can't reply , can only read the replies from the members of the group. Or. maybe, it shouldn't be a news reader please advise.. P.S. Oh the comp.lang.python is a ni

Re: why del is not a function or method?

2017-10-16 Thread bartc
On 17/10/2017 01:53, Steve D'Aprano wrote: On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: That doesn't explain why `del` isn't a method though. `del` cannot be a method or a function, because the argument to `del` is the name of the variable, not the contents of the variable. If we writ

Re: why del is not a function or method?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 08:57 am, Thomas Jollans wrote: > On 16/10/17 21:12, Stefan Ram wrote: >> r...@zedat.fu-berlin.de (Stefan Ram) writes: >>> »x = None« observably has not the same effect as »del x«: >> >> Paradoxically, /deleting/ a local variable which did not >> ever exist, has the effect

Re: right list for SIGABRT python binary question ?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 07:32 am, Karsten Hilbert wrote: > Hi all, > > is this the right list to ask for help in debugging a > SIGABORT (?) happening on shutdown of a Python 2.7 script ? > > If not, which one is ? > > Karsten You should try here first. Please ensure you read and follow this first

Re: why del is not a function or method?

2017-10-16 Thread Steve D'Aprano
On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: > That doesn't explain why `del` isn't a method though. `del` cannot be a method or a function, because the argument to `del` is the name of the variable, not the contents of the variable. If we write: x = 123 del x then `del` needs t

Re: Strange behavior in string interpolation of constants

2017-10-16 Thread Ned Batchelder
On 10/16/17 7:39 PM, מיקי מונין wrote: Hello, I am working on an article on python string formatting. As a part of the article I am researching the different forms of python string formatting. While researching string interpolation(i.e. the % operator) I noticed something weird with string lengt

Strange behavior in string interpolation of constants

2017-10-16 Thread מיקי מונין
Hello, I am working on an article on python string formatting. As a part of the article I am researching the different forms of python string formatting. While researching string interpolation(i.e. the % operator) I noticed something weird with string lengths. Given two following two functions:

right list for SIGABRT python binary question ?

2017-10-16 Thread Karsten Hilbert
Hi all, is this the right list to ask for help in debugging a SIGABORT (?) happening on shutdown of a Python 2.7 script ? If not, which one is ? Karsten -- GPG key ID E4071346 @ eu.pool.sks-keyservers.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 -- https://mail.python.org/mailman/lis

[Python] [JOB] Python developer at JRC

2017-10-16 Thread Alfredo Branco
Hello everyone, I writing just to let you know that European Commission Joint Research Center [1] is looking for a developer to work in Ispra (Varese - Italy) The profile required is as follow: Very good knowledge of Python and R Good English language knowledge A knowledge of one or more

Re: Searching For Old Posts On Python

2017-10-16 Thread MRAB
On 2017-10-16 21:04, Cai Gengyang wrote: I cannot remember where I posted the question it was a while ago .. You posted on Sat, 07 Oct 2017 23:42:10 UTC. On Mon, Oct 16, 2017 at 5:12 PM, Thomas Jollans wrote: On 2017-10-16 11:01, Cai Gengyang wrote: > Does anyone here know a way I can

Re: how to read in the newsreader

2017-10-16 Thread Mikhail V
Thomas wrote: > > On 16/10/17 20:02, Pete Forman wrote: > > Thomas Jollans writes: > > ... > >>> If you do stick with a digest then check your newsreader for a feature > >>> to expand it. Then you can read and reply as if you were getting > >>> individual posts. > >>> > >> That exists? How does it

Re: how to read in the newsreader

2017-10-16 Thread Thomas Jollans
On 16/10/17 20:02, Pete Forman wrote: > Thomas Jollans writes: > >> On 2017-10-16 08:48, Pete Forman wrote: >>> Andrew Z writes: >>> hmm. i did do that. maybe just a delay. I'll see how it will go tomorrow then. Thank you gents. On Mon, Oct 16, 2017 at 12:30 AM, Chris Angeli

Re: why del is not a function or method?

2017-10-16 Thread Thomas Jollans
On 16/10/17 21:12, Stefan Ram wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: >> »x = None« observably has not the same effect as »del x«: > > Paradoxically, /deleting/ a local variable which did not > ever exist, has the effect of creating a ghost of that > local variable which then w

Re: Searching For Old Posts On Python

2017-10-16 Thread Thomas Jollans
On 16/10/17 22:04, Cai Gengyang wrote: > I cannot remember where I posted the question it was a while ago .. > > On Mon, Oct 16, 2017 at 5:12 PM, Thomas Jollans > wrote: > > On 2017-10-16 11:01, Cai Gengyang wrote: > > Does anyone here know a way I can search fo

Re: Searching For Old Posts On Python

2017-10-16 Thread Cai Gengyang
On Tuesday, October 17, 2017 at 4:05:16 AM UTC+8, Cai Gengyang wrote: > I cannot remember where I posted the question it was a while ago .. > > On Mon, Oct 16, 2017 at 5:12 PM, Thomas Jollans wrote: > > > On 2017-10-16 11:01, Cai Gengyang wrote: > > > Does anyone here know a way I can searc

Re: Searching For Old Posts On Python

2017-10-16 Thread Cai Gengyang
I cannot remember where I posted the question it was a while ago .. On Mon, Oct 16, 2017 at 5:12 PM, Thomas Jollans wrote: > On 2017-10-16 11:01, Cai Gengyang wrote: > > Does anyone here know a way I can search for and display all my old > posts on Python ? Thanks a lot. > > > > Gengyang >

Re: why del is not a function or method?

2017-10-16 Thread bartc
On 16/10/2017 18:46, Michael Torrie wrote: On 10/16/2017 11:21 AM, bartc wrote: del x effectively removes it from the namespace so trying to use it on line 4 generates the same 'undefined' error. However, the byte-code still needs to be aware of x: at the time when line 1 is executed, the byte-

Re: An endless loop

2017-10-16 Thread bartc
On 16/10/2017 18:53, Stefan Ram wrote: Ian Kelly writes: I honestly can't remember the last time I programmed an endless loop, and I also can't remember the last time I used a while loop. Those two things are probably related. My Python installation has a "Lib" directory. »^ +\bwhile\b

Re: how to read in the newsreader

2017-10-16 Thread Pete Forman
Thomas Jollans writes: > On 2017-10-16 08:48, Pete Forman wrote: >> Andrew Z writes: >> >>> hmm. i did do that. maybe just a delay. >>> I'll see how it will go tomorrow then. Thank you gents. >>> >>> On Mon, Oct 16, 2017 at 12:30 AM, Chris Angelico wrote: >>> On Mon, Oct 16, 2017 at 3:19

Re: why del is not a function or method?

2017-10-16 Thread Peter Otten
Stefan Ram wrote: > Peter Otten <__pete...@web.de> writes: >>team.pop(2) >>Stefan's explanation may work for >>del x >>if you discard >>x = None # get rid of the huge object that x was bound to before >>as a hack > > »x = None« observably has not the same effect as »del x«: > > |>>> x = 2; x

Re: why del is not a function or method?

2017-10-16 Thread Michael Torrie
On 10/16/2017 11:21 AM, bartc wrote: > del x effectively removes it from the namespace so trying to use it on > line 4 generates the same 'undefined' error. > > However, the byte-code still needs to be aware of x: at the time when > line 1 is executed, the byte-code for line 3 already exists and

Re: why del is not a function or method?

2017-10-16 Thread Oren Ben-Kiki
The first line says "The major reason is history." :-) But it also gives an explanation: providing functionality for types that, at the time, didn't have methods. On Mon, Oct 16, 2017 at 8:33 PM, Lele Gaifax wrote: > Oren Ben-Kiki writes: > > > So I still think it was a matter of preference rat

Re: why del is not a function or method?

2017-10-16 Thread Lele Gaifax
Oren Ben-Kiki writes: > So I still think it was a matter of preference rather than a pure technical > consideration. But that's all second-guessing, anyway. You'd have to ask > Guido what his reasoning was... A rationale is briefly stated in the design FAQs, see https://docs.python.org/3/faq/des

Re: why del is not a function or method?

2017-10-16 Thread bartc
On 16/10/2017 17:55, Oren Ben-Kiki wrote: True... technically, "Deletion of a name removes the binding of that name from the local or global namespace". Using `x.del()` can't do that. That said, I would hazard to guess that `del x` is pretty rare (I have never felt the need for it myself). Ruby

Re: An endless loop

2017-10-16 Thread Ian Kelly
On Sat, Oct 14, 2017 at 8:10 PM, Stefan Ram wrote: > I made an error I made a thousand times before. > > I had programmed an endless loop. > > But never did I see before so clear why it's called > an endless loop. (Tested in IDLE.) > > from turtle import * > > reset(); reset(); shape( 'tur

Re: why del is not a function or method?

2017-10-16 Thread Oren Ben-Kiki
True... technically, "Deletion of a name removes the binding of that name from the local or global namespace". Using `x.del()` can't do that. That said, I would hazard to guess that `del x` is pretty rare (I have never felt the need for it myself). Ruby doesn't even have an equivalent operation, a

Re: why del is not a function or method?

2017-10-16 Thread Ned Batchelder
On 10/16/17 12:16 PM, Oren Ben-Kiki wrote: That doesn't explain why `del` isn't a method though. Intuitively, `my_dict.delete(some_key)` makes sense as a method. Of course, you could also make the same case for `len` being a method... and personally I think it would have been cleaner that way in

Re: why del is not a function or method?

2017-10-16 Thread Skip Montanaro
> What about del team[2]? > > There is no name involved here, and even a reference to team[2] won't help. (I'm not sure quite what question is asking. Apologies if my assumption was incorrect.) That is precisely why del is a statement. At byte-compile time, both "team" and "2" are available. The

Re: why del is not a function or method?

2017-10-16 Thread Peter Otten
bartc wrote: > On 16/10/2017 16:58, Stefan Ram wrote: >> Xue Feng writes: >>> I wonder why 'del' is not a function or method. >> >>Assume, >> >> x = 2. >> >>When a function »f« is called with the argument »x«, >>this is written as >> >> f( x ) >> >>. The function never gets t

Re: why del is not a function or method?

2017-10-16 Thread Chris Angelico
On Tue, Oct 17, 2017 at 3:18 AM, Stefan Ram wrote: > bartc writes: >>What about del team[2]? > > All arguments of a call are evaluated before the callable > called then is incarnated with the values obtained. Assume, > »team[ 2 ]« is bound to »8«. Then, the call > > f( team[ 2 ])« > > is

Re: why del is not a function or method?

2017-10-16 Thread Chris Angelico
On Tue, Oct 17, 2017 at 3:07 AM, bartc wrote: > On 16/10/2017 16:58, Stefan Ram wrote: >> >> Xue Feng writes: >>> >>> I wonder why 'del' is not a function or method. >> >> >>Assume, >> >> x = 2. >> >>When a function »f« is called with the argument »x«, >>this is written as >> >> f( x

Re: why del is not a function or method?

2017-10-16 Thread Oren Ben-Kiki
That doesn't explain why `del` isn't a method though. Intuitively, `my_dict.delete(some_key)` makes sense as a method. Of course, you could also make the same case for `len` being a method... and personally I think it would have been cleaner that way in both cases. But it is a minor issue, if at al

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
Marko Rauhamaa wrote: > Chris Green : > > > I read newsgroups using tin, a text-mode/command line newsreader. I > > always run tin on my home desktop machine, even if I'm away from home > > by using ssh. So I maintain my settings that way. By the way tin *is* > > mouse away even though it's a tex

Re: why del is not a function or method?

2017-10-16 Thread bartc
On 16/10/2017 16:58, Stefan Ram wrote: Xue Feng writes: I wonder why 'del' is not a function or method. Assume, x = 2. When a function »f« is called with the argument »x«, this is written as f( x ) . The function never gets to see the name »x«, just its boundee (value) »2«.

Re: how to read in the newsreader

2017-10-16 Thread Marko Rauhamaa
Chris Green : > I read newsgroups using tin, a text-mode/command line newsreader. I > always run tin on my home desktop machine, even if I'm away from home > by using ssh. So I maintain my settings that way. By the way tin *is* > mouse away even though it's a text mode program. > > For reading mai

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
Paul Moore wrote: > On 16 October 2017 at 15:41, Grant Edwards wrote: > > On 2017-10-16, Terry Reedy wrote: > >> On 10/15/2017 10:50 PM, Andrew Z wrote: > >>> Gents, > >>> how do i get this group in a newsreader? > >> > >> Point your newsreader to news.gmane.org, > > > > That, IMO, is the only

why del is not a function or method?

2017-10-16 Thread Xue Feng via Python-list
Hi, I wonder why 'del' is not a function or method. Most operations can be used as follows len(team) or team.append("tom") But, I think del team[2] is somewhat uncommon. Why does not it take a syntax we are famillar with? -- https://mail.python.

Re: how to read in the newsreader

2017-10-16 Thread Rhodri James
On 16/10/17 16:07, Grant Edwards wrote: Ah yes. I solved problem that by writing a wrapper around slrn so that my .newsrc and .score files reside "in the could". ^ Now there's a typo someone should run with :-) -- Rhodri James *-* Kynesim

Re: how to read in the newsreader

2017-10-16 Thread Michael Torrie
On 10/16/2017 08:52 AM, Paul Moore wrote: > For that situation, reading mailing lists as mails in gmail is the > best option I've been able to find (not ideal, but adequate). > Paul Gmail's web interface is completely broken as far as mailing lists are concerned. Conversation view in no way is ad

Re: how to read in the newsreader

2017-10-16 Thread Paul Moore
On 16 October 2017 at 16:07, Grant Edwards wrote: > On 2017-10-16, Paul Moore wrote: >> Unless you work regularly on multiple PCs, as there's no newsreader I >> know of that maintains your settings (what articles you have read, in >> particular) across multiple installations. > > Ah yes. I solve

Re: how to read in the newsreader

2017-10-16 Thread Grant Edwards
On 2017-10-16, Paul Moore wrote: > On 16 October 2017 at 15:41, Grant Edwards wrote: >> On 2017-10-16, Terry Reedy wrote: >>> On 10/15/2017 10:50 PM, Andrew Z wrote: Gents, how do i get this group in a newsreader? >>> >>> Point your newsreader to news.gmane.org, >> >> That, IMO, is t

Re: how to read in the newsreader

2017-10-16 Thread Paul Moore
On 16 October 2017 at 15:41, Grant Edwards wrote: > On 2017-10-16, Terry Reedy wrote: >> On 10/15/2017 10:50 PM, Andrew Z wrote: >>> Gents, >>> how do i get this group in a newsreader? >> >> Point your newsreader to news.gmane.org, > > That, IMO, is the only sane way to read mailing lists. If

Re: how to read in the newsreader

2017-10-16 Thread Grant Edwards
On 2017-10-16, Terry Reedy wrote: > On 10/15/2017 10:50 PM, Andrew Z wrote: >> Gents, >> how do i get this group in a newsreader? > > Point your newsreader to news.gmane.org, That, IMO, is the only sane way to read mailing lists. If a mailing list isn't carried on gmane, I don't bother with it

Re: how to read in the newsreader

2017-10-16 Thread Ned Batchelder
On 10/16/17 12:31 AM, Andrew Z wrote: i'm typing without thinking. Sorry. Let me try again. I subscribed to python-list@python.org. That has 0 spam ( as far as i can see), but i can only get a digest. You can choose to get individual messages from Python-List. --Ned. -- https://mail.python.o

Re: Searching For Old Posts On Python

2017-10-16 Thread Steve D'Aprano
On Mon, 16 Oct 2017 08:01 pm, Cai Gengyang wrote: > Does anyone here know a way I can search for and display all my old posts on > Python ? Thanks a lot. > > Gengyang Repeating the answers you already got: Make a site specific search for your name here https://mail.python.org/pipermail/pytho

Re: Searching For Old Posts On Python

2017-10-16 Thread Steve D'Aprano
On Mon, 16 Oct 2017 08:12 pm, Thomas Jollans wrote: > On 2017-10-16 11:01, Cai Gengyang wrote: >> Does anyone here know a way I can search for and display all my old posts >> on Python ? Thanks a lot. >> >> Gengyang >> > > You already asked this recently. You received good answers. Yes, but he

Re: how to read in the newsreader

2017-10-16 Thread Terry Reedy
On 10/15/2017 10:50 PM, Andrew Z wrote: Gents, how do i get this group in a newsreader? Point your newsreader to news.gmane.org, group gmane.comp.python.general, which mirrors python-list, among hundreds or thousands of other lists. If you check the headers of this message, you should see

Re: how to read in the newsreader

2017-10-16 Thread alister via Python-list
On Mon, 16 Oct 2017 08:57:18 +0100, Chris Green wrote: > Michael Torrie wrote: >> On 10/15/2017 08:50 PM, Andrew Z wrote: >> > Gents, >> > how do i get this group in a newsreader? The digest i'm getting is >> > not >> > workable for me - i can't reply , can only read the replies from the >> > m

Re: Searching For Old Posts On Python

2017-10-16 Thread Thomas Jollans
On 2017-10-16 11:01, Cai Gengyang wrote: > Does anyone here know a way I can search for and display all my old posts on > Python ? Thanks a lot. > > Gengyang > You already asked this recently. You received good answers. -- https://mail.python.org/mailman/listinfo/python-list

Re: Searching For Old Posts On Python

2017-10-16 Thread Louis Krupp
On Mon, 16 Oct 2017 02:01:37 -0700 (PDT), Cai Gengyang wrote: >Does anyone here know a way I can search for and display all my old posts on >Python ? Thanks a lot. This might be what you're looking for: https://groups.google.com/forum/#!search/cai$20gengyang$20python Louis -- https://mail.py

Searching For Old Posts On Python

2017-10-16 Thread Cai Gengyang
Does anyone here know a way I can search for and display all my old posts on Python ? Thanks a lot. Gengyang -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Thomas Jollans
On 2017-10-16 08:48, Pete Forman wrote: > Andrew Z writes: > >> hmm. i did do that. maybe just a delay. >> I'll see how it will go tomorrow then. Thank you gents. >> >> On Mon, Oct 16, 2017 at 12:30 AM, Chris Angelico wrote: >> >>> On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z wrote: Michael,

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
Michael Torrie wrote: > On 10/15/2017 08:50 PM, Andrew Z wrote: > > Gents, > > how do i get this group in a newsreader? The digest i'm getting is not > > workable for me - i can't reply , can only read the replies from the > > members of the group. Or. maybe, it shouldn't be a news reader > >