Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Steven D'Aprano
On Mon, 15 Apr 2013 21:56:12 -0700, rusi wrote: > On Apr 16, 7:32 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> >> If I had a say in this, I would vote for the first case, with the >> possible exception of documented singleton types like NoneType and >> bool. > > How is bool a s

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread rusi
On Apr 16, 7:32 am, Steven D'Aprano wrote: > > If I had a say in this, I would vote for the first case, with the > possible exception of documented singleton types like NoneType and bool. How is bool a singleton type? -- http://mail.python.org/mailman/listinfo/python-list

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Ian Kelly
On Mon, Apr 15, 2013 at 9:17 PM, Terry Jan Reedy wrote: > I will keep the above in mind if I write or review a patch. here are 4 > non-subclassable builtin classes. Two are already documented. Bool in one, > forget which other. I believe it was recently decided to leave the other two > as is given

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Terry Jan Reedy
On 4/15/2013 10:32 PM, Steven D'Aprano wrote: On Mon, 15 Apr 2013 20:52:58 -0400, Terry Jan Reedy wrote: Some builtin classes cannot be subclassed. There is an issue to document which better. That does not mean that it is not a class. I think it is also important to document whether that is

Re: Grammar question: Englisn and Python: qualified names

2013-04-15 Thread Cameron Simpson
On 15Apr2013 07:50, Chris Angelico wrote: | Quirky question time! | | When you read out a qualified name, eg collections.OrderedDict, do you | read the qualifier ("collections dot ordered dict"), or do you elide | it ("ordered dict")? I ask because it makes a difference to talking | about just on

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Steven D'Aprano
On Mon, 15 Apr 2013 19:43:32 +0200, Antoon Pardon wrote: > Op 15-04-13 12:11, Steven D'Aprano schreef: > > >> Python's data model has always been 100% object oriented. Prior to the >> "class/type" unification, it simply had *two distinct* implementations >> of objects: types, which were written

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Steven D'Aprano
On Mon, 15 Apr 2013 20:52:58 -0400, Terry Jan Reedy wrote: > On 4/15/2013 1:43 PM, Antoon Pardon wrote: > >> $ python3 >> Python 3.2.3 (default, Feb 20 2013, 17:02:41) [GCC 4.7.2] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> class vslice (slice): >>

Re: Python with Apache

2013-04-15 Thread MRAB
On 16/04/2013 03:02, Renato Barbosa Pim Pereira wrote: I am trying to execute cgi101.py: #!/usr/bin/python import cgi form = cgi.FieldStorage() # parse form data print('Content-type: text/html\n')# hdr plus blank line print('Reply Page')# html reply page if not

Python with Apache

2013-04-15 Thread Renato Barbosa Pim Pereira
I am trying to execute cgi101.py: #!/usr/bin/python import cgi form = cgi.FieldStorage() # parse form data print('Content-type: text/html\n')# hdr plus blank line print('Reply Page')# html reply page if not 'user' in form: print('Who are you?') else: print

Re: Threadpool item mailboxes design problem

2013-04-15 Thread Charles Hixson
On 04/15/2013 10:14 AM, Charles Hixson wrote: On 04/14/2013 07:32 PM, Chris Rebert wrote: On Apr 14, 2013 4:27 PM, "Charles Hixson" > wrote: > > What is the best approach to implementing actors that accept and post messages (and have no other external contac

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Terry Jan Reedy
On 4/15/2013 1:43 PM, Antoon Pardon wrote: $ python3 Python 3.2.3 (default, Feb 20 2013, 17:02:41) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class vslice (slice): ... pass ... Traceback (most recent call last): File "", line 1, in Typ

Re: Cross-compiling Python for ARM?

2013-04-15 Thread Terry Jan Reedy
On 4/15/2013 11:20 AM, Gilles wrote: Hello I tried running uWSGI on an ARM-based appliance, but it fails. Apparently, it could be due to the official Python 2.6.6 interpreter in the depot not being compiled the way uWSGI expects it to be: ./configure --enable-shared; make; make install; www.ra

Re: Process tuple contents on the fly

2013-04-15 Thread Gnarlodious
On Monday, April 15, 2013 2:35:10 PM UTC-6, Tobiah wrote: > > tup = *func() > What is the asterisk for? I assume it's a python 3 Not Python 3, pseudocode. I should have said as such, sorry. Supposed to indicate an expanded tuple. -- Gnarlie -- http://mail.python.org/mailman/listinfo/python-li

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Rotwang
On 15/04/2013 23:32, Chris Angelico wrote: On Tue, Apr 16, 2013 at 8:12 AM, Rotwang wrote: Traceback (most recent call last): File "", line 1, in class C(type(lambda: None)): TypeError: type 'function' is not an acceptable base type and I don't think that FunctionType would be consid

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Chris Angelico
On Tue, Apr 16, 2013 at 8:12 AM, Rotwang wrote: > Traceback (most recent call last): > File "", line 1, in > class C(type(lambda: None)): > TypeError: type 'function' is not an acceptable base type > > > and I don't think that FunctionType would be considered an "internal > detail", would i

Re: howto remove the thousand separator

2013-04-15 Thread Rotwang
On 15/04/2013 08:03, Steven D'Aprano wrote: On Mon, 15 Apr 2013 03:19:43 +0100, Rotwang wrote: [...] (Sorry for linking to Google Groups. Does anyone know of a better c.l.p. web archive?) The canonical (although possibly not the best) archive for c.l.p. is the python-list mailing list archive

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Rotwang
On 15/04/2013 22:13, Dave Angel wrote: On 04/15/2013 01:43 PM, Antoon Pardon wrote: [...] I had gotten my hopes up after reading this but then I tried: $ python3 Python 3.2.3 (default, Feb 20 2013, 17:02:41) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more infor

Re: Process tuple contents on the fly

2013-04-15 Thread Michael Torrie
On 04/15/2013 02:35 PM, Tobiah wrote: > On 04/15/2013 11:25 AM, Gnarlodious wrote: >> Say I have a tuple I want to expand assigning to variables: >> >> tup = *func() > > What is the asterisk for? I assume it's a python 3 > thing, because I get a syntax error, but I'm having > trouble Googling it.

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Dave Angel
On 04/15/2013 01:43 PM, Antoon Pardon wrote: Op 15-04-13 12:11, Steven D'Aprano schreef: Python's data model has always been 100% object oriented. Prior to the "class/type" unification, it simply had *two distinct* implementations of objects: types, which were written in C, and classes, which

Re: Process tuple contents on the fly

2013-04-15 Thread Tobiah
On 04/15/2013 11:25 AM, Gnarlodious wrote: Say I have a tuple I want to expand assigning to variables: tup = *func() What is the asterisk for? I assume it's a python 3 thing, because I get a syntax error, but I'm having trouble Googling it. Thanks, Tobiah -- http://mail.python.org/mailman/

Re: Process tuple contents on the fly

2013-04-15 Thread MRAB
On 15/04/2013 20:05, Barrett Lewis wrote: d = {} for key, d[key] in (("this",18), ("that",17), ("other",38)): print key do_something(d) Why not use a dict comprehension? d = {k:v for k,v in (("this",18), ("that",17), ("other",38))} I feel this is more straig

Re: Process tuple contents on the fly

2013-04-15 Thread Barrett Lewis
> In the particular case I did it in, I needed the incremental results > passed to a function, not just the final result. I don't think this > made it into the final code, rather it was expanded to be more > readable. But the discovery made me feel a disturbance in the > Pythonic force of the uni

Re: Making ETL from Access 97 to Access 2003

2013-04-15 Thread Paul Simon
"rusi" wrote in message news:92551c63-1347-4f1a-9dca-d1bbd5e4d...@ys5g2000pbc.googlegroups.com... Its hard to distinguish what you are saying from what I said because you've lost the quotes. On Apr 15, 9:01 pm, "Paul Simon" wrote: > "rusi" wrote in message > > news:ff550c58-58b0-4bf2-bf12-089

Re: Process tuple contents on the fly

2013-04-15 Thread Tim Chase
On 2013-04-15 12:05, Barrett Lewis wrote: > > d = {} > > for key, d[key] in (("this",18), ("that",17), ("other",38)): > > print key > > do_something(d) > > Why not use a dict comprehension? > d = {k:v for k,v in (("this",18), ("that",17), ("other",38))} > > I feel this is more straig

Re: Process tuple contents on the fly

2013-04-15 Thread Peter Otten
Tim Chase wrote: > On 2013-04-15 11:25, Gnarlodious wrote: >> Say I have a tuple I want to expand assigning to variables: >> >> tup = *func() >> var = tup[0] >> lst.append(tup[1]) >> >> Or could I do it in one line? >> >> var, lst.append() = *func() >> >> So I want to append one variable to a

Re: Process tuple contents on the fly

2013-04-15 Thread Barrett Lewis
> d = {} > for key, d[key] in (("this",18), ("that",17), ("other",38)): > print key > do_something(d) > Why not use a dict comprehension? d = {k:v for k,v in (("this",18), ("that",17), ("other",38))} I feel this is more straightforward and easier to read. the results are the same how

Re: Process tuple contents on the fly

2013-04-15 Thread Tim Chase
On 2013-04-15 11:25, Gnarlodious wrote: > Say I have a tuple I want to expand assigning to variables: > > tup = *func() > var = tup[0] > lst.append(tup[1]) > > Or could I do it in one line? > > var, lst.append() = *func() > > So I want to append one variable to a list on the fly, is it > possib

Re: Unicode issue with Python v3.3

2013-04-15 Thread Νίκος Γκρ33κ
Hello, can you still help me please? -- http://mail.python.org/mailman/listinfo/python-list

Process tuple contents on the fly

2013-04-15 Thread Gnarlodious
Say I have a tuple I want to expand assigning to variables: tup = *func() var = tup[0] lst.append(tup[1]) Or could I do it in one line? var, lst.append() = *func() So I want to append one variable to a list on the fly, is it possible? -- Gnarlie http://gnarlodious.com -- http://mail.python.or

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Antoon Pardon
Op 15-04-13 12:11, Steven D'Aprano schreef: Python's data model has always been 100% object oriented. Prior to the "class/type" unification, it simply had *two distinct* implementations of objects: types, which were written in C, and classes, which were written in Python. After unification, th

Re: Iterating dictionary items + if statement results in problems

2013-04-15 Thread Dave Angel
On 04/15/2013 09:37 AM, Ombongi Moraa Fe wrote: Hello Team, Thanks for your input. |Possibly it's not matching because of your mistaken use of octal. Octal won't hurt for ints below 8, but you probably don't restrict it in the real code. For example, v = 030 will not match equal in the follo

Re: Threadpool item mailboxes design problem

2013-04-15 Thread Charles Hixson
On 04/14/2013 07:32 PM, Chris Rebert wrote: On Apr 14, 2013 4:27 PM, "Charles Hixson" > wrote: > > What is the best approach to implementing actors that accept and post messages (and have no other external contacts). You might look at how some of the existi

Re: Making ETL from Access 97 to Access 2003

2013-04-15 Thread rusi
Its hard to distinguish what you are saying from what I said because you've lost the quotes. On Apr 15, 9:01 pm, "Paul Simon" wrote: > "rusi" wrote in message > > news:ff550c58-58b0-4bf2-bf12-08986ab2b...@ka6g2000pbb.googlegroups.com... > On Apr 15, 5:27 pm, Steeve wrote: > > > Hi, > > > I need

Re: Making ETL from Access 97 to Access 2003

2013-04-15 Thread Paul Simon
"rusi" wrote in message news:ff550c58-58b0-4bf2-bf12-08986ab2b...@ka6g2000pbb.googlegroups.com... On Apr 15, 5:27 pm, Steeve wrote: > Hi, > > I need to take data from 5 differents (but similar) database in MS Access > 97 and merge them into one MS Access 2003 database. Not sure what this had

Cross-compiling Python for ARM?

2013-04-15 Thread Gilles
Hello I tried running uWSGI on an ARM-based appliance, but it fails. Apparently, it could be due to the official Python 2.6.6 interpreter in the depot not being compiled the way uWSGI expects it to be: ./configure --enable-shared; make; make install; www.raspberrypi.org/phpBB3/viewtopic.php?f=3

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Matthias Felleisen
On Apr 14, 2013, at 11:48 PM, Mark Janssen wrote: > After the 2001 "type/class unification" , it went towards Alan Kay's ideal Are you sure? Remember Kay's two motivations [*], which he so elegantly describes with "[the] large scale one was to find a better module scheme for complex systems

Re: Iterating dictionary items + if statement results in problems

2013-04-15 Thread Ombongi Moraa Fe
Hello Team, Thanks for your input. |Possibly it's not matching because of your mistaken use of octal. Octal won't hurt for ints below 8, but you probably don't restrict it in the real code. For example, v = 030 will not match equal in the following: I've changed the key,value pairs in the dic

Re: Making ETL from Access 97 to Access 2003

2013-04-15 Thread rusi
On Apr 15, 5:27 pm, Steeve wrote: > Hi, > > I need to take data from 5 differents (but similar) database in MS Access 97 > and merge them into one MS Access 2003 database. Not sure what this had to do with python. However… You could write out the five as csvs and then read in those csvs. This is

Re: Grammar question: Englisn and Python: qualified names

2013-04-15 Thread Chris Angelico
On Mon, Apr 15, 2013 at 10:28 PM, Tim Chase wrote: > On 2013-04-15 07:50, Chris Angelico wrote: >> Quirky question time! >> ... or possibly a collections.OrderedDict... >> ... or possibly an collections.OrderedDict... > > If you're smart enough to elide the "collections [dot]" from your > pronunci

Making ETL from Access 97 to Access 2003

2013-04-15 Thread Steeve
Hi, I need to take data from 5 differents (but similar) database in MS Access 97 and merge them into one MS Access 2003 database. Is some packages exist to do this task? Thank -- http://mail.python.org/mailman/listinfo/python-list

Re: Grammar question: Englisn and Python: qualified names

2013-04-15 Thread Tim Chase
On 2013-04-15 07:50, Chris Angelico wrote: > Quirky question time! > ... or possibly a collections.OrderedDict... > ... or possibly an collections.OrderedDict... If you're smart enough to elide the "collections [dot]" from your pronunciation, you're smart enough to adjust the a/an accordingly. Use

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-15 Thread Chris Angelico
On Mon, Apr 15, 2013 at 9:45 PM, rusi wrote: > I am trying to understand your points Chris. On the one hand you say: > > On Apr 14, 6:22 pm, Chris Angelico wrote: >> No, no, a thousand times no! If I am doing financial transactions, >> even if I'm alone on my machine, I will demand full ACID comp

Re: classes and sub classes?

2013-04-15 Thread Neil Cerutti
On 2013-04-15, Peter Otten <__pete...@web.de> wrote: > Jason Friedman wrote: >>> NwInvDb = NetworkInventoryDatabase, yes you are correct, it >>> creates the database handle and makes it ready for use. >> >> I am interested in opinions. I for one dislike abbreviations >> on the theory that program

Re: Iterating dictionary items + if statement results in problems

2013-04-15 Thread Dave Angel
On 04/15/2013 06:50 AM, Ombongi Moraa Fe wrote: hello Team, I have this fairly simple script to iterate the dictionary items and check if the items match certain values; dictionary={'1234567890':001, '0987654321':002} for k, v in dictionary.iteritems(): . . #suds clie

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-15 Thread rusi
I am trying to understand your points Chris. On the one hand you say: On Apr 14, 6:22 pm, Chris Angelico wrote: > No, no, a thousand times no! If I am doing financial transactions, > even if I'm alone on my machine, I will demand full ACID compliance. On the other you describe a bookmark stora

RE: Iterating dictionary items + if statement results in problems

2013-04-15 Thread Peter Otten
Ombongi Moraa Fe wrote: > hello Team, > > I have this fairly simple script to iterate the dictionary items and check > if the items match certain values; > > dictionary={'1234567890':001, '0987654321':002} > for k, v in dictionary.iteritems(): > . > . #suds client statem

Re: Iterating dictionary items + if statement results in problems

2013-04-15 Thread Mark Lawrence
On 15/04/2013 11:50, Ombongi Moraa Fe wrote: hello Team, I have this fairly simple script to iterate the dictionary items and check if the items match certain values; dictionary={'1234567890':001, '0987654321':002} for k, v in dictionary.iteritems(): . . #suds client

RE: Iterating dictionary items + if statement results in problems

2013-04-15 Thread Ombongi Moraa Fe
hello Team, I have this fairly simple script to iterate the dictionary items and check if the items match certain values; dictionary={'1234567890':001, '0987654321':002} for k, v in dictionary.iteritems(): . . #suds client statements; if (k == '1234567890' and v

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Steven D'Aprano
On Sun, 14 Apr 2013 20:48:05 -0700, Mark Janssen wrote: > Hello, > > I'm new to the list and hoping this might be the right place to > introduce something that has provoked a bit of an argument in my > programming community. > > I'm from the Python programming community. Python is an "interpret

RE: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Moez AbdelGawad
> Date: Sun, 14 Apr 2013 22:55:59 -0700 > From: deles...@gmail.com > To: dreamingforw...@gmail.com > CC: types-l...@lists.seas.upenn.edu; python-list@python.org > Subject: Re: [TYPES] The type/object distinction and possible synthesis of > OOP and imperative programming languages > > [ The

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Uday S Reddy
Mark Janssen writes: > After the 2001 "type/class unification" , it went towards Alan Kay's ideal > of "everything is an object" > > As a contrast, this is very distinct from C++, where everything is > concretely rooted in the language's type model which in *itself* is > rooted (from it's lon

Re: howto remove the thousand separator

2013-04-15 Thread Chris Angelico
On Mon, Apr 15, 2013 at 5:03 PM, Steven D'Aprano wrote: > On Mon, 15 Apr 2013 03:19:43 +0100, Rotwang wrote: > >> On 15/04/2013 02:14, Steven D'Aprano wrote: >>> Strings are immutable. Consider building up a single string from four >>> substrings: >> >> Actually, I believe that CPython is optimise

Re: classes and sub classes?

2013-04-15 Thread Peter Otten
Jason Friedman wrote: >> NwInvDb = NetworkInventoryDatabase, yes you are correct, it creates the > database handle and makes it ready for use. > > I am interested in opinions. I for one dislike abbreviations on the > theory > that programs are read more than they are written. I would probably u

Re: howto remove the thousand separator

2013-04-15 Thread Steven D'Aprano
On Sun, 14 Apr 2013 22:35:42 -0400, Roy Smith wrote: > In article , > Walter Hurry wrote: > >> On Mon, 15 Apr 2013 11:29:17 +1000, Chris Angelico wrote: >> >> > There are actually a lot of optimizations done, so it might turn out >> > to be O(n) in practice. But strictly in the Python code, ye

Re: howto remove the thousand separator

2013-04-15 Thread Steven D'Aprano
On Mon, 15 Apr 2013 03:19:43 +0100, Rotwang wrote: > On 15/04/2013 02:14, Steven D'Aprano wrote: >> On Sun, 14 Apr 2013 17:44:28 -0700, Mark Janssen wrote: >> >>> On Sun, Apr 14, 2013 at 5:29 PM, Steven D'Aprano >>> wrote: On Sun, 14 Apr 2013 12:06:12 -0700, Mark Janssen wrote: > cl