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

2013-04-14 Thread DeLesley Hutchins
I'm not quite sure I understand your question, but I'll give it a shot. :-) The C/C++ model, in which the types are anchored to the machine hardware, in the exception, not the rule. In the academic literature, "type theory" is almost entirely focused on studying abstract models of computation t

Re: Grammar question: Englisn and Python: qualified names

2013-04-14 Thread Stefan Schwarzer
Hi Chris, On 2013-04-14 23: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 > ab

Re: howto remove the thousand separator

2013-04-14 Thread Ned Deily
In article , Rotwang wrote: > (Sorry for linking to Google Groups. Does anyone know of a better c.l.p. > web archive?) http://dir.gmane.org/gmane.comp.python.general -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

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

2013-04-14 Thread Terry Jan Reedy
Note: cross-posting to mailing lists does not work well. Hence the reply only to python-list and the gmane mirror. On 4/14/2013 11:48 PM, Mark Janssen wrote: Python is an "interpreted" language. I consider this a useless or even deceptive statement. Python is an object-based algorithm langu

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

2013-04-14 Thread Mark Janssen
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 "interpreted" language. Since 2001, Python's has migrated towards a "pure" Objec

Re: Threadpool item mailboxes design problem

2013-04-14 Thread 88888 Dihedral
Charles Hixson於 2013年4月15日星期一UTC+8上午7時12分11秒寫道: > What is the best approach to implementing actors that accept and post > > messages (and have no other external contacts). > > > > So far what I've come up with is something like: > > actors = {} > > mailboxs = {} > > > > Stuff actors w

Re: howto remove the thousand separator

2013-04-14 Thread Roy Smith
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, yes, this is > > definitely O(n*n). > > In any event, Janssen sho

Re: Threadpool item mailboxes design problem

2013-04-14 Thread Chris Rebert
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 existing Python actor libraries are implemented (perhaps one of these might even save you fr

Re: howto remove the thousand separator

2013-04-14 Thread Walter Hurry
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, yes, this is > definitely O(n*n). In any event, Janssen should cease and desist offering advice here if he c

Re: howto remove the thousand separator

2013-04-14 Thread Rotwang
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: cleaned='' for c in myStringNumber: if c != ',': cleaned+=c int(clean

Re: classes and sub classes?

2013-04-14 Thread MRAB
On 15/04/2013 02:38, 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 woul

Re: classes and sub classes?

2013-04-14 Thread Jason Friedman
> 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 use this variable name: network_in

Re: howto remove the thousand separator

2013-04-14 Thread Chris Angelico
On Mon, Apr 15, 2013 at 11:14 AM, Steven D'Aprano wrote: > On Sun, 14 Apr 2013 17:44:28 -0700, Mark Janssen wrote: >> What on earth makes you think that is an O(n**2) algorithm and not O(n)? > > Python *might* optimize the first concatenation, '' + 'fe', to just reuse > 'fe', (but it might not). L

Re: howto remove the thousand separator

2013-04-14 Thread Steven D'Aprano
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: >> >>> cleaned='' >>> for c in myStringNumber: >>>if c != ',': >>> cleaned+=c >>> int(cleaned) >> >> due to b

Re: howto remove the thousand separator

2013-04-14 Thread Mark Janssen
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: > >> cleaned='' >> for c in myStringNumber: >>if c != ',': >> cleaned+=c >> int(cleaned) > > due to being an O(N**2) algorithm. What on earth makes you think that is an

Re: Grammar question: Englisn and Python: qualified names

2013-04-14 Thread Ethan Furman
On 04/14/2013 02:50 PM, 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 one of th

Re: howto remove the thousand separator

2013-04-14 Thread Steven D'Aprano
On Sun, 14 Apr 2013 12:06:12 -0700, Mark Janssen wrote: > cleaned='' > for c in myStringNumber: >if c != ',': > cleaned+=c > int(cleaned) Please don't write code like that. Firstly, it's long and bloated, and runs at the speed of Python, not C. Second, it runs at the speed of S

Threadpool item mailboxes design problem

2013-04-14 Thread Charles Hixson
What is the best approach to implementing actors that accept and post messages (and have no other external contacts). So far what I've come up with is something like: actors = {} mailboxs = {} Stuff actors with actor instances, mailboxes with multiprocessing.queue instances. (Actors and

Re: Grammar question: Englisn and Python: qualified names

2013-04-14 Thread MRAB
On 14/04/2013 22: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 one of them:

Using xtopdf and pypyodbc to publish MS Access database data to PDF

2013-04-14 Thread vasudevram
Wrote a program that lets you publish your MS Access database data to PDF, using Python, ReportLab, xtopdf (my toolkit) and pypyodbc. Sharing it here. Link: http://jugad2.blogspot.in/2013/04/using-xtopdf-and-pypyodbc-to-publish-ms.html Note: Saw some comments about my blog post on the Python

Grammar question: Englisn and Python: qualified names

2013-04-14 Thread Chris Angelico
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 one of them: ... or possibly a collections.OrderedDict..

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

2013-04-14 Thread Roy Smith
In article , Tim Chase wrote: > I'd really love if there was a simple DNS-lookup module available in > the stdlib, especially if it allowed overriding the server to ask. pip install dnspython -- http://mail.python.org/mailman/listinfo/python-list

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

2013-04-14 Thread Chris Angelico
On Mon, Apr 15, 2013 at 2:40 AM, Ned Deily wrote: > In article > , > Chris Angelico wrote: > > Actually, this is one place where I disagree with the current decision >> of the Python core devs: I think bindings for other popular databases >> (most notably PostgreSQL, and probably MySQL since it

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

2013-04-14 Thread Tim Chase
On 2013-04-14 09:40, Ned Deily wrote: > DNS client lookups use published, well-understood > Internet-standard protocols, not at all like talking to a > third-party database, be it open-source or not. That said, even though DNS is a publicly documented standard, I've reached for DNS code in the Py

Re: howto remove the thousand separator

2013-04-14 Thread Mark Lawrence
On 14/04/2013 19:57, pyth0n3r wrote: Hi, I came across a problem that when i deal with int data with ',' as thousand separator, such as 12,916, i can not change it into int() or float(). How can i remove the comma in int data? Any reply will be appreciated!! Best, Chen Use the string replace

Re: howto remove the thousand separator

2013-04-14 Thread Mark Janssen
> I would do int(num.replace(',', '')) That's much more pythonic than my C-ish version Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: howto remove the thousand separator

2013-04-14 Thread D'Arcy J.M. Cain
On Mon, 15 Apr 2013 02:57:35 +0800 "pyth0n3r" wrote: > float(). How can i remove the comma in int data? Any reply will be int(n.replace(',', '')) -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 788 2246 (Do

Re: howto remove the thousand separator

2013-04-14 Thread Mitya Sirenef
On 04/14/2013 02:57 PM, pyth0n3r wrote: Hi, > I came across a problem that when i deal with int data with ',' as thousand separator, such as 12,916, i can not change it into int() or float(). > How can i remove the comma in int data? > Any reply will be appreciated!! > > Best, > Chen > > > I

Re: howto remove the thousand separator

2013-04-14 Thread Mark Janssen
On Sun, Apr 14, 2013 at 11:57 AM, pyth0n3r wrote: > I came across a problem that when i deal with int data with ',' as thousand > separator, such as 12,916, i can not change it into int() or float(). > How can i remove the comma in int data? > Any reply will be appreciated!! cleaned='' for c in m

howto remove the thousand separator

2013-04-14 Thread pyth0n3r
Hi, I came across a problem that when i deal with int data with ',' as thousand separator, such as 12,916, i can not change it into int() or float(). How can i remove the comma in int data? Any reply will be appreciated!! Best, Chen -- http://mail.python.org/mailman/listinfo/python-list

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

2013-04-14 Thread Cousin Stanley
Steven D'Aprano wrote: > On Fri, 12 Apr 2013 23:26:05 +, Cousin Stanley wrote: > >> The firefox browser keeps different sqlite database files for various >> uses > > Yes, and I *really* wish they wouldn't. > > It's my number 1 cause of major problems with Firefox. Problems with so

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

2013-04-14 Thread Ned Deily
In article , Chris Angelico wrote: > Actually, this is one place where I disagree with the current decision > of the Python core devs: I think bindings for other popular databases > (most notably PostgreSQL, and probably MySQL since it's so widely > used) ought to be included in core, rather th

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

2013-04-14 Thread Chris Angelico
On Sun, Apr 14, 2013 at 9:17 PM, rusi wrote: > On Apr 14, 12:56 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> I've given my view on >> application developers -- specifically, Firefox -- using a not-quite ACID >> database in a way that is fragile, can cause data loss, > > FUD > Ar

Re: Unicode issue with Python v3.3

2013-04-14 Thread nagia . retsina
Τη Κυριακή, 14 Απριλίου 2013 12:28:32 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: > On 13Apr2013 23:00, nagia.rets...@gmail.com wrote: > > | root@nikos [/home/nikos/public_html/foo-py]# pwd > > | /home/nikos/public_html/foo-py > > | root@nikos [/home/nikos/public_html/foo-py]# cat foo.py >

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

2013-04-14 Thread rusi
On Apr 14, 12:56 pm, Steven D'Aprano wrote: > On Sat, 13 Apr 2013 10:02:18 -0700, rusi wrote: > > To the OP: > > Steven is welcome to his views about use of databases. > > I haven't given any views about databases. You are twisting "use of databases" to just "about databases" And heres what you

Re: API design for Python 2 / 3 compatibility

2013-04-14 Thread Stefan Schwarzer
Terry, Ethan: Thanks a lot for your excellent advice. :-) On 2013-04-13 19:32, Terry Jan Reedy wrote: > Approach 2 matches (or should match) io.open, which became > builtin open in Python 3. I would simply document that > ftp_host.open mimics io.open in the same way that > ftp_host.chdir, etceter

Re: Unicode issue with Python v3.3

2013-04-14 Thread Cameron Simpson
On 13Apr2013 23:00, nagia.rets...@gmail.com wrote: | root@nikos [/home/nikos/public_html/foo-py]# pwd | /home/nikos/public_html/foo-py | root@nikos [/home/nikos/public_html/foo-py]# cat foo.py | #!/bin/sh | exec 2>>/home/nikos/cgi.err.out | echo "$0 $*" >&2 | id >&2 | env | sort >&2 | set -x | ex

python setup.py install and dependencies

2013-04-14 Thread Marco
I have a some confusion about the package installation process. Let's say I have manually installed Python 3.3, so I don't have distribute and pip. Now I want to install the bpython shell, so I download the source code and after I try to do "python3.3 setup.py install". I did so, and all it'is

كيف تعالج الهالات السوداء أسفل العين

2013-04-14 Thread 23alagmy
كيف تعالج الهالات السوداء أسفل العين http://natigtas7ab.blogspot.com/2013/04/blog-post_5060.html انشرا على الفيس بك https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fnatigtas7ab.blogspot.com%2F2013%2F04%2Fblog-post_5060.html%23.UWpinJbOYeo.facebook انشرها على تويتر https://twitter.com/in

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

2013-04-14 Thread Steven D'Aprano
On Sat, 13 Apr 2013 10:02:18 -0700, rusi wrote: > To the OP: > Steven is welcome to his views about use of databases. I haven't given any views about databases. I've given my view on application developers -- specifically, Firefox -- using a not-quite ACID database in a way that is fragile, can