Re: advanced SimpleHTTPServer?

2016-11-03 Thread justin walters
On Thu, Nov 3, 2016 at 10:27 PM, Rustom Mody wrote: > On Thursday, November 3, 2016 at 1:23:05 AM UTC+5:30, Eric S. Johansson > wrote: > > On 11/2/2016 2:40 PM, Chris Warrick wrote: > > > Because, as the old saying goes, any sufficiently complicated Bottle > > > or Flask app contains an ad hoc, i

Re: advanced SimpleHTTPServer?

2016-11-03 Thread Rustom Mody
On Thursday, November 3, 2016 at 1:23:05 AM UTC+5:30, Eric S. Johansson wrote: > On 11/2/2016 2:40 PM, Chris Warrick wrote: > > Because, as the old saying goes, any sufficiently complicated Bottle > > or Flask app contains an ad hoc, informally-specified, bug-ridden, > > slow implementation of half

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread Mario R. Osorio
I don't know much about these topics but, wouldn't soundex do the job?? On Thursday, November 3, 2016 at 12:18:19 PM UTC-4, Fillmore wrote: > Hi there, apologies for the generic question. Here is my problem let's > say that I have a list of lists of strings. > > list1:#strings are sort of s

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Terry Reedy
On 11/3/2016 2:56 AM, arthurhavli...@gmail.com wrote: lst = [ item for item in lst if predicate(item) ] lst = [ f(item) for item in lst ] Both these expressions feature redundancy, lst occurs twice and item at least twice. Additionally, the readability is hurt, because one has to dive through

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread jladasky
On Thursday, November 3, 2016 at 3:47:41 PM UTC-7, jlad...@itu.edu wrote: > On Thursday, November 3, 2016 at 1:09:48 PM UTC-7, Neil D. Cerutti wrote: > > you may also be > > able to use some items "off the shelf" from Python's difflib. > > I wasn't aware of that module, thanks for the tip! > > d

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread Fillmore
On 11/3/2016 6:47 PM, jlada...@itu.edu wrote: On Thursday, November 3, 2016 at 1:09:48 PM UTC-7, Neil D. Cerutti wrote: you may also be able to use some items "off the shelf" from Python's difflib. I wasn't aware of that module, thanks for the tip! difflib.SequenceMatcher.ratio() returns a nu

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread jladasky
On Thursday, November 3, 2016 at 1:09:48 PM UTC-7, Neil D. Cerutti wrote: > you may also be > able to use some items "off the shelf" from Python's difflib. I wasn't aware of that module, thanks for the tip! difflib.SequenceMatcher.ratio() returns a numerical value which represents the "similari

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Paul Rubin
arthurhavli...@gmail.com writes: > I would gladly appreciate your returns on this, regarding: > 1 - Whether a similar proposition has been made > 2 - If you find this of any interest at all > 3 - If you have a suggestion for improving the proposal Bleccch. Might be ok as a behind-the-scenes optim

Re: Python Dice Game/Need help with my script/looping!

2016-11-03 Thread Cousin Stanley
Constantin Sorin wrote: > Hello,I recently started to make a dice game in python. > > Everything was nice and beautiful,until now. > > My problem is that when I try to play and I win or lost > or it's equal next time it will continue only with that. > Following is a link to a version o

Re: data interpolation

2016-11-03 Thread Bob Gailer
On Nov 3, 2016 6:10 AM, "Heli" wrote: > > Hi, > > I have a question about data interpolation using python. I have a big ascii file containg data in the following format and around 200M points. > > id, xcoordinate, ycoordinate, zcoordinate > > then I have a second file containing data in the follow

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Chris Angelico
On Fri, Nov 4, 2016 at 4:00 AM, Steve D'Aprano wrote: > On Fri, 4 Nov 2016 01:05 am, Chris Angelico wrote: > >> On Thu, Nov 3, 2016 at 7:29 PM, Steven D'Aprano >> wrote: lst = map (lambda x: x*5, lst) lst = filter (lambda x: x%3 == 1, lst) And perform especially bad in CPython comp

Re: Python Dice Game/Need help with my script/looping!

2016-11-03 Thread Bob Gailer
On Nov 3, 2016 11:30 AM, "Constantin Sorin" wrote: > > Hello,I recently started to make a dice game in python.Everything was nice and beautiful,until now.My problem is that when I try to play and I win or lost or it's equal next time it will continue only with that. > Exemple: > Enter name >> Sori

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Arthur Havlicek
I understand that, the cost of change is such that it's very unlikely something like this ever goes into Python, but I feel like the interest of the proposition is being underestimated here, that's why I'm going to argue a few points and give a bit more context as needed. > While mapping and filte

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread Neil D. Cerutti
On 11/3/2016 1:49 PM, jlada...@itu.edu wrote: The Levenshtein distance is a very precise definition of dissimilarity between sequences. It specifies the minimum number of single-element edits you would need to change one sequence into another. You are right that it is fairly expensive to com

Re: constructor classmethods

2016-11-03 Thread Ethan Furman
On 11/03/2016 07:45 AM, Ethan Furman wrote: On 11/03/2016 01:50 AM, teppo.p...@gmail.com wrote: The guide is written in c++ in mind, yet the concepts stands for any programming language really. Read it through and think about it. If you come back to this topic and say: "yeah, but it's c++", t

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread jladasky
The Levenshtein distance is a very precise definition of dissimilarity between sequences. It specifies the minimum number of single-element edits you would need to change one sequence into another. You are right that it is fairly expensive to compute. But you asked for an algorithm that would

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Steve D'Aprano
On Fri, 4 Nov 2016 01:05 am, Chris Angelico wrote: > On Thu, Nov 3, 2016 at 7:29 PM, Steven D'Aprano > wrote: >>> lst = map (lambda x: x*5, lst) >>> lst = filter (lambda x: x%3 == 1, lst) >>> And perform especially bad in CPython compared to a comprehension. >> >> I doubt that. >> > > It's entir

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread justin walters
On Thu, Nov 3, 2016 at 9:18 AM, Fillmore wrote: > > Hi there, apologies for the generic question. Here is my problem let's say > that I have a list of lists of strings. > > list1:#strings are sort of similar to one another > > my_nice_string_blabla > my_nice_string_blqbli > my_nice_stri

need some kind of "coherence index" for a group of strings

2016-11-03 Thread Fillmore
Hi there, apologies for the generic question. Here is my problem let's say that I have a list of lists of strings. list1:#strings are sort of similar to one another my_nice_string_blabla my_nice_string_blqbli my_nice_string_bl0bla my_nice_string_aru list2:#strings are mostly

Re: Python Dice Game/Need help with my script/looping!

2016-11-03 Thread Constantin Sorin
I use Linux and python 2.7.12 -- https://mail.python.org/mailman/listinfo/python-list

Python Dice Game/Need help with my script/looping!

2016-11-03 Thread Constantin Sorin
Hello,I recently started to make a dice game in python.Everything was nice and beautiful,until now.My problem is that when I try to play and I win or lost or it's equal next time it will continue only with that. Exemple: Enter name >> Sorin Money = 2 Bet >> 2 You won! Money 4 Bet >> 2 You won! an

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Terry Reedy
On 11/3/2016 4:29 AM, Steven D'Aprano wrote: Nonsense. It is perfectly readable because it is explicit about what is being done, unlike some magic method that you have to read the docs to understand what it does. Agreed. A list comprehension or for-loop is more general and can be combined so

Re: constructor classmethods

2016-11-03 Thread Chris Angelico
On Thu, Nov 3, 2016 at 7:50 PM, wrote: > Little bit background related to this topic. It all starts from this article: > http://misko.hevery.com/attachments/Guide-Writing%20Testable%20Code.pdf > > The guide is written in c++ in mind, yet the concepts stands for any > programming language really.

Re: constructor classmethods

2016-11-03 Thread Ethan Furman
On 11/03/2016 01:50 AM, teppo.p...@gmail.com wrote: The guide is written in c++ in mind, yet the concepts stands for any programming language really. Read it through and think about it. If you come back to this topic and say: "yeah, but it's c++", then you haven't understood it. The ideas (

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Chris Angelico
On Thu, Nov 3, 2016 at 7:29 PM, Steven D'Aprano wrote: >> lst = map (lambda x: x*5, lst) >> lst = filter (lambda x: x%3 == 1, lst) >> And perform especially bad in CPython compared to a comprehension. > > I doubt that. > It's entirely possible. A list comp involves one function call (zero in Py2)

Re: Problems with read_eager and Telnet

2016-11-03 Thread kenansharon
On Monday, 28 February 2011 10:54:56 UTC-5, Robi wrote: > Hi everybody, > I'm totally new to Python but well motivated :-) > > I'm fooling around with Python in order to interface with FlightGear > using a telnet connection. > > I can do what I had in mind (send some commands and read output fr

Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread arthurhavlicek
Hi everybody, I have an enhancement proposal for Python and, as suggested by PEP 1, am exposing a stub to the mailing list before possibly starting writing a PEP. This is my first message to python mailing list. I hope you will find this content of interest. Python features a powerful and fast

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Ned Batchelder
On Thursday, November 3, 2016 at 4:30:00 AM UTC-4, Steven D'Aprano wrote: > On Thursday 03 November 2016 17:56, arthurhavli...@gmail.com wrote: > > I would propose this syntax. (TODO: find appropriate keywords I guess): > > > > lst.map x: x*5 > > lst.filter x: x%3 == 1 > > I think the chances of

data interpolation

2016-11-03 Thread Heli
Hi, I have a question about data interpolation using python. I have a big ascii file containg data in the following format and around 200M points. id, xcoordinate, ycoordinate, zcoordinate then I have a second file containing data in the following format, ( 2M values) id, xcoordinate, ycoor

PyDev 5.3.1 Released

2016-11-03 Thread Fabio Zadrozny
Release Highlights: --- * **Important** PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards. * PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars). * **Code Completion** * Substring completions are **on by default** (may be turned off in the co

Re: Reading Fortran Ascii output using python

2016-11-03 Thread Heli
On Monday, October 31, 2016 at 8:03:53 PM UTC+1, MRAB wrote: > On 2016-10-31 17:46, Heli wrote: > > On Monday, October 31, 2016 at 6:30:12 PM UTC+1, Irmen de Jong wrote: > >> On 31-10-2016 18:20, Heli wrote: > >> > Hi all, > >> > > >> > I am trying to read an ascii file written in Fortran90 using p

Re: constructor classmethods

2016-11-03 Thread teppo . pera
Hello everyone, I'll step into conversation too as I think it is quite important topic. I'd be the one my collegue calls keen to this practice. Little bit background related to this topic. It all starts from this article: http://misko.hevery.com/attachments/Guide-Writing%20Testable%20Code.pdf Th

Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Steven D'Aprano
On Thursday 03 November 2016 17:56, arthurhavli...@gmail.com wrote: [...] > Python features a powerful and fast way to create lists through > comprehensions. Because of their ease of use and efficiency through native > implementation, they are an advantageous alternative to map, filter, and > more