Re: Python and the need for speed

2017-04-13 Thread Christian Gollwitzer
Am 13.04.17 um 15:20 schrieb Marko Rauhamaa: Not sure if this is still valid: Still today Flash RAM cells built in SSDs have a limited lifespan. Every write (not read) cycle or better every erasure wears a memory cell and at some time it will stop working. https://askubuntu.com/que

Re: Python and the need for speed

2017-04-13 Thread Steve D'Aprano
On Fri, 14 Apr 2017 12:13 pm, Steve D'Aprano wrote: > There are a bazillion ugly, unreadable, unproductive but slow languages if > you want them: Er, I mean *fast*. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Friday, April 14, 2017 at 7:15:11 AM UTC+5:30, 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. >

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Rustom Mody
On Friday, April 14, 2017 at 7:03:24 AM UTC+5:30, Steve D'Aprano wrote: > On Fri, 14 Apr 2017 04:09 am, Rustom Mody wrote: > > [Sorry its a vague memory of something I read more than a decade ago that > > [I cant > > trace again] > > Some unknown Cobol programmer talking about Dijkstra: > > > > D

Re: Python and the need for speed

2017-04-13 Thread Rustom Mody
On Friday, April 14, 2017 at 7:43:22 AM UTC+5:30, Steve D'Aprano wrote: > On Wed, 12 Apr 2017 07:56 pm, bart wrote: > > > The problem is also the language encouraging people to use high-level but > > inefficient methods, as the emphasis is on productivity and readability** > > rather than performa

Re: Python and the need for speed

2017-04-13 Thread Steve D'Aprano
On Wed, 12 Apr 2017 07:56 pm, bart4...@gmail.com wrote: > The problem is also the language encouraging people to use high-level but > inefficient methods, as the emphasis is on productivity and readability** > rather than performance. I'm sorry, but that is in no way "the problem". Emphasising

Re: "Goto" statement in Python

2017-04-13 Thread Steve D'Aprano
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 back in time to 1975 again? The Goto Wars are over, and th

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Steve D'Aprano
On Fri, 14 Apr 2017 04:09 am, Rustom Mody wrote: > On Thursday, April 13, 2017 at 11:14:15 PM UTC+5:30, Steve D'Aprano wrote: >> Meyer's "Considered Harmful Essays Considered Harmful" essay is >> hypocritical junk, and should be considered harmful. > > Your view. Well duh :-) > Here's an alter

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Roel Schroeven wrote, on Thursday, April 13, 2017 5:26 PM > > Gregory Ewing schreef op 13/04/2017 9:34: > > Deborah Swanson wrote: > >> Peter Otten wrote, on Wednesday, April 12, 2017 1:45 PM > >> > >>> Personally I would immediately discard the header row > once and for > >>> all, not again and

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Gregory Ewing wrote, on Thursday, April 13, 2017 1:14 AM > > Deborah Swanson wrote: > > I don't exactly understand your point (2). If the > namedtuple does not > > have a label attribute, then getattr(record, label) will > get the error > > whether the name label holds the string 'label' or no

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Gregory Ewing wrote, on Thursday, April 13, 2017 12:34 AM > > Deborah Swanson wrote: > > Peter Otten wrote, on Wednesday, April 12, 2017 1:45 PM > > > >> Personally I would immediately discard the header row once and for > >> all, not again and again on every operation. > > > > Well, perhaps, b

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Gregory Ewing wrote, on Thursday, April 13, 2017 12:36 AM > > If you want to be able to update your rows, you may find > this useful: > https://pypi.python.org/pypi/recordclass It's very similar to a namedtuple, but mutable. Looks like it should be a drop-in replacement. -- Greg Thanks Greg,

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 12:51 PM, Nathan Ernst wrote: > Thank you for that Alan Kay quote. Brightened up my day. Since you also > mentioned COBOL, and this is a thread about "goto", reminded me of the > single most abhorrent thing I ever saw in COBOL (I had to convert a single > COBOL batch proces

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Gregory Ewing wrote, on Thursday, April 13, 2017 12:17 AM > > Deborah Swanson wrote: > > But I think you got it right in your last sentence below. > defaultdict > > copied them because they were immutable, > > No, definitely not. A defaultdict will never take it upon > itself to copy an object

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Peter Otten wrote, on Thursday, April 13, 2017 12:17 AM > > Deborah Swanson wrote: > > > Peter Otten wrote, on Wednesday, April 12, 2017 11:35 PM > >> > >> Deborah Swanson wrote: > >> > >> > It's a small point, but I suspect getattr(record, label) > >> would still > >> > fail, even if label's v

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 4:59 PM, bartc wrote: > On 13/04/2017 22:58, Ian Kelly wrote: >> >> On Thu, Apr 13, 2017 at 3:27 PM, Dennis Lee Bieber >> wrote: >>> >>> On Thu, 13 Apr 2017 15:52:24 +0100, bartc declaimed the >>> following: >>> 'goto' would be one easy-to-execute byte-code; no varia

Re: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Roel Schroeven
Gregory Ewing schreef op 13/04/2017 9:34: Deborah Swanson wrote: Peter Otten wrote, on Wednesday, April 12, 2017 1:45 PM Personally I would immediately discard the header row once and for all, not again and again on every operation. Well, perhaps, but I need the header row to stay in place to

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 22:58, Ian Kelly wrote: On Thu, Apr 13, 2017 at 3:27 PM, Dennis Lee Bieber wrote: On Thu, 13 Apr 2017 15:52:24 +0100, bartc declaimed the following: 'goto' would be one easy-to-execute byte-code; no variables, objects or types to worry about. If implemented properly (with the b

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 3:27 PM, Dennis Lee Bieber wrote: > On Thu, 13 Apr 2017 15:52:24 +0100, bartc declaimed the > following: > >>'goto' would be one easy-to-execute byte-code; no variables, objects or >>types to worry about. If implemented properly (with the byte-code >>compiler using a dedic

Re: "Goto" statement in Python

2017-04-13 Thread Marko Rauhamaa
Rob Gaddi : > On 04/13/2017 08:26 AM, Marko Rauhamaa wrote: >> I have occasionally felt the urge to try "goto" in my C code, but having >> written it, I have taken it out. It just doesn't make the code look more >> elegant or robust. Unlike "break" or "return," "goto" makes me uneasy >> about vari

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Nathan Ernst
Thank you for that Alan Kay quote. Brightened up my day. Since you also mentioned COBOL, and this is a thread about "goto", reminded me of the single most abhorrent thing I ever saw in COBOL (I had to convert a single COBOL batch process to ASP.Net as an intern back in 2003-4). "MOVE NEXT SENTENCE"

Re: Check multiple file parms in single os.access?

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 1:46 PM, Ben Bacarisse wrote: > James McMahon writes: > >> Is there a way to mask the F_OK, R_OK, and W_OK in a single os.access >> call? I'm guessing there must be, rather than doing this >> >> if ( os.access(fqfname,os.F_OK) and os.access(fqfname,os.R_OK) and >> os.acces

Re: "Goto" statement in Python

2017-04-13 Thread Grant Edwards
On 2017-04-13, Rob Gaddi wrote: > No, C doesn't support exception handling. As a result, handling error > conditions in C is a huge pain for which (forward-only) goto is often, > while not the only remedy, the least painful one. Indeed. That is almost the only place I use 'goto' in C, and the

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Larry Martell
On Thu, Apr 13, 2017 at 2:09 PM, Rustom Mody wrote: > Or consider(!) Alan Kay's statement: "Arrogance in computer science is > measured > in nanodijktras" Completely unrelated but it reminded me about this bon mot about Niklaus Wirth: Europeans tend to pronounce his name properly, as Nih-klaus

Re: Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:14:15 PM UTC+5:30, Steve D'Aprano wrote: > Meyer's "Considered Harmful Essays Considered Harmful" essay is hypocritical > junk, and should be considered harmful. Your view. Here's an alternative. [Sorry its a vague memory of something I read more than a decade ago

Re: "Goto" statement in Python

2017-04-13 Thread Mikhail V
On 13 April 2017 at 19:38, Ian Kelly wrote: > On Thu, Apr 13, 2017 at 11:25 AM, Mikhail V wrote: >> On 13 April 2017 at 18:48, Ian Kelly wrote: >>> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: Now I wonder, have we already collected *all* bells and whistles of Python in these tw

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:19:38 PM UTC+5:30, Ian wrote: > On Thu, Apr 13, 2017 at 11:39 AM, Rustom Mody wrote: > > My broader point (vive la Trump) was that if we learn to actively tolerate > > people with views wildly far from ours, the world would be a better place. > > I fail to see how

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 11:39 AM, Rustom Mody wrote: > My broader point (vive la Trump) was that if we learn to actively tolerate > people with views wildly far from ours, the world would be a better place. I fail to see how my comment "Functions and exceptions are considered 'bells and whistles'

Re: "Goto" statement in Python

2017-04-13 Thread Rob Gaddi
On 04/13/2017 08:26 AM, Marko Rauhamaa wrote: Chris Angelico : Personally, I can't remember the last time I yearned for "goto" in Python, and the only times I've ever wished for it or used it in other languages have been multi-loop breaks or "for...else" blocks. And neither is very frequent.

Re: Python and the need for speed

2017-04-13 Thread MRAB
On 2017-04-13 09:08, Steven D'Aprano wrote: On Wed, 12 Apr 2017 16:30:38 -0700, bart4858 wrote: (Although I think Python would have difficulty in turning x+=1 into a single opcode, if using normal object references and a shared object model.) You know, since Python actually exists and isn't j

Goto Considered Harmful [was Re: Python and the need for speed]

2017-04-13 Thread Steve D'Aprano
On Wed, 12 Apr 2017 10:44 am, Nathan Ernst wrote: > goto is a misunderstood and much misaligned creature. It is a very useful > feature, but like nearly any programming construct can be abused. Indeed. The problem is that it is abused far more often than it is used correctly -- or at least it was

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 10:56:53 PM UTC+5:30, Rob Gaddi wrote: > On 04/13/2017 10:13 AM, Rustom Mody wrote: > > On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: > >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > >>> Now I wonder, have we already collected *all* bells a

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 11:25 AM, Mikhail V wrote: > On 13 April 2017 at 18:48, Ian Kelly wrote: >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: >>> Now I wonder, have we already collected *all* bells and whistles of Python >>> in these two examples, or is there something else for expressi

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 11:13 AM, Rustom Mody wrote: > What to do?? > Ask Trump? > [I guess we now need a Godwin 2.0 with :s/Hitler/Trump ] Not even close. Whatever one's opinion may be of Trump, he hasn't murdered millions of people. -- https://mail.python.org/mailman/listinfo/python-list

Re: "Goto" statement in Python

2017-04-13 Thread Rob Gaddi
On 04/13/2017 10:13 AM, Rustom Mody wrote: On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: Now I wonder, have we already collected *all* bells and whistles of Python in these two examples, or is there something else for express

Re: "Goto" statement in Python

2017-04-13 Thread Thomas Nyberg
On 04/12/2017 04:42 PM, Mikhail V wrote: > For me it looks clear and I'd say easy to comprehend, > Main critic would be obviously that it is not > a good, *scalable application*, but quite often I don't > even have this in mind, and just want to express a > step-by-step direct instructions. I thin

Re: "Goto" statement in Python

2017-04-13 Thread Mikhail V
On 13 April 2017 at 18:48, Ian Kelly wrote: > On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: >> Now I wonder, have we already collected *all* bells and whistles of Python >> in these two examples, or is there something else for expressing trivial >> thing. > > Functions and exceptions are co

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 16:03, Ian Kelly wrote: On Thu, Apr 13, 2017 at 8:52 AM, bartc wrote: On 13/04/2017 15:35, Chris Angelico wrote: Personally, I can't remember the last time I yearned for "goto" in Python, and the only times I've ever wished for it or used it in other languages have been multi-loo

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: > On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > > Now I wonder, have we already collected *all* bells and whistles of Python > > in these two examples, or is there something else for expressing trivial > > thing. > > Function

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > Now I wonder, have we already collected *all* bells and whistles of Python > in these two examples, or is there something else for expressing trivial > thing. Functions and exceptions are considered "bells and whistles"? -- https://mail.pytho

Re: "Goto" statement in Python

2017-04-13 Thread Mikhail V
On 13 April 2017 at 02:17, Rob Gaddi wrote: > > def finder: > for s in S: > if s == 'i': > return 'found on stage 1' > > S = S + ' hello world' > for s in S: > if s == 'd': > return 'found on stage 2' > > raise ValueError('not found; S=' + S) > > try: > message = fin

Re: Visit All URLs with selenium python

2017-04-13 Thread John Gordon
In <43f70312-83ba-457e-a83f-7b46e5d2a...@googlegroups.com> Nicole writes: > it just visit first url not all .. Can anybody help how to fix that.. Have you tried some basic debugging, for example printing p_links to verify that it contains what you expected, and then printing each url in the loo

Pylint 1.7.0 was released

2017-04-13 Thread Claudiu Popa
Hey folks, We just released a new version of Pylint, 1.7.0, after a long period of time since the last release. You can find more details about what's new in this release over here: https://pylint.readthedocs.io/en/latest/whatsnew/1.7.html Thanks and enjoy, Claudiu -- https://mail.python.org/m

Re: "Goto" statement in Python

2017-04-13 Thread Marko Rauhamaa
Chris Angelico : > Personally, I can't remember the last time I yearned for "goto" in > Python, and the only times I've ever wished for it or used it in other > languages have been multi-loop breaks or "for...else" blocks. And > neither is very frequent. I have occasionally felt the urge to try "

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 8:24 AM, Chris Warrick wrote: > On 13 April 2017 at 09:43, eryk sun wrote: >> The functions in the operator module implement abstract behavior (e.g. >> PyNumber_Add in CPython): >> >> >>> operator.__add__(C(), D()) >> 42 > > Those functions also do not need undersc

[no subject]

2017-04-13 Thread David Shi via Python-list
Which VCF reader has been well tested and proven to be robust? Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 8:52 AM, bartc wrote: > On 13/04/2017 15:35, Chris Angelico wrote: >> Personally, I can't remember the last time I yearned for "goto" in >> Python, and the only times I've ever wished for it or used it in other >> languages have been multi-loop breaks or "for...else" blocks

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 15:35, Chris Angelico wrote: On Thu, Apr 13, 2017 at 9:31 PM, alister wrote: I expect you could simulate most of these with a custom exception for example break from nested loop: class GoTo(Exception): pass try: for i in range(100): print i for j in range

Re: "Goto" statement in Python

2017-04-13 Thread Chris Angelico
On Thu, Apr 13, 2017 at 9:31 PM, alister wrote: > I expect you could simulate most of these with a custom exception > for example break from nested loop: > > class GoTo(Exception): > pass > > try: > for i in range(100): > print i > for j in range (50): > print j

HOT LIST

2017-04-13 Thread Jack
Hi Hope you doing great! Greeting from Niche Soft Solutions. I would like to present our topnotch consultants currently available. Please have a look at the below hot list of Niche Soft Solutions an

Re: Check multiple file parms in single os.access?

2017-04-13 Thread Ben Bacarisse
James McMahon writes: > Hello. Am a Python newbie. I have researched and found examples how we can > check existence, readability, and write-ability on a given fully-qualified > filename for the current python script user. Evidently os.access is the way > to go, wrapped in some additional try and

Re: Python and the need for speed

2017-04-13 Thread Marko Rauhamaa
Steve D'Aprano : > On Thu, 13 Apr 2017 07:00 pm, Marko Rauhamaa wrote: >> Thing is, the moment you start thrashing, the game is over. > > Indeed. But swapping != thrashing. > > For what it's worth, three of the five sys admins I work with prefer > not to use swap space on the Linux desktops they b

Re: Python and the need for speed

2017-04-13 Thread Steve D'Aprano
On Thu, 13 Apr 2017 07:00 pm, Marko Rauhamaa wrote: > Gregory Ewing : > >> Marko Rauhamaa wrote: >>> As swapping is no longer considered normal on modern computers, >> >> It isn't? When did that happen? > > Thing is, the moment you start thrashing, the game is over. Indeed. But swapping != thra

Re: Swiss Ephemeris

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 2:10:16 PM UTC+5:30, Deborah Swanson wrote: > Rustom Mody wrote, on Monday, April 10, 2017 11:50 PM > > > > On Monday, April 10, 2017 at 11:26:47 AM UTC+5:30, Deborah Swanson > wrote: > > > The great ancients were no less endowed with intelligence than we > are, > >

Re: Reading structured text file (non-CSV) into Pandas Dataframe

2017-04-13 Thread breamoreboy
On Thursday, April 13, 2017 at 11:09:23 AM UTC+1, David Shi wrote: > http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text > The above is a web link to a structured text file.  It is not a CSV. > How can this text file be read

Re: Python and the need for speed

2017-04-13 Thread bartc
On 13/04/2017 12:55, bartc wrote: On 13/04/2017 09:08, Steven D'Aprano wrote: Is it possible to skip the STORE_NAME op-code? If the starting-point is the existing byte-code of a program, then what can be done is more limited. If the optimiser can generate new byte-codes, then it might be po

Re: Python and the need for speed

2017-04-13 Thread bartc
On 13/04/2017 09:08, Steven D'Aprano wrote: On Wed, 12 Apr 2017 16:30:38 -0700, bart4858 wrote: (Although I think Python would have difficulty in turning x+=1 into a single opcode, if using normal object references and a shared object model.) You know, since Python actually exists and isn't j

Check multiple file parms in single os.access?

2017-04-13 Thread James McMahon
Hello. Am a Python newbie. I have researched and found examples how we can check existence, readability, and write-ability on a given fully-qualified filename for the current python script user. Evidently os.access is the way to go, wrapped in some additional try and catch logic that helps insulate

Re: "Goto" statement in Python

2017-04-13 Thread alister
On Thu, 13 Apr 2017 01:42:01 +0200, Mikhail V wrote: > On 12 April 2017 at 02:44, Nathan Ernst wrote: >> goto is a misunderstood and much misaligned creature. It is a very >> useful feature, but like nearly any programming construct can be >> abused. >> >> Constructs like 'break', 'continue' or '

[no subject]

2017-04-13 Thread David Shi via Python-list
13.1. csv — CSV File Reading and Writing — Python 2.7.13 documentation | | | 13.1. csv — CSV File Reading and Writing — Python 2.7.13 documentation | | | I am trying to parse this text file into a table. How to use consecutive 3 spaces to work as delimiter with csv.reader? Looking f

Reading structured text file (non-CSV) into Pandas Dataframe

2017-04-13 Thread David Shi via Python-list
http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text The above is a web link to a structured text file.  It is not a CSV. How can this text file be read into a Pandas Dataframe, so that further processing can be made? Looking

Re: Python and the need for speed

2017-04-13 Thread Brecht Machiels
Bah. My newsreader lost my reply when the WiFi connection dropped out... attempt #2. On 2017-04-12 18:45:16 +, bart4...@gmail.com said: On Wednesday, 12 April 2017 16:04:53 UTC+1, Brecht Machiels wrote: On 2017-04-12 14:46:45 +, Michael Torrie said: It would be great if you could r

Re: Moderating the list [was: Python and the need for speed]

2017-04-13 Thread Tim Golden
On 13/04/2017 03:39, Jason Friedman wrote: However, it's simply a technical fact: the thing which we moderate is the mailing list. We can control which posts make it through from the newsgroup by blocking them at the gateway. But the posts will continue to appear on comp.lang.python which is, a

Re: Merging multiple sorted sequences.

2017-04-13 Thread Erik
On 13/04/17 07:30, Peter Otten wrote: Verdict: not greedy ;) Great (as I mentioned I did look at the code VERY quickly whilst VERY tired and at first glance missed that it's doing almost exactly what my code is doing except using the heapq to manage tracking the smallest value rather than so

Re: Python and the need for speed

2017-04-13 Thread Marko Rauhamaa
Gregory Ewing : > Marko Rauhamaa wrote: >> As swapping is no longer considered normal on modern computers, > > It isn't? When did that happen? Thing is, the moment you start thrashing, the game is over. Doubly so for Python, whose garbage collector will grind your machine to a halt as it is trav

Re: Python and the need for speed

2017-04-13 Thread Marko Rauhamaa
Paul Rubin : > Marko Rauhamaa writes: >> As swapping is no longer considered normal on modern computers, the >> memory-disk duality doesn't seem all that practical anymore. Rather, >> you'd like to treat the disk analogously to network access and keep >> RAM access separate. > > Yep. But opening

Re: Calling dunder methods manually

2017-04-13 Thread Chris Angelico
On Thu, Apr 13, 2017 at 4:18 PM, Rustom Mody wrote: > I believe it was ChrisA who gave a pithy summary of the situation: > Dont CALL dunders > But its fine to DEFINE them As others have mentioned, you call dunders during the definitions of dunders, mainly during subclassing. But from outside the

RE: Swiss Ephemeris

2017-04-13 Thread Deborah Swanson
> > Rustom Mody wrote, on Monday, April 10, 2017 11:50 PM > > > > On Monday, April 10, 2017 at 11:26:47 AM UTC+5:30, Deborah Swanson > > wrote: > > > The great ancients were no less endowed with intelligence than we are, > > > they simply directed it to different ends. > > > > And just when I w

RE: Swiss Ephemeris

2017-04-13 Thread Deborah Swanson
Rustom Mody wrote, on Monday, April 10, 2017 11:50 PM > > On Monday, April 10, 2017 at 11:26:47 AM UTC+5:30, Deborah Swanson wrote: > > The great ancients were no less endowed with intelligence than we are, > > they simply directed it to different ends. > > And just when I was convinced by the a

Re: Python-list Digest, Vol 163, Issue 14

2017-04-13 Thread Colin J. Williams
Thanks Eryk, I have today successfully installed python 3.6.1. Next I have to tackle installing the whl versions of Numpy and Matplotlib. Colin W. On 2017-04-11 11:25 AM, python-list-requ...@python.org wrote: Send Python-list mailing list submissions to python-list@python.org To s

Re: Read a text file into a Pandas DataFrame Table

2017-04-13 Thread breamoreboy
On Thursday, April 13, 2017 at 9:15:18 AM UTC+1, David Shi wrote: > Dear All, > Can anyone help to read a text file into a Pandas DataFrame Table? > Please see the link below. > http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=

Re: Python and the need for speed

2017-04-13 Thread Gregory Ewing
Marko Rauhamaa wrote: As swapping is no longer considered normal on modern computers, It isn't? When did that happen? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Calling dunder methods manually

2017-04-13 Thread Chris Warrick
On 13 April 2017 at 09:43, eryk sun wrote: > The functions in the operator module implement abstract behavior (e.g. > PyNumber_Add in CPython): > > >>> operator.__add__(C(), D()) > 42 Those functions also do not need underscores — operator.add is a prettier way to achieve the same result.

Read a text file into a Pandas DataFrame Table

2017-04-13 Thread David Shi via Python-list
Dear All, Can anyone help to read a text file into a Pandas DataFrame Table? Please see the link below. http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text Regards. David -- https://mail.python.org/mailman/listinfo/python-l

Re: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Gregory Ewing
Deborah Swanson wrote: I don't exactly understand your point (2). If the namedtuple does not have a label attribute, then getattr(record, label) will get the error whether the name label holds the string 'label' or not. You sound rather confused. Maybe the following interactive session transcri

Re: Python and the need for speed

2017-04-13 Thread Steven D'Aprano
On Wed, 12 Apr 2017 16:30:38 -0700, bart4858 wrote: > (Although I think Python would have difficulty in turning x+=1 into a > single opcode, if using normal object references and a shared object > model.) You know, since Python actually exists and isn't just a hypothetical language, we can find

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 5:29 AM, Steven D'Aprano wrote: > > my_number.__add__(another_number) > > The short answer is: > > NO! In general, you shouldn't do it. For example: class C: def __add__(self, other): return NotImplemented class D: def __radd__(self, o

Re: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Gregory Ewing
If you want to be able to update your rows, you may find this useful: https://pypi.python.org/pypi/recordclass It's very similar to a namedtuple, but mutable. Looks like it should be a drop-in replacement. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Gregory Ewing
Deborah Swanson wrote: Peter Otten wrote, on Wednesday, April 12, 2017 1:45 PM Personally I would immediately discard the header row once and for all, not again and again on every operation. Well, perhaps, but I need the header row to stay in place to write the list to a csv when I'm done T

Re: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Gregory Ewing
Deborah Swanson wrote: But I think you got it right in your last sentence below. defaultdict copied them because they were immutable, No, definitely not. A defaultdict will never take it upon itself to copy an object you give it, either as a key or a value. The copying, if any, must have occur

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 5:29 AM, Steven D'Aprano wrote: > Should you call dunder methods (Double leading and trailing UNDERscores) > manually? For example: > > > my_number.__add__(another_number) > > > The short answer is: > > NO! In general, you shouldn't do it. > > > Guido recently commented: >

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Peter Otten
Deborah Swanson wrote: > Peter Otten wrote, on Wednesday, April 12, 2017 11:35 PM >> >> Deborah Swanson wrote: >> >> > It's a small point, but I suspect getattr(record, label) >> would still >> > fail, even if label's value is 'label' and only 'label', but what's >> > the point of having a varia

Re: Calling dunder methods manually

2017-04-13 Thread Serhiy Storchaka
On 13.04.17 08:29, Steven D'Aprano wrote: Should you call dunder methods (Double leading and trailing UNDERscores) manually? For example: my_number.__add__(another_number) The short answer is: NO! In general, you shouldn't do it. Guido recently commented: I agree that one shouldn't ca

Re: Visit All URLs with selenium python

2017-04-13 Thread Nicole
I have used 0 to 10 sec time sleep but it is not working.. please help me otherwise my assignment would get mark 0 -- https://mail.python.org/mailman/listinfo/python-list

Re: Visit All URLs with selenium python

2017-04-13 Thread Nicole
browser.get('https://www.google.co.uk/search?q=Rashmi&oq=Rashmi&aqs=chrome..69i57j69i60l3.6857j0j1&sourceid=chrome&ie=UTF-8#q=Rashmi+Custom+Tailors') time.sleep(5) try: p_links = browser.find_elements_by_css_selector(' div > h3 > a') url_lis

RE: Namedtuples: some unexpected inconveniences

2017-04-13 Thread Deborah Swanson
Peter Otten wrote, on Wednesday, April 12, 2017 11:35 PM > > Deborah Swanson wrote: > > > It's a small point, but I suspect getattr(record, label) > would still > > fail, even if label's value is 'label' and only 'label', but what's > > the point of having a variable if it will only ever have

Re: Visit All URLs with selenium python

2017-04-13 Thread Nicole
Not actually that's not.. You said there could be a Problem in HTML that's why I tested it on a new URL but it just viting the first URL not all.. Please help.. -- https://mail.python.org/mailman/listinfo/python-list

RE: Visit All URLs with selenium python

2017-04-13 Thread Deborah Swanson
Nicole wrote, on Wednesday, April 12, 2017 11:30 PM > > Here you can see now > > from selenium.webdriver.firefox.firefox_profile import FirefoxProfile > import random > from selenium import webdriver > from selenium.webdriver.common.keys import Keys > > browser.get('https://www.google.co.uk/