Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread Rustom Mody
On Tuesday, March 15, 2016 at 5:56:54 AM UTC+5:30, jj0ge...@gmail.com wrote: > In Python is it possible to comparison-equate a variable to a List, Tupple, > or Set and have it return True if the contents of the variable matches an > element in the List, Tupple, or Set. > > E.g. > > x = "apple"

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Marko Rauhamaa
BartC : > Python includes some odd features that you say are indispensable > (mutable function names), but excludes others which are standard in > some other languages. Which is true for any programming language. Each of them comes with its facilities and ways to go about things. You decide which

Re: Encapsulation in Python

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 1:12:14 PM UTC-5, sohca...@gmail.com wrote: [...a whole lot of my quotes, snipped for bandwidth...] @GROUP: I don't know what the heck happened in this thread, but everyone involved was having a nice respectful conversation about encapsulation, interfaces, and modules

Obfuscating Python code (was: Is there a way to create a shared object file using PyInstaller?)

2016-03-14 Thread Ben Finney
Swanand Pashankar writes: > Embedding a Python file in C code works, but it exposes your Python > script. Didn't find any free fool-proof way to obfuscate Python code > either. What exactly is it you want to prevent? Why do you think obfuscating the code will achieve that? -- \ “The int

Is there a way to create a shared object file using PyInstaller?

2016-03-14 Thread Swanand Pashankar
Is there a way we can use PyInstaller to create .so file? I don't wish to fork (from my C code) just to call a function in a Python file. Embedding a Python file in C code works, but it exposes your Python script. Didn't find any free fool-proof way to obfuscate Python code either. -- https://m

Re: Simple exercise

2016-03-14 Thread Jussi Piitulainen
Steven D'Aprano writes: > Unfortunate or not, it seems to be quite common that "zip" > (convolution) discards items when sequences are of different lengths. Citation needed. Where is zip called convolution? Why should zip be called convolution? > See https://en.wikipedia.org/wiki/Convolution_%2

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 02:01, Steven D'Aprano wrote: On Tue, 15 Mar 2016 10:19 am, Mark Lawrence wrote: There is no need to optimise python, it is fast enough. I should of course have said on the end " for (say) 99% of purposes". Somebody should tell the core developers like Brett Cannon and Victor

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 01:10, BartC wrote: On 15/03/2016 00:28, Mark Lawrence wrote: On 14/03/2016 23:56, BartC wrote: Anything so terrible about that that Python needs to keep well clear of or that you think its users should be deprived of? Yes, it is not even valid Python. Switch has been rejecte

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 00:56, Chris Angelico wrote: On Tue, Mar 15, 2016 at 11:47 AM, Mark Lawrence wrote: Same old story. BartC spouts drivel, just like the RUE, or Nick "The Webmaster" Greek, I'm in trouble for pointing it out. When he provides some *EVIDENCE* to back up his claims then I'll more th

Re: Encapsulation in Python

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 9:41:06 PM UTC-5, Steven D'Aprano wrote: > True. I'm just pointing out that Mark does not speak for the Python > community. In that regard, he is behaving similarly to Ranting Rick in his > claims to be the voice of the silent masses. Now hold on there D'Aprano! Don't

Re: Encapsulation in Python

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 11:47 am, Mark Lawrence wrote: > Same old story. BartC spouts drivel, just like the RUE, or Nick "The > Webmaster" Greek, I'm in trouble for pointing it out. No, you are in trouble for being aggressive and rude. You're also wrong: Bart is not spouting "drivel". You might n

Re: Encapsulation in Python

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 01:14 pm, Chris Angelico wrote: > On Tue, Mar 15, 2016 at 1:06 PM, Steven D'Aprano > wrote: >> On Tue, 15 Mar 2016 11:25 am, Chris Angelico wrote: >> >>> Mark should be aware that, yes, his >>> actions are not in line with the CoC. >> >> >> Mark's *technical opinions* are not

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 12:35 pm, BartC wrote: > On 15/03/2016 01:27, Steven D'Aprano wrote: >> On Tue, 15 Mar 2016 07:31 am, BartC wrote: >> >>> But how do you pass something that refers to a itself? >> >> You can't. "Names" are not first-class values in Python. > > This was my real point. Python in

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 1:06 PM, Steven D'Aprano wrote: > On Tue, 15 Mar 2016 11:25 am, Chris Angelico wrote: > >> Mark should be aware that, yes, his >> actions are not in line with the CoC. > > > Mark's *technical opinions* are not in line with the Python community or the > core developers eithe

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 11:26 am, jj0gen0i...@gmail.com wrote: > In Python is it possible to comparison-equate a variable to a List, > Tupple, or Set and have it return True if the contents of the variable > matches an element in the List, Tupple, or Set. > > E.g. > > x = "apple" > > x-list = ["app

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 12:55 PM, Steven D'Aprano wrote: > But of course, in Python any switch statement would have to support values > of any and every type, not just integers. So any implementation you are > thinking of would have to support cases like this: > > > switch obj: > case "Hello",

Re: Encapsulation in Python

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 11:25 am, Chris Angelico wrote: > Mark should be aware that, yes, his > actions are not in line with the CoC. Mark's *technical opinions* are not in line with the Python community or the core developers either. His continual declarations that "python is fast enough" goes aga

Re: Encapsulation in Python

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 10:19 am, Mark Lawrence wrote: > There is no need to optimise python, it is fast enough. Somebody should tell the core developers like Brett Cannon and Victor Stinner that they are wasting their time working on Python optimizers. Since Python is fast enough, obviously anyone

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 12:22 PM, BartC wrote: > The integer-switch is intended for use with jump-tables, which requires not > only that the case expressions are known at compile-time, but that they > don't span too large a range. > Okay, which is what I mean by "compact". There'd be some lowest

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 04:53 am, BartC wrote: > On 14/03/2016 17:17, Mark Lawrence wrote: >> On 13/03/2016 20:12, Marko Rauhamaa wrote: >>> BartC : >>> Exactly why having ready-made solutions is preferable to everyone hacking their own solutions to switch. >>> >>> A developer friend of mine

Re: Embedding Python into C set up issues

2016-03-14 Thread robert . snoeberger
> > However, I am having great trouble getting Py_Initialize() to work in the > both CDT and Visual Studio 2015. I have as a starting point a simple C > program that prints hello world then calls py_initialize and then prints > another line of text to the screen. Calling Py_initialize causes th

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread BartC
On 15/03/2016 01:27, Steven D'Aprano wrote: On Tue, 15 Mar 2016 07:31 am, BartC wrote: But how do you pass something that refers to a itself? You can't. "Names" are not first-class values in Python. This was my real point. Python includes some odd features that you say are indispensable (m

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread jj0gen0info
Thought "Tupple" looked wrong, too lazy to look in the book - lol. -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 07:31 am, BartC wrote: > But how do you pass something that refers to a itself? You can't. "Names" are not first-class values in Python. You can pass a string which represents a name, and a namespace, but you cannot pass just an unquoted name and have Python automatically res

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread jj0gen0info
Thanks to all for the responses. Very new to Python, and thought there should be a way to do it. JJ -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation in Python

2016-03-14 Thread BartC
On 15/03/2016 00:58, Chris Angelico wrote: On Tue, Mar 15, 2016 at 11:54 AM, BartC wrote: In Python, there's no reason to restrict 'switch' to integers, so I would expect its semantics to be based on either equality comparisons or inequality comparisons I use two forms of switch: one for int

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 12:10 PM, BartC wrote: > The one-byte-code switch works when all case expressions are known at > compile-time. It makes use of a jump-table within the byte-code. > > The total sequence will be more than one byte-code, typically: > > LOAD_FASTThe index > SWIT

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 06:45 am, alister wrote: > On Mon, 14 Mar 2016 14:43:22 +, BartC wrote: [...] > > Perhaps it's time to talk about something which many languages have, but > > Python hasn't. Not as far as I know anyway. > > >> That's references to names (sometimes called pointers). So if

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 01:43 am, BartC wrote: > On 13/03/2016 09:39, Steven D'Aprano wrote: >> On Sun, 13 Mar 2016 04:54 am, BartC wrote: > >>> Common sense tells you it is unlikely. >> >> Perhaps your common sense is different from other people's common sense. >> To me, and many other Python progra

Re: Encapsulation in Python

2016-03-14 Thread BartC
On 15/03/2016 00:28, Mark Lawrence wrote: On 14/03/2016 23:56, BartC wrote: Anything so terrible about that that Python needs to keep well clear of or that you think its users should be deprived of? Yes, it is not even valid Python. Switch has been rejected via at least one PEP and from wha

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 11:54 AM, BartC wrote: >> In Python, there's no reason to restrict 'switch' >> to integers, so I would expect its semantics to be based on either >> equality comparisons or inequality comparisons > > > I use two forms of switch: one for integers only (very fast), and the ot

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 11:47 AM, Mark Lawrence wrote: > Same old story. BartC spouts drivel, just like the RUE, or Nick "The > Webmaster" Greek, I'm in trouble for pointing it out. When he provides some > *EVIDENCE* to back up his claims then I'll more than happily back off. I do > not intend

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
On 15/03/2016 00:25, BartC wrote: [snip I really don't know what, it certainly isn't Python] when etx,0 then else# unicode goes here... end switch As John McEnroe famously said, "You cannot be serious". -- My fellow Pythonistas, ask not what our language can do for you, ask what

Re: Encapsulation in Python

2016-03-14 Thread BartC
On 15/03/2016 00:12, Chris Angelico wrote: On Tue, Mar 15, 2016 at 10:56 AM, BartC wrote: switch c when 'A'..'Z','a'..'z','_' then ++name Anything so terrible about that that Python needs to keep well clear of or that you think its users should be deprived of? Yes: the complete

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 15/03/2016 00:25, Chris Angelico wrote: On Tue, Mar 15, 2016 at 11:17 AM, rurpy--- via Python-list wrote: On 03/14/2016 05:19 PM, Mark Lawrence wrote: On 14/03/2016 22:40, BartC wrote: [...a polite and reasonable comment...] Drivel. Any establised member of this community, or any other

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread Mark Lawrence
On 15/03/2016 00:26, jj0gen0i...@gmail.com wrote: In Python is it possible to comparison-equate a variable to a List, Tupple, or Set and have it return True if the contents of the variable matches an element in the List, Tupple, or Set. It's actually "tuple", but what the heck :) E.g. x =

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 11:26 AM, wrote: > In Python is it possible to comparison-equate a variable to a List, Tupple, > or Set and have it return True if the contents of the variable matches an > element in the List, Tupple, or Set. > > E.g. > > x = "apple" > > x-list = ["apple", "banana", "pe

Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread Joel Goldstick
On Mon, Mar 14, 2016 at 8:26 PM, wrote: > In Python is it possible to comparison-equate a variable to a List, > Tupple, or Set and have it return True if the contents of the variable > matches an element in the List, Tupple, or Set. > > E.g. > > x = "apple" > > x-list = ["apple", "banana", "peach

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread BartC
On 14/03/2016 23:24, Steven D'Aprano wrote: On Mon, 14 Mar 2016 06:39 am, BartC wrote: class switch(object): value = None def __new__(class_, value): class_.value = value return True def case(*args): return any((arg == switch.value for arg in args)) That

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 23:56, BartC wrote: On 14/03/2016 23:19, Mark Lawrence wrote: On 14/03/2016 22:40, BartC wrote: Was that in Python? It was /supposed/ to be dreadful. I was making a case for it to be supported directly. You mean the huge great long list of hard coded function calls. They are

Use of Lists, Tupples, or Sets in IF statement.

2016-03-14 Thread jj0gen0info
In Python is it possible to comparison-equate a variable to a List, Tupple, or Set and have it return True if the contents of the variable matches an element in the List, Tupple, or Set. E.g. x = "apple" x-list = ["apple", "banana", "peach"] If x == x-list: print('Comparison is True') els

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 11:17 AM, rurpy--- via Python-list wrote: > On 03/14/2016 05:19 PM, Mark Lawrence wrote: >> On 14/03/2016 22:40, BartC wrote: >> > [...a polite and reasonable comment...] >> >> Drivel. Any establised member of this community, or any other >> community for that matter, will

Re: Encapsulation in Python

2016-03-14 Thread rurpy--- via Python-list
On 03/14/2016 05:19 PM, Mark Lawrence wrote: > On 14/03/2016 22:40, BartC wrote: > > [...a polite and reasonable comment...] > > Drivel. Any establised member of this community, or any other > community for that matter, will always publish, unless, like the RUE, > they've got something to hide. S

Re: Encapsulation in Python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 10:56 AM, BartC wrote: > I disagree. And presumably so do others as there are so many different > attempts to implement switch, with varying degrees of success. Here's how I > do it outside Python: > > switch c > when 'A'..'Z','a'..'z','_' then > ++name > when '0'..

Re: Simple exercise

2016-03-14 Thread Steven D'Aprano
On Tue, 15 Mar 2016 02:06 am, Oscar Benjamin wrote: > On 14 March 2016 at 14:35, Rick Johnson > wrote: >> >> I would strongly warn anyone against using the zip function >> unless > ... >> I meant to say: absolutely, one hundred percent *SURE*, that >> both sequences are of the same length, or, ab

Re: Different sources of file

2016-03-14 Thread Wildman via Python-list
On Mon, 14 Mar 2016 20:56:44 +, Val Krem wrote: > #!/usr/bin/python On some Linux systems python is installed in /usr/local/bin. I would suggest the hash-bang below then python will run no matter where it was installed... #!/usr/bin/env python As a python newbie myself, I can't really give

Re: Encapsulation in Python

2016-03-14 Thread BartC
On 14/03/2016 23:19, Mark Lawrence wrote: On 14/03/2016 22:40, BartC wrote: Was that in Python? It was /supposed/ to be dreadful. I was making a case for it to be supported directly. You mean the huge great long list of hard coded function calls. They are directly supported. So is the loop

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Steven D'Aprano
On Mon, 14 Mar 2016 06:39 am, BartC wrote: > class switch(object): > value = None > def __new__(class_, value): > class_.value = value > return True > > def case(*args): > return any((arg == switch.value for arg in args)) That's quite a clever use of a class. By

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 22:40, BartC wrote: On 14/03/2016 22:20, Mark Lawrence wrote: On 14/03/2016 22:07, BartC wrote: On 14/03/2016 21:23, Mark Lawrence wrote: Python 2.8, RickedPython, and the latest entry into the race, BartCPython, all vapourware. I'm not creating a new version of Python or CPyt

Re: Interaction between pygame and python

2016-03-14 Thread Chris Angelico
On Tue, Mar 15, 2016 at 9:58 AM, Rick Johnson wrote: > On Monday, March 14, 2016 at 2:06:02 PM UTC-5, Ian wrote: >> On Mon, Mar 14, 2016 at 10:53 AM, Rick Johnson >> wrote: >> > If you download and run an installer, one that is >> > appropriate for your operating system and Python version, >> > e

Re: Encapsulation in Python

2016-03-14 Thread Rick Johnson
On Sunday, March 13, 2016 at 6:35:40 PM UTC-5, Gregory Ewing wrote: > Unless the module is doing something obscure, you can > still find [it's source file] by following the chain of > imports. [...] True, it's not *always* that easy, but in > the vast majority of cases it is. I agree you have a va

Re: Interaction between pygame and python

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 2:06:02 PM UTC-5, Ian wrote: > On Mon, Mar 14, 2016 at 10:53 AM, Rick Johnson > wrote: > > If you download and run an installer, one that is > > appropriate for your operating system and Python version, > > everything will be taken care of for you. > > > > Since you ar

Re: Encapsulation in Python

2016-03-14 Thread BartC
On 14/03/2016 22:20, Mark Lawrence wrote: On 14/03/2016 22:07, BartC wrote: On 14/03/2016 21:23, Mark Lawrence wrote: Python 2.8, RickedPython, and the latest entry into the race, BartCPython, all vapourware. I'm not creating a new version of Python or CPython (you should have used an unders

Re: OTish Wells Fargo sucks

2016-03-14 Thread Joel Goldstick
On Mon, Mar 14, 2016 at 6:25 PM, Mark Lawrence wrote: > On 14/03/2016 22:10, Seymore4Head wrote: > >> Wells Fargo online will not allow you to change a payee's address. You >> have to delete the account and re enter it. >> >> I have had most of my bills on autopay for at least 15 years. The >> l

Re: OTish Wells Fargo sucks

2016-03-14 Thread Mark Lawrence
On 14/03/2016 22:10, Seymore4Head wrote: Wells Fargo online will not allow you to change a payee's address. You have to delete the account and re enter it. I have had most of my bills on autopay for at least 15 years. The last utility company to make the change was the water company. For some

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 22:07, BartC wrote: On 14/03/2016 21:23, Mark Lawrence wrote: Python 2.8, RickedPython, and the latest entry into the race, BartCPython, all vapourware. I'm not creating a new version of Python or CPython (you should have used an underscore). But I do have considerable experien

OTish Wells Fargo sucks

2016-03-14 Thread Seymore4Head
Wells Fargo online will not allow you to change a payee's address. You have to delete the account and re enter it. I have had most of my bills on autopay for at least 15 years. The last utility company to make the change was the water company. For some reason their system could not take checks f

Re: Encapsulation in Python

2016-03-14 Thread BartC
On 14/03/2016 21:23, Mark Lawrence wrote: Python 2.8, RickedPython, and the latest entry into the race, BartCPython, all vapourware. I'm not creating a new version of Python or CPython (you should have used an underscore). But I do have considerable experience of creating dynamically-typed

Re: Encapsulation in Python

2016-03-14 Thread Mark Lawrence
On 14/03/2016 21:09, Ian Kelly wrote: On Mon, Mar 14, 2016 at 11:32 AM, Rick Johnson wrote: Ignoring Tkinter, which is a gawd awful mess, how would you re-organize the 3,656 symbols in OpenGL.GL into smaller modules, without dividing them up along some random or arbitrary lines? In that parti

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread BartC
On 14/03/2016 21:00, Christian Gollwitzer wrote: Am 14.03.16 um 21:31 schrieb BartC: There are good reasons for wanting to do so. Try writing this function in Python: def swap(a,b): b,a = a,b x="one" y="two" swap(x,y) print (x,y) so that it displays "two" "one". The pervert thing is t

Re: Different sources of file

2016-03-14 Thread Terry Reedy
On 3/14/2016 4:56 PM, Val Krem via Python-list wrote: Hi all, I am made a little progress on using python. I have five files to read from different sources and concatenate them to one file. From each file I want only to pick few column (x1, x2 and x3). However, these columns say x3 w

Re: Encapsulation in Python

2016-03-14 Thread Ian Kelly
On Mon, Mar 14, 2016 at 11:32 AM, Rick Johnson wrote: > Ignoring Tkinter, which is a gawd awful mess, how would you > re-organize the 3,656 symbols in OpenGL.GL into smaller > modules, without dividing them up along some random or > arbitrary lines? In that particular case, I wouldn't, except pos

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
On 14/03/2016 20:31, BartC wrote: On 14/03/2016 19:45, alister wrote: On Mon, 14 Mar 2016 14:43:22 +, BartC wrote: On 13/03/2016 09:39, Steven D'Aprano wrote: On Sun, 13 Mar 2016 04:54 am, BartC wrote: Common sense tells you it is unlikely. Perhaps your common sense is different from

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Christian Gollwitzer
Am 14.03.16 um 21:31 schrieb BartC: There are good reasons for wanting to do so. Try writing this function in Python: def swap(a,b): b,a = a,b x="one" y="two" swap(x,y) print (x,y) so that it displays "two" "one". The pervert thing is that this is nearly there: def swap(a,b):

Different sources of file

2016-03-14 Thread Val Krem via Python-list
Hi all, I am made a little progress on using python. I have five files to read from different sources and concatenate them to one file. From each file I want only to pick few column (x1, x2 and x3). However, these columns say x3 was a date in one file it was recorded as a character

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
On 14/03/2016 17:53, BartC wrote: On 14/03/2016 17:17, Mark Lawrence wrote: On 13/03/2016 20:12, Marko Rauhamaa wrote: BartC : Exactly why having ready-made solutions is preferable to everyone hacking their own solutions to switch. A developer friend of mine once said insightfully that the

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread BartC
On 14/03/2016 19:45, alister wrote: On Mon, 14 Mar 2016 14:43:22 +, BartC wrote: On 13/03/2016 09:39, Steven D'Aprano wrote: On Sun, 13 Mar 2016 04:54 am, BartC wrote: Common sense tells you it is unlikely. Perhaps your common sense is different from other people's common sense. To me

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread alister
On Mon, 14 Mar 2016 14:43:22 +, BartC wrote: > On 13/03/2016 09:39, Steven D'Aprano wrote: >> On Sun, 13 Mar 2016 04:54 am, BartC wrote: > >>> Common sense tells you it is unlikely. >> >> Perhaps your common sense is different from other people's common >> sense. To me, and many other Python

Re: Interaction between pygame and python

2016-03-14 Thread Ian Kelly
On Mon, Mar 14, 2016 at 10:53 AM, Rick Johnson wrote: > If you download and run an installer, one that is > appropriate for your operating system and Python version, > everything will be taken care of for you. > > Since you are using Python 3.5.1 on a windows box, you'll > want to download and ins

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread BartC
On 14/03/2016 18:25, Marko Rauhamaa wrote: BartC : (Code-smell to me means code dominated by loads of classes, especially for no good reason. But I'm not suggesting a language shouldn't have them.) Ok, you don't like OO. Fine. Python is deep in OO. "When in Rome, do as the Romans do." Perso

Re: Improving performance in matrix operations

2016-03-14 Thread Oscar Benjamin
On 9 March 2016 at 20:09, Drimades wrote: > I'm doing some tests with operations on numpy matrices in Python. As an > example, it takes about 3000 seconds to compute eigenvalues and eigenvectors > using scipy.linalg.eig(a) for a matrix 6000x6000. Is it an acceptable time? I don't know really bu

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Marko Rauhamaa
BartC : > (Code-smell to me means code dominated by loads of classes, especially > for no good reason. But I'm not suggesting a language shouldn't have > them.) Ok, you don't like OO. Fine. Python is deep in OO. "When in Rome, do as the Romans do." Personally, I think OO is quite a cromulent pa

Re: Encapsulation in Python

2016-03-14 Thread sohcahtoa82
On Friday, March 11, 2016 at 6:39:53 PM UTC-8, Rick Johnson wrote: > On Friday, March 11, 2016 at 9:48:22 AM UTC-6, Ian wrote: > > On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson > > The honorable Rick Johnson wrote: > > > Many times, i would have preferred to define my module space > > > across mult

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Michael Torrie
On 03/14/2016 08:43 AM, BartC wrote: > But how do you pass 'a' itself? > > Perhaps you can say: > >f('a') > > and f can do some sort of lookup, if it knows the caller's context, for > such a name and retrieve the value that way. But that's rather > heavy-handed, and f can't distinguish bet

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread BartC
On 14/03/2016 17:17, Mark Lawrence wrote: On 13/03/2016 20:12, Marko Rauhamaa wrote: BartC : Exactly why having ready-made solutions is preferable to everyone hacking their own solutions to switch. A developer friend of mine once said insightfully that the point of OO is getting rid of switc

Re: Interaction between pygame and python

2016-03-14 Thread Terry Reedy
On 3/14/2016 12:53 PM, Rick Johnson wrote: Since you are using Python 3.5.1 on a windows box, you'll want to download and install the executable named "pygame-1.9.1-py3.1.msi". You can get it here: http://www.pygame.org/download.shtml Or get pygame-1.9.2a0-cp35-none-win32.whl from http://w

Re: Encapsulation in Python

2016-03-14 Thread Rick Johnson
On Sunday, March 13, 2016 at 5:11:50 AM UTC-5, Steven D'Aprano wrote: > On Sun, 13 Mar 2016 03:44 am, Ian Kelly wrote: > > > On Fri, Mar 11, 2016 at 7:39 PM, Rick Johnson > > wrote: > >> At run-time, i don't care how large a "module namespace" may be. > >> Sometimes a module namespace will be sma

Re[3]: Re[2]: Loading error message

2016-03-14 Thread Arie van Wingerden
maandag, 14 maart 2016, 06:21PM +0100 van Oscar Benjamin : >On 14 March 2016 at 17:15, Arie van Wingerden < xapw...@gmail.com > wrote: >> I've fixed the quoting below. Can you not top-post please Arie? >> On 14 March 2016 at 16:59, Arie van Wingerden <  xapw...@gmail.com > wrote: >>> 2016-03-14 1

Re: Re[2]: Loading error message

2016-03-14 Thread Oscar Benjamin
On 14 March 2016 at 17:15, Arie van Wingerden wrote: > I've fixed the quoting below. Can you not top-post please Arie? > On 14 March 2016 at 16:59, Arie van Wingerden < xapw...@gmail.com > wrote: >> 2016-03-14 15:59 GMT+01:00 Oscar Benjamin < oscar.j.benja...@gmail.com >: >>> >>> On 14 March 2016

Re: Descriptors vs Property

2016-03-14 Thread Rustom Mody
On Monday, March 14, 2016 at 9:06:01 PM UTC+5:30, Mark Lawrence wrote: > On 13/03/2016 13:20, Veek. M wrote: > > Thomas 'PointedEars' Lahn wrote: > > > Nobility lies in action, not in name. > --Surak > > > > Someone called Ned.B who i know elsewhere spoke on your behalf. I'm glad

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
On 13/03/2016 20:12, Marko Rauhamaa wrote: BartC : Exactly why having ready-made solutions is preferable to everyone hacking their own solutions to switch. A developer friend of mine once said insightfully that the point of OO is getting rid of switch statements. IOW, most use cases for switc

Re[2]: Loading error message

2016-03-14 Thread Arie van Wingerden
maandag, 14 maart 2016, 06:04PM +0100 van Oscar Benjamin : >I've fixed the quoting below. Can you not top-post please Arie? >On 14 March 2016 at 16:59, Arie van Wingerden < xapw...@gmail.com > wrote: >> 2016-03-14 15:59 GMT+01:00 Oscar Benjamin < oscar.j.benja...@gmail.com >: >>> >>> On 14 March

Re: Loading error message

2016-03-14 Thread Oscar Benjamin
I've fixed the quoting below. Can you not top-post please Arie? On 14 March 2016 at 16:59, Arie van Wingerden wrote: > 2016-03-14 15:59 GMT+01:00 Oscar Benjamin : >> >> On 14 March 2016 at 12:07, Arie van Wingerden wrote: >> > that is weird. I am using Windows 10 and get exactly the same "warnin

Re: Loading error message

2016-03-14 Thread Arie van Wingerden
Hi Oscar, no. By default W10 appears to have them NOT installed (at least that is what I experienced). You really need the SDK to be installed. Also the path must point to the libs installed by the SDK. Now it works without all those warnings. Thx, Arie 2016-03-14 15:59 GMT+01:00 Oscar Benjam

Re: Interaction between pygame and python

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 3:28:40 AM UTC-5, Tyson wrote: > I am having a lot of trouble getting python to find the > pygame module; my operating system is Windows 7. Can you > offer any help? . Should I download pygame into the same > folder as Python? . any ideas at all? If you're new to Pyt

Embedding Python into C set up issues

2016-03-14 Thread steven . flolid
Good morning! I have been working with Python for the last few months. I have created a script that I want to embed into a C++ environment, specifically CDT for eclipse. I have read the https://docs.python.org/2/extending/index.html and understand the ideas and differences between the two langu

Re: Missing something about timezones

2016-03-14 Thread Carl Meyer
Hi Skip, On 03/14/2016 09:32 AM, Skip Montanaro wrote: > On Mon, Mar 14, 2016 at 10:26 AM, Ian Kelly wrote: >> Why should it? You only asked pytz for the Chicago timezone. You >> didn't ask for it relative to any specific time. > > Thanks. I thought using America/Chicago was supposed to automagi

Re: Missing something about timezones

2016-03-14 Thread Skip Montanaro
On Mon, Mar 14, 2016 at 11:20 AM, Ian Kelly wrote: > Note that the above example is technically incorrect since > datetime.now() returns local time and I'm not in the Chicago timezone, > but it demonstrates the process. > > Also, if you haven't already read the pytz documentation, you should. > ht

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-14 Thread Mark Lawrence
On 14/03/2016 14:43, BartC wrote: On 13/03/2016 09:39, Steven D'Aprano wrote: On Sun, 13 Mar 2016 04:54 am, BartC wrote: Common sense tells you it is unlikely. Perhaps your common sense is different from other people's common sense. To me, and many other Python programmers, it's common sens

Re: Missing something about timezones

2016-03-14 Thread Ian Kelly
On Mon, Mar 14, 2016 at 9:32 AM, Skip Montanaro wrote: > On Mon, Mar 14, 2016 at 10:26 AM, Ian Kelly wrote: >> Why should it? You only asked pytz for the Chicago timezone. You >> didn't ask for it relative to any specific time. > > Thanks. I thought using America/Chicago was supposed to automagic

Re: Simple exercise

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 10:17:54 AM UTC-5, Ian wrote: > It's sometimes very useful [for zip to discard values], > though. The obvious solution is to allow the caller to decide if the error should be raised, or not. Currently, the caller has no control over the internals of zip unless he crea

Re: Simple exercise

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 10:06:56 AM UTC-5, Oscar Benjamin wrote: > On 14 March 2016 at 14:35, Rick Johnson wrote: > > > > I would strongly warn anyone against using the zip function > > unless > ... > > I meant to say: absolutely, one hundred percent *SURE*, that > > both sequences are of the

Re: Simple exercise

2016-03-14 Thread Peter Otten
Ian Kelly wrote: > On Mon, Mar 14, 2016 at 9:06 AM, Oscar Benjamin > wrote: >> On 14 March 2016 at 14:35, Rick Johnson >> wrote: >>> >>> I would strongly warn anyone against using the zip function >>> unless >> ... >>> I meant to say: absolutely, one hundred percent *SURE*, that >>> both sequenc

Re: Simple exercise

2016-03-14 Thread MRAB
On 2016-03-14 15:22, Rick Johnson wrote: On Monday, March 14, 2016 at 9:19:04 AM UTC-5, alister wrote: A code smell does not necessarily mean the code is wrong, just that it warrants investigation as there is a strong possibility it may be sub- optimal Yes, technically speaking, you're correct

Re: Descriptors vs Property

2016-03-14 Thread Mark Lawrence
On 13/03/2016 13:20, Veek. M wrote: Thomas 'PointedEars' Lahn wrote: Nobility lies in action, not in name. —Surak Someone called Ned.B who i know elsewhere spoke on your behalf. I'm glad to say I like/trust Ned a bit so *huggles* to you, and I shall snip. Also, sorry about the 'Steve

Re: Missing something about timezones

2016-03-14 Thread Skip Montanaro
On Mon, Mar 14, 2016 at 10:26 AM, Ian Kelly wrote: > Why should it? You only asked pytz for the Chicago timezone. You > didn't ask for it relative to any specific time. Thanks. I thought using America/Chicago was supposed to automagically take into account transitions into and out of Daylight Sav

Re: programeren met python

2016-03-14 Thread Mark Lawrence
On 13/03/2016 14:25, Irmen de Jong wrote: On 12-3-2016 17:58, Imre De Craemer wrote: hoe moet je python dounlauden Dit is een Engelse newsgroup, dus je kunt je vragen beter in het Engels stellen in plaats van in het Nederlands. Maar om je vraag te beantwoorden: Ga naar https://www.python.o

Re: Missing something about timezones

2016-03-14 Thread Ian Kelly
On Mon, Mar 14, 2016 at 9:19 AM, Skip Montanaro wrote: > Is this correct (today, with Daylight Savings in effect)? > import pytz i.timezone > 'America/Chicago' pytz.timezone(i.timezone) > ot > datetime.datetime(2016, 3, 14, 9, 30, tzinfo= 'America/New_York' EDT-1 day, 20:00:00

Re: Simple exercise

2016-03-14 Thread Rick Johnson
On Monday, March 14, 2016 at 9:19:04 AM UTC-5, alister wrote: > A code smell does not necessarily mean the code is wrong, > just that it warrants investigation as there is a strong > possibility it may be sub- optimal Yes, technically speaking, you're correct. But the concept of "code smell" has

Re:

2016-03-14 Thread justin walters
How did you install python? On Mar 14, 2016 1:30 AM, "Ezra Simms" wrote: > I cannot seem to get pymongo to find my python installation – keep getting > an error saying pythin has not been found in the registry? Why is this. > > Sent from Mail for Windows 10 > > -- > https://mail.python.org/mailma

  1   2   >