Re: Unicode script

2016-12-17 Thread MRAB
On 2016-12-16 02:44, MRAB wrote: On 2016-12-15 21:57, Terry Reedy wrote: On 12/15/2016 1:06 PM, MRAB wrote: On 2016-12-15 16:53, Steve D'Aprano wrote: Suppose I have a Unicode character, and I want to determine the script or scripts it belongs to. For example: U+0033 DIGIT THREE "3" belongs

Re: The right way to 'call' a class attribute inside the same class

2016-12-17 Thread Chris Angelico
On Sun, Dec 18, 2016 at 12:01 PM, Erik wrote: > Yes, in that case there is (I didn't grok that you meant using 'new' by > "calling a function as a constructor", but it's obvious now you spell it > out). Yeah. I thought that I got that terminology from MDN, but I can't find it now, so it must have

Re: The right way to 'call' a class attribute inside the same class

2016-12-17 Thread Erik
On 16/12/16 01:17, Chris Angelico wrote: On Fri, Dec 16, 2016 at 11:36 AM, Erik wrote: On 12/12/16 23:23, Chris Angelico wrote: In JavaScript, it's normal to talk about "calling a function as a constructor". When you do, there is a 'this' object before you start. No there isn't. There is a

Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.

2016-12-17 Thread skybuck2000
Specially for Dennis, a nice story: There are four little animals. The first animal is a tiger, the second animal is a deer, the third animal a parrot, the fourth animal is a fish. The animals are very angry at each other and want to EAT each other ! =D However each animal has a certain special

Re: python list index - an easy question

2016-12-17 Thread BartC
On 17/12/2016 19:10, John wrote: Hi, I am new to Python, and I believe it's an easy question. I know R and Matlab. x=[1,2,3,4,5,6,7] x[0] 1 x[1:5] [2, 3, 4, 5] * My question is: what does x[1:5] mean? x[A:B] means the slice consisting of x[A], x[A+1],... x

Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.

2016-12-17 Thread skybuck2000
Unless you are capable of expressing problems in numerical terms you'll have very hard luck having it computed by a computer ! ;) I did find some interesting docs about "decision trees". Exhaustive search Branch and Bound Hill Climbing Random/Best Effort Solutions and so forth. A computer prog

Re: python list index - an easy question

2016-12-17 Thread Terry Reedy
On 12/17/2016 2:10 PM, John wrote: Hi, I am new to Python, and I believe it's an easy question. I know R and Matlab. x=[1,2,3,4,5,6,7] x[0] 1 x[1:5] [2, 3, 4, 5] * My question is: what does x[1:5] mean? The subsequence between slice positions 1 and 5, leng

[RELEASE] Python 2.7.13

2016-12-17 Thread Benjamin Peterson
It is my pleasure to announce the release of Python 2.7.13, the latest bugfix release of the venerable Python 2.7 series. This release incorporates conservative bugfixes as well as improvements to keep Python 2.7 running on modern systems. The only change from the 2.7.13 release candidate 2 weeks

Re: python list index - an easy question

2016-12-17 Thread Peter Otten
John wrote: > Hi, > >I am new to Python, and I believe it's an easy question. I know R and >Matlab. > > x=[1,2,3,4,5,6,7] x[0] > 1 x[1:5] > [2, 3, 4, 5] > * > > My question is: what does x[1:5] mean? By Python's convention, the > first ele

Re: python list index - an easy question

2016-12-17 Thread boB Stepp
On Sat, Dec 17, 2016 at 1:10 PM, John wrote: > > Hi, > >I am new to Python, and I believe it's an easy question. I know R and > Matlab. > > > >>> x=[1,2,3,4,5,6,7] > >>> x[0] > 1 > >>> x[1:5] > [2, 3, 4, 5] > * > > My question is: what does x[1:5] mean? By Python'

python list index - an easy question

2016-12-17 Thread John
Hi, I am new to Python, and I believe it's an easy question. I know R and Matlab. >>> x=[1,2,3,4,5,6,7] >>> x[0] 1 >>> x[1:5] [2, 3, 4, 5] * My question is: what does x[1:5] mean? By Python's convention, the first element of a list is indexed as "0". Doesn't x[1

Re: Reading python list as a newsgroup (was ...)

2016-12-17 Thread Grant Edwards
On 2016-12-17, D'Arcy Cain wrote: > On 2016-12-16 08:16 PM, Dennis Lee Bieber wrote: >> Unfortunately, my client can only "pre filter" on subject and author; I >> could kill all @gmail.*, but could not focus on just Google Groups >> submissions... > > I don't know what client you use but perh

Re: Reading python list as a newsgroup (was ...)

2016-12-17 Thread Grant Edwards
On 2016-12-17, Dennis Lee Bieber wrote: > On Fri, 16 Dec 2016 15:11:54 + (UTC), Grant Edwards > declaimed the following: > >>I didn't notice much spam on c.l.p (but then again, I filter out all >>posts from google-groups). The problem on c.l.p that caused me to >>switch to gmane's NNTP server

Re: To improve a script

2016-12-17 Thread Ben Finney
Smith writes: > Hello guys, > can someone help me to improve this script? Yes. Remove it from every repository; the world will be improved by removing such hostility from the internet. -- \“When you go in for a job interview, I think a good thing to | `\ ask is if t

Re: Mapping with continguous ranges of keys

2016-12-17 Thread Steve D'Aprano
On Sat, 17 Dec 2016 08:31 pm, Peter Otten wrote: > Steve D'Aprano wrote: > >> I have experimented with two solutions, and hope somebody might be able >> to suggest some improvements. Attached is the test code I ran, >> suggestions for improving the performance will be appreciated. > > If there w

To improve a script

2016-12-17 Thread Smith
Hello guys, can someone help me to improve this script? https://github.com/githubdavide/mitm/blob/master/mitm.py Thank you in advance Cheers -- https://mail.python.org/mailman/listinfo/python-list

Re: Mapping with continguous ranges of keys

2016-12-17 Thread Peter Otten
Steve D'Aprano wrote: > I have experimented with two solutions, and hope somebody might be able to > suggest some improvements. Attached is the test code I ran, suggestions > for improving the performance will be appreciated. If there was an attachment to this text -- that didn't make it to the

Re: building numpy arrays with regular structure

2016-12-17 Thread Peter Otten
Seb wrote: > Is there an easier way to write a numpy array with a regular structure? > For example, an array with [0, 1] along the diagnal of one of the array > dimensions, and zero elsewhere: > > zz = np.array([[[0, 1], [0, 0], [0, 0]], >[[0, 0], [0, 1], [0, 0]], >