Re: case do problem

2010-03-03 Thread Tracubik
Il Wed, 03 Mar 2010 09:39:54 +0100, Peter Otten ha scritto: Tracubik wrote: hi, i've to convert from Pascal this code: program loop; function generic_condition: boolean; begin generic_condition := random 0.7 end; procedure loop; var iterations, count, m: integer; begin

Pylint Argument number differs from overridden method

2010-03-03 Thread Wanderer
Pylint W0221 gives the warning Argument number differs from overridden method. Why is this a problem? I'm overriding the method to add additional functionality. This def GetRays(self, angle, pt, lmbda = 0.6): angle, x, y, Rays, Power = self.ARefract(angle, pt[0],

Instance factory - am I doing this right?

2010-03-03 Thread Laszlo Nagy
This is just an interesting code pattern that I have recently used: class CacheStorage(object): Generic cache storage class. @classmethod def get_factory(cls,*args,**kwargs): Create factory for a given set of cache storage creation parameters. class

Re: taking python enterprise level?...

2010-03-03 Thread Tim Wintle
On Wed, 2010-03-03 at 17:26 +0100, mk wrote: So there *may* be some evidence that joins are indeed bad in practice. If someone has smth specific/interesting on the subject, please post. I have found joins to cause problems in a few cases - I'm talking about relatively large tables though -

Re: Docstrings considered too complicated

2010-03-03 Thread mk
D'Arcy J.M. Cain wrote: Makes me want to go down to the basement and fire up the Altair. :-) Please don't, or else I fire up that univ Yugoslavian copy of VAX with Pascal compiler (where I wrote my first program) and I will start my first program of ping-pong. It was a few hundred lines

Re: Docstrings considered too complicated

2010-03-03 Thread Ed Keith
--- On Wed, 3/3/10, D'Arcy J.M. Cain wrote: They needed a way to tell where the end of the information was.  Why they used ^Z (SUB - Substitute) instead of ^C (ETX - End of TeXt) or even ^D (EOT - End Of Transmission) is anyone's guess. That has always puzzled me to. ETX and EOT were well

Re: cpan for python?

2010-03-03 Thread John Bokma
John Gabriele jmg3...@gmail.com writes: On Mar 2, 11:58 pm, John Bokma j...@castleamber.com wrote: Lie Ryan lie.1...@gmail.com writes: On 03/03/2010 09:47 AM, TomF wrote: [..] There is also a program called cpan, distributed with Perl.  It is used for searching, downloading,

Re: taking python enterprise level?...

2010-03-03 Thread Steve Holden
mk wrote: D'Arcy J.M. Cain wrote: I keep seeing this statement but nothing to back it up. I have created many apps that run on Python with a PostgreSQL database with a fully normalized schema and I can assure you that database joins were never my problem unless I made a badly constructed

Re: Docstrings considered too complicated

2010-03-03 Thread MRAB
D'Arcy J.M. Cain wrote: On Wed, 3 Mar 2010 15:05:54 + (UTC) Grant Edwards inva...@invalid.invalid wrote: It was actually an improvement over CP/M's file system. CP/M didn't have hierarchical directories Neither did the original MS-DOS filesystem. I think that it always had a hierarchical

Re: Sort Big File Help

2010-03-03 Thread mk
John Filben wrote: I am new to Python but have used many other (mostly dead) languages in the past. I want to be able to process *.txt and *.csv files. I can now read that and then change them as needed – mostly just take a column and do some if-then to create a new variable. My problem is

Re: Eric4 vs Python3.1

2010-03-03 Thread Detlev Offenbach
Zhu Sha Zang wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Someone using Eric4 to program with Python3/3.1? What can i do, because he insist to use only Python2.6.4. You can tell it the file extension to use for Python3 files or better yet use eric5, which is the Python3 port of

Re: Docstrings considered too complicated

2010-03-03 Thread Richard Brodie
Ed Keith e_...@yahoo.com wrote in message news:mailman.215.1267639293.23598.python-l...@python.org... That has always puzzled me to. ETX and EOT were well established, why no use one of them? I'd love to know what they were thinking. It goes back to ancient PDP operating systems, so may

Re: Docstrings considered too complicated

2010-03-03 Thread MRAB
D'Arcy J.M. Cain wrote: On Wed, 03 Mar 2010 14:42:00 + MRAB pyt...@mrabarnett.plus.com wrote: Gregory Ewing wrote: Mk14 from Science of Cambridge, a kit with hex keypad and 7-segment display, which I had to solder together, and also make my own power supply. I had the extra RAM and the I/O

memory usage, temporary and otherwise

2010-03-03 Thread mk
Obviously, don't try this on low-memory machine: a={} for i in range(1000): ... a[i]='spam'*10 ... import sys sys.getsizeof(a) 201326728 id(a[1]) 3085643936L id(a[100]) 3085713568L ids={} for i in range(len(a)): ... ids[id(a[i])]=True ... len(ids.keys()) 1000 Hm,

Re: A scopeguard for Python

2010-03-03 Thread Robert Kern
On 2010-03-03 11:18 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 09:56 AM, Alf P. Steinbach wrote: * Mike Kent: What's the compelling use case for this vs. a simple try/finally? if you thought about it you would mean a simple try/else. finally is always executed. which is

Re: Sample code usable Tkinter listbox

2010-03-03 Thread Alf P. Steinbach
* Alf P. Steinbach: In case Someone Else(TM) may need this. This code is just how it currently looks, what I needed for my code, so it's not a full-fledged or even tested class. But it works. That code evolved a little to cover more Tk listbox quirks (thanks to Ratingrick for the

Generic singleton

2010-03-03 Thread mk
Hello, So I set out to write generic singleton, i.e. the one that would do a singleton with attributes of specified class. At first: class Singleton(object): instance = None def __new__(cls, impclass, *args, **kwargs): if cls.instance is None: cls.instance =

Re: NoSQL Movement?

2010-03-03 Thread MRAB
Xah Lee wrote: recently i wrote a blog article on The NoSQL Movement at http://xahlee.org/comp/nosql.html i'd like to post it somewhere public to solicit opinions, but in the 20 min or so, i couldn't find a proper newsgroup, nor private list that my somewhat anti-NoSQL Movement article is

Re: taking python enterprise level?...

2010-03-03 Thread Philip Semanchuk
On Mar 3, 2010, at 11:26 AM, mk wrote: D'Arcy J.M. Cain wrote: I keep seeing this statement but nothing to back it up. I have created many apps that run on Python with a PostgreSQL database with a fully normalized schema and I can assure you that database joins were never my problem unless

Re: Draft PEP on RSON configuration file format

2010-03-03 Thread mk
Steve Howell wrote: Somewhere in the 2020s, though, I predict that a lot of technologies are either going to finally die off, or at least be restricted to the niches that they serve well. Take Java, for example. I think it will be still be used, and people will still even be writing new

Re: Pylint Argument number differs from overridden method

2010-03-03 Thread Robert Kern
On 2010-03-03 11:39 AM, Wanderer wrote: Pylint W0221 gives the warning Argument number differs from overridden method. Why is this a problem? I'm overriding the method to add additional functionality. There are exceptions to every guideline. Doing this could easily be a mistake, so it's one

GZRBOT 0.2 BETA1 released

2010-03-03 Thread Bart Thate
Hello World ! Welcome to the world of Active API ;] Google released their new Wave API so i quickly ported GZRBOT to the new API. Now we can finally push to waves instead of using polling. This makes pushing feeds to waves possible, and this is one of the main things GZRBOT can do. We now use

Re: SOAP 1.2 Python client ?

2010-03-03 Thread Stefan Behnel
BlueBird, 03.03.2010 17:32: I am looking for a SOAP 1.2 python client. To my surprise, it seems that this does not exist. Does anybody know about this ? SOAP may be an overly bloated protocol, but it's certainly not black magic. It's not hard to do manually if you really need to:

Re: Docstrings considered too complicated

2010-03-03 Thread Steve Holden
mk wrote: D'Arcy J.M. Cain wrote: Makes me want to go down to the basement and fire up the Altair. :-) Please don't, or else I fire up that univ Yugoslavian copy of VAX with Pascal compiler (where I wrote my first program) and I will start my first program of ping-pong. It was a few

Re: taking python enterprise level?...

2010-03-03 Thread mk
Hello Tim, Pardon the questions but I haven't had the need to use denormalization yet, so: Tim Wintle wrote: /* Table A*/ CREATE TABLE TableA ( project_id BIGINT NOT NULL, cost INT, date DATETIME, PRIMARY KEY (project_id, date) ); /* Table projects */ CREATE TABLE

Re: Generic singleton

2010-03-03 Thread Arnaud Delobelle
mk mrk...@gmail.com writes: [...] hashable .. All of Python’s immutable built-in objects are hashable, while no mutable containers (such as lists or dictionaries) are. Well ok, hashable they're not; but apparently at least dict and list have id()? lists and dicts are not hashable, but

Re: Docstrings considered too complicated

2010-03-03 Thread mk
Ed Keith wrote: --- On Wed, 3/3/10, D'Arcy J.M. Cain wrote: They needed a way to tell where the end of the information was. Why they used ^Z (SUB - Substitute) instead of ^C (ETX - End of TeXt) or even ^D (EOT - End Of Transmission) is anyone's guess. That has always puzzled me to. ETX and

Re: cpan for python?

2010-03-03 Thread mk
John Bokma wrote: I want to remove something that I installed that way (because it's installation procedure seems to be broken; opensocial) I understand that this can't be blamed on pip, but it's odd that in this century it's still hard to install/uninstall modules :-( Have you looked in a

CGI, POST, and file uploads

2010-03-03 Thread Mitchell L Model
On Mar 2, 2010, at 4:48 PM, I wrote: Can someone tell me how to upload the contents of a (relatively small) file using an HTML form and CGI in Python 3.1? As far as I can tell from a half-day of experimenting, browsing, and searching the Python issue tracker, this is broken. followed by

Re: Docstrings considered too complicated

2010-03-03 Thread David Robinow
On Wed, Mar 3, 2010 at 1:01 PM, Ed Keith e_...@yahoo.com wrote: --- On Wed, 3/3/10, D'Arcy J.M. Cain  wrote: They needed a way to tell where the end of the information was.  Why they used ^Z (SUB - Substitute) instead of ^C (ETX - End of TeXt) or even ^D (EOT - End Of Transmission) is

Re: Sort Big File Help

2010-03-03 Thread MRAB
mk wrote: John Filben wrote: I am new to Python but have used many other (mostly dead) languages in the past. I want to be able to process *.txt and *.csv files. I can now read that and then change them as needed – mostly just take a column and do some if-then to create a new variable. My

Re: Docstrings considered too complicated

2010-03-03 Thread Grant Edwards
On 2010-03-03, mk mrk...@gmail.com wrote: That has always puzzled me to. ETX and EOT were well established, why no use one of them? I'd love to know what they were thinking. Probably nothing: what many people do with confronted with a problem. It reminds me of why Windows uses backslashes

Re: Installing Scrapy on Mac OS X 10.6

2010-03-03 Thread Benjamin Kaplan
On Wed, Mar 3, 2010 at 12:06 PM, Sky Larking skylarkin...@gmail.com wrote: Has anyone successfully installed Scrapy ( http://scrapy.org ) on a Mac OS X machine running 10.6.x? The Documentaion says Mac OS X ships an libxml2 version too old to be used by Scrapy...But doesn't say which version

Re: Re Interest check in some delicious syntactic sugar for except:pass

2010-03-03 Thread Terry Reedy
On 3/3/2010 6:47 AM, Oren Elrad wrote: With that said, let me at least offer a token defense of my position. By way of motivation, I wrote that email after copying/pasting the following a few times around a project until I wrote it into def SilentlyDelete() and its cousin SilentlyRmdir() code

Re: NoSQL Movement?

2010-03-03 Thread ccc31807
On Mar 3, 12:36 pm, Xah Lee xah...@gmail.com wrote: recently i wrote a blog article on The NoSQL Movement athttp://xahlee.org/comp/nosql.html i'd like to post it somewhere public to solicit opinions, but in the 20 min or so, i couldn't find a proper newsgroup, nor private list that my

Re: taking python enterprise level?...

2010-03-03 Thread mk
Philip Semanchuk wrote: So there *may* be some evidence that joins are indeed bad in practice. If someone has smth specific/interesting on the subject, please post. It's an unprovable assertion, or a meaningless one depending on how one defines the terms. You could also say there *may* be

Re: Sort Big File Help

2010-03-03 Thread Arnaud Delobelle
MRAB pyt...@mrabarnett.plus.com writes: mk wrote: John Filben wrote: I am new to Python but have used many other (mostly dead) languages in the past. I want to be able to process *.txt and *.csv files. I can now read that and then change them as needed – mostly just take a column and do

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread Terry Reedy
On 3/3/2010 12:05 PM, John Nagle wrote: We have an equivalent in PyPI, though it's incomplete since many *registered* packages are not actually hosted *at* PyPI. CPAN is a repository. PyPi is an collection of links. As Ben said, PyPI currently is also a respository and not just links to

Re: A scopeguard for Python

2010-03-03 Thread Jerry Hill
On Wed, Mar 3, 2010 at 2:32 PM, Alf P. Steinbach al...@start.no wrote: I'm not sure what that shows, except that you haven't grokked this yet. Maybe you could give us an example of how your code should be used, and how it differs from the other examples people have given? And maybe a quick

Re: A scopeguard for Python

2010-03-03 Thread Robert Kern
On 2010-03-03 13:32 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 11:18 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 09:56 AM, Alf P. Steinbach wrote: * Mike Kent: What's the compelling use case for this vs. a simple try/finally? if you thought about it you would

Re: Generic singleton

2010-03-03 Thread mk
Arnaud Delobelle wrote: mk mrk...@gmail.com writes: [...] hashable .. All of Python’s immutable built-in objects are hashable, while no mutable containers (such as lists or dictionaries) are. Well ok, hashable they're not; but apparently at least dict and list have id()? lists and dicts

Re: Pylint Argument number differs from overridden method

2010-03-03 Thread Terry Reedy
On 3/3/2010 12:39 PM, Wanderer wrote: Pylint W0221 gives the warning Argument number differs from overridden method. Why is this a problem? It *could* indicate a mistake. Lint programs, by definition, are nitpicky, and flag things that are possible problems even though syntactically

Re: Pylint Argument number differs from overridden method

2010-03-03 Thread Wanderer
On Mar 3, 2:33 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-03-03 11:39 AM, Wanderer wrote: Pylint W0221 gives the warning Argument number differs from overridden method. Why is this a problem? I'm overriding the method to add additional functionality. There are exceptions to

Re: Docstrings considered too complicated

2010-03-03 Thread mk
Steve Holden wrote: Puts me in mind of Mario Wolczko's early attempts to implement SmallTalk on a VAX 11/750. The only bitmapped display we had available was a Three Rivers PERQ, connected by a 9600bps serial line. We left it running at seven o'clock one evening, and by nine am the next day it

Re: taking python enterprise level?...

2010-03-03 Thread D'Arcy J.M. Cain
On Wed, 03 Mar 2010 20:39:35 +0100 mk mrk...@gmail.com wrote: If you denormalise the table, and update the first index to be on (client_id, project_id, date) it can end up running far more quickly - Maybe. Don't start with denormalization. Write it properly and only consider changing if

Re: Installing Scrapy on Mac OS X 10.6

2010-03-03 Thread Ned Deily
In article 9b08574f-0410-45bc-89af-0d3cf7d21...@e7g2000yqf.googlegroups.com, Sky Larking skylarkin...@gmail.com wrote: Has anyone successfully installed Scrapy ( http://scrapy.org ) on a Mac OS X machine running 10.6.x? The Documentaion says Mac OS X ships an libxml2 version too old to be

Old farts playing with their toys (was: Docstrings...)

2010-03-03 Thread D'Arcy J.M. Cain
On Wed, 03 Mar 2010 18:34:51 + MRAB pyt...@mrabarnett.plus.com wrote: But I was still able to play Nim and Duck Shoot (after keying it in)! Did you ever play Star Trek with sound effects? I was never able to get it to work but supposedly if you put an AM radio tuned to a specific frequency

DOS Follies (Was: Docstrings...)

2010-03-03 Thread D'Arcy J.M. Cain
On Wed, 03 Mar 2010 20:44:08 +0100 mk mrk...@gmail.com wrote: It reminds me of why Windows uses backslashes for path separation instead of slashes: what I've *heard*, and do not know if it's true, it's because Gates fancied using / for options switch instead of -, and to hell with

Re: A scopeguard for Python

2010-03-03 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-03 13:32 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 11:18 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 09:56 AM, Alf P. Steinbach wrote: * Mike Kent: What's the compelling use case for this vs. a simple try/finally? if you thought about

Re: Docstrings considered too complicated

2010-03-03 Thread Ed Keith
--- On Wed, 3/3/10, David Robinow drobi...@gmail.com wrote: From: David Robinow drobi...@gmail.com Subject: Re: Docstrings considered too complicated To: python-list@python.org Date: Wednesday, March 3, 2010, 2:54 PM On Wed, Mar 3, 2010 at 1:01 PM, Ed Keith e_...@yahoo.com wrote: --- On

Re: Old farts playing with their toys

2010-03-03 Thread MRAB
D'Arcy J.M. Cain wrote: On Wed, 03 Mar 2010 18:34:51 + MRAB pyt...@mrabarnett.plus.com wrote: But I was still able to play Nim and Duck Shoot (after keying it in)! Did you ever play Star Trek with sound effects? I was never able to get it to work but supposedly if you put an AM radio

Re: Sort Big File Help

2010-03-03 Thread mk
John, there's an error in my program, I forgot that list.sort() method doesn't return the list (it sorts in place). So it should look like: #!/usr/bin/python def sortit(fname): fo = open(fname) linedict = {} for line in fo: key = line[:3] linedict[key] = line

Re: Sort Big File Help

2010-03-03 Thread mk
MRAB wrote: [snip] Simpler would be: lines = f.readlines() lines.sort(key=lambda line: line[ : 3]) or even: lines = sorted(f.readlines(), key=lambda line: line[ : 3])) Sure, but a complete newbie (I have this impression about OP) doesn't have to know about lambda. I expected

Re: NoSQL Movement?

2010-03-03 Thread toby
On Mar 3, 3:54 pm, ccc31807 carte...@gmail.com wrote: On Mar 3, 12:36 pm, Xah Lee xah...@gmail.com wrote: recently i wrote a blog article on The NoSQL Movement athttp://xahlee.org/comp/nosql.html i'd like to post it somewhere public to solicit opinions, but in the 20 min or so, i

Re: Docstrings considered too complicated

2010-03-03 Thread Andreas Waldenburger
On Wed, 03 Mar 2010 22:19:04 +0100 mk mrk...@gmail.com wrote: For the uncouth yobs, err, culturally-challenged: http://www.youtube.com/watch?v=Xe1a1wHxTyo (Four Yorkshiremen) http://www.youtube.com/watch?v=-eDaSvRO9xA That's the definitive version. I mean, if you're going to talk

Version 0.3.8 of the Python config module has been released.

2010-03-03 Thread Vinay Sajip
Version 0.3.8 of the Python config module has been released. What Does It Do? The config module allows you to implement a hierarchical configuration scheme with support for mappings and sequences, cross-references between one part of the configuration and another, the ability to

Re: Sort Big File Help

2010-03-03 Thread Jonathan Gardner
On Wed, Mar 3, 2010 at 8:19 AM, John Filben johnfil...@yahoo.com wrote: I am new to Python but have used many other (mostly dead) languages in the past.  I want to be able to process *.txt and *.csv files.  I can now read that and then change them as needed – mostly just take a column and do

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread Jonathan Gardner
On Wed, Mar 3, 2010 at 1:00 PM, Terry Reedy tjre...@udel.edu wrote: People who are familiar with and like CPAN are free to help improve PyPI. Those of us not familiar with it may not know what we are missing, or have little idea about what works with CPAN. CPAN also covers up some

Re: Generic singleton

2010-03-03 Thread Jonathan Gardner
On Wed, Mar 3, 2010 at 1:11 PM, mk mrk...@gmail.com wrote: Or I could make my life simpler and use global variable. :-) Ding ding ding! 90% of Design Patterns is making Java suck less. Other languages don't necessarily suffer from Java's design flaws. -- Jonathan Gardner

Re: NoSQL Movement?

2010-03-03 Thread Jonathan Gardner
On Wed, Mar 3, 2010 at 12:54 PM, ccc31807 carte...@gmail.com wrote: As with anything else, you need to match the tool to the job. Yes, I feel that relational database technology has been much used, and much abused. However, one of my favorite applications is Postgres, and I think it's

Re: There should be one-- and preferably only one --obvious way to do it

2010-03-03 Thread Ben Finney
Lie Ryan lie.1...@gmail.com writes: There are lots of reason why bare-except is bad, one being is that it makes it way too easy to ignore errors that you don't actually want to silence; and given that bare-excepts would prevent Ctrl+C (Interrupt) from working. Sorry, but IMHO we shouldn't

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread Ben Finney
Terry Reedy tjre...@udel.edu writes: On 3/3/2010 12:05 PM, John Nagle wrote: CPAN is a repository. PyPi is an collection of links. As Ben said, PyPI currently is also a respository and not just links to other repositories. It's a repository with holes. Just because a package is registered

Re: Generic singleton

2010-03-03 Thread Bruno Desthuilliers
mk a écrit : does every builtin class have unique id? Classes are objects. And every object *within a python process* has it's own unique id. For a definition of unique being unique amongst the objects living in the process at a given time - IOW, if an object is garbage-collected, it's id can

Re: cpan for python?

2010-03-03 Thread Ben Finney
John Bokma j...@castleamber.com writes: I want to remove something that I installed [with its Distutils build system] (because it's installation procedure seems to be broken; opensocial) I understand that this can't be blamed on pip, but it's odd that in this century it's still hard to

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread Peter Billam
On 2010-03-03, John Nagle na...@animats.com wrote: Ben Finney wrote: Olof Bjarnason olof.bjarna...@gmail.com writes: The Where is CPAN for Python? question keeps popping up, with answers ranging from There is no CPAN for Python and We already have CPAN for Python (confusing). Caused in no

Re: taking python enterprise level?...

2010-03-03 Thread Philip Semanchuk
On Mar 3, 2010, at 3:58 PM, mk wrote: Philip Semanchuk wrote: So there *may* be some evidence that joins are indeed bad in practice. If someone has smth specific/interesting on the subject, please post. It's an unprovable assertion, or a meaningless one depending on how one defines the

Re: NoSQL Movement?

2010-03-03 Thread Avid Fan
Jonathan Gardner wrote: I see it as a sign of maturity with sufficiently scaled software that they no longer use an SQL database to manage their data. At some point in the project's lifetime, the data is understood well enough that the general nature of the SQL database is unnecessary. I am

Re: memory usage, temporary and otherwise

2010-03-03 Thread Bruno Desthuilliers
mk a écrit : Obviously, don't try this on low-memory machine: a={} for i in range(1000): Note that in Python 2, this will build a list of 1000 int objects. You may want to use xrange instead... ... a[i]='spam'*10 ... import sys sys.getsizeof(a) 201326728 id(a[1])

Re: memory usage, temporary and otherwise

2010-03-03 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : mk a écrit : (snip) So sys.getsizeof returns some 200MB for this dictionary. But according to top RSS of the python process is 300MB. ps auxw says the same thing (more or less). Why the 50% overhead? Oh, and yes - the interpreter itself, the builtins, and all

Re: Docstrings considered too complicated

2010-03-03 Thread David Robinow
On Wed, Mar 3, 2010 at 3:02 PM, Grant Edwards inva...@invalid.invalid wrote: On 2010-03-03, mk mrk...@gmail.com wrote: That has always puzzled me to. ETX and EOT were well established, why no use one of them? I'd love to know what they were thinking. Probably nothing: what many people do

Twisted 10.0.0 released

2010-03-03 Thread Jonathan Lange
On behalf of Twisted Matrix Laboratories, I am honored to announce the release of Twisted 10.0. Highlights include: * Improved documentation, including Twisted Web in 60 seconds * Faster Perspective Broker applications * A new Windows installer that ships without zope.interface * Twisted

Re: A scopeguard for Python

2010-03-03 Thread Robert Kern
On 2010-03-03 15:35 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 13:32 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 11:18 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 09:56 AM, Alf P. Steinbach wrote: * Mike Kent: What's the compelling use case for this

Re: Method / Functions - What are the differences?

2010-03-03 Thread Eike Welk
Bruno Desthuilliers wrote: John Posner a écrit : Done -- see http://wiki.python.org/moin/FromFunctionToMethod Done and well done !-) Thanks again for the good job John. I like it too, thanks to both of you! I have two small ideas for improvement: - Swap the first two paragraphs. First say

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread Philip Semanchuk
On Mar 3, 2010, at 5:17 PM, Jonathan Gardner wrote: On Wed, Mar 3, 2010 at 1:00 PM, Terry Reedy tjre...@udel.edu wrote: People who are familiar with and like CPAN are free to help improve PyPI. Those of us not familiar with it may not know what we are missing, or have little idea about

Question about typing: ints/floats

2010-03-03 Thread Wells
This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. But: a = 1 b = 3 a / b 0 This does not implicitly do the casting, it treats 'a' and 'b' as integers, and the result as well. Changing 'b' to 3.0 will yield a float

Passing FILE * types using ctypes

2010-03-03 Thread Zeeshan Quireshi
Hello, I'm using ctypes to wrap a library i wrote. I am trying to pass it a FILE *pointer, how do i open a file in Python and convert it to a FILE *pointer. Or do i have to call the C library using ctypes first, get the pointer and then pass it to my function. Also, is there any automated way to

Re: Question about typing: ints/floats

2010-03-03 Thread Zeeshan Quireshi
On Mar 3, 6:45 pm, Wells thewellsoli...@gmail.com wrote: This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. But: a = 1 b = 3 a / b 0 This does not implicitly do the casting, it treats 'a' and 'b' as

Re: Method / Functions - What are the differences?

2010-03-03 Thread John Posner
On 3/3/2010 6:33 PM, Eike Welk wrote: I have two small ideas for improvement: - Swap the first two paragraphs. First say what it is, and then give the motivation. No problem -- since this is a Wiki, you can perform the swap yourself! (If you haven't done it in a day or so, I'll do the deed.)

Re: Docstrings considered too complicated

2010-03-03 Thread Rhodri James
On Wed, 03 Mar 2010 19:38:16 -, Steve Holden st...@holdenweb.com wrote: mk wrote: D'Arcy J.M. Cain wrote: Makes me want to go down to the basement and fire up the Altair. :-) Please don't, or else I fire up that univ Yugoslavian copy of VAX with Pascal compiler (where I wrote my

Re: PYTHONPATH and eggs

2010-03-03 Thread Jonathan Gardner
On Wed, Mar 3, 2010 at 2:14 AM, geoffbache geoff.ba...@jeppesen.com wrote: I have a very simple problem that seems to have no simple solution. I have a module which is installed centrally and lives in a Python egg. I have experimented with some minor changes to it and would like to set my

Re: Interest check in some delicious syntactic sugar for except:pass

2010-03-03 Thread Rhodri James
On Wed, 03 Mar 2010 09:27:16 -, Oren Elrad orenel...@gmail.com wrote: Howdy all, longtime appreciative user, first time mailer-inner. I'm wondering if there is any support (tepid better than none) for the following syntactic sugar: silence: block - try:

Re: Question about typing: ints/floats

2010-03-03 Thread Mensanator
On Mar 3, 5:45 pm, Wells thewellsoli...@gmail.com wrote: This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. But: a = 1 b = 3 a / b 0 This does not implicitly do the casting, it treats 'a' and 'b' as

Re: A scopeguard for Python

2010-03-03 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-03 15:35 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 13:32 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 11:18 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 09:56 AM, Alf P. Steinbach wrote: * Mike Kent: What's the compelling

Re: Question about typing: ints/floats

2010-03-03 Thread Chris Rebert
On Wed, Mar 3, 2010 at 3:45 PM, Wells thewellsoli...@gmail.com wrote: This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. Remember Python is dynamically typed. Values have types, but variables don't (I could do a =

Re: Question about typing: ints/floats

2010-03-03 Thread Shashwat Anand
yes you can also try: float(a)/b 0.1 On Thu, Mar 4, 2010 at 5:15 AM, Wells thewellsoli...@gmail.com wrote: This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. But: a = 1 b = 3 a / b 0

Re: Question about typing: ints/floats

2010-03-03 Thread Benjamin Kaplan
On Wed, Mar 3, 2010 at 6:45 PM, Wells thewellsoli...@gmail.com wrote: This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. But: a = 1 b = 3 a / b 0 This does not implicitly do the casting, it treats 'a'

Re: Question about typing: ints/floats

2010-03-03 Thread MRAB
Zeeshan Quireshi wrote: On Mar 3, 6:45 pm, Wells thewellsoli...@gmail.com wrote: This seems sort of odd to me: a = 1 a += 1.202 a 2.202 Indicates that 'a' was an int that was implicitly casted to a float. But: a = 1 b = 3 a / b 0 This does not implicitly do the casting, it treats 'a'

Failure in test_hashlib.py and test_hmac.py

2010-03-03 Thread Chris Lieb
I am building Python 2.6.4 on a shared server and am encountering test failures in test_hashlib.py and test_hmac.py, specifically concerning sha512. I recompiled Python with --with-pydebug and CLFAGS=CPPFLAGS=- g and ran the tests in GDB and got the following results:

Re: Passing FILE * types using ctypes

2010-03-03 Thread geremy condra
On Wed, Mar 3, 2010 at 6:50 PM, Zeeshan Quireshi zeeshan.quire...@gmail.com wrote: Hello, I'm using ctypes to wrap a library i wrote. I am trying to pass it a FILE *pointer, how do i open a file in Python and convert it to a FILE *pointer. Or do i have to call the C library using ctypes first,

Re: Question about typing: ints/floats

2010-03-03 Thread Steven D'Aprano
On Wed, 03 Mar 2010 15:45:51 -0800, Wells wrote: But: a = 1 b = 3 a / b 0 This does not implicitly do the casting, it treats 'a' and 'b' as integers, and the result as well. Changing 'b' to 3.0 will yield a float as a result (0.1) This is design flaw in older

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread John Bokma
Philip Semanchuk phi...@semanchuk.com writes: Do Fedora Ubuntu's package managers offer modules that appear in CPAN? Yes, I've installed so far all Perl modules I need that way (sudo apt-get install ...) In other words, if I was a Perl user under Ubuntu would I use the pkg manager to add a

Re: Generic singleton

2010-03-03 Thread Steven D'Aprano
On Wed, 03 Mar 2010 19:54:52 +0100, mk wrote: Hello, So I set out to write generic singleton, i.e. the one that would do a singleton with attributes of specified class. At first: Groan. What is it with the Singleton design pattern? It is one of the least useful design patterns, and yet

Re: Question about typing: ints/floats

2010-03-03 Thread Steven D'Aprano
On Wed, 03 Mar 2010 17:06:01 -0800, Chris Rebert wrote: But yes, internally, Python converted the int to a float before doing the addition. [pedantic] To be precise, Python created a *new* float from the int, leaving the original int alone. Because ints and floats are objects, if Python

Re: PYTHONPATH and eggs

2010-03-03 Thread David Cournapeau
On Wed, Mar 3, 2010 at 7:14 PM, geoffbache geoff.ba...@jeppesen.com wrote: Unfortunately, the location from PYTHONPATH ends up after the eggs in sys.path so I can't persuade Python to import my version. The only way I've found to fix it is to copy the main script and manually hack sys.path at

Re: Docstrings considered too complicated

2010-03-03 Thread Roy Smith
In article mailman.201.1267632673.23598.python-l...@python.org, D'Arcy J.M. Cain da...@druid.net wrote: On Wed, 03 Mar 2010 14:42:00 + MRAB pyt...@mrabarnett.plus.com wrote: Gregory Ewing wrote: Mk14 from Science of Cambridge, a kit with hex keypad and 7-segment display, which I had

Re: NoSQL Movement?

2010-03-03 Thread km
Hi, this would be a good place to start http://en.wikipedia.org/wiki/NoSQL http://nosql-database.org/ HTH, Krishna On Thu, Mar 4, 2010 at 7:41 AM, Avid Fan m...@privacy.net wrote: Jonathan Gardner wrote: I see it as a sign of maturity with sufficiently scaled software that they no longer

Re: NoSQL Movement?

2010-03-03 Thread Philip Semanchuk
On Mar 3, 2010, at 5:41 PM, Avid Fan wrote: Jonathan Gardner wrote: I see it as a sign of maturity with sufficiently scaled software that they no longer use an SQL database to manage their data. At some point in the project's lifetime, the data is understood well enough that the general

Re: DOS Follies (Was: Docstrings...)

2010-03-03 Thread Edward A. Falk
In article mailman.248.1267652136.23598.python-l...@python.org, D'Arcy J.M. Cain da...@druid.net wrote: On Wed, 03 Mar 2010 20:44:08 +0100 mk mrk...@gmail.com wrote: It reminds me of why Windows uses backslashes for path separation instead of slashes: what I've *heard*, and do not know if it's

Re: NoSQL Movement?

2010-03-03 Thread Jack Diederich
On Wed, Mar 3, 2010 at 12:36 PM, Xah Lee xah...@gmail.com wrote: [snip] Xah Lee is a longstanding usenet troll. Don't feed the trolls. -- http://mail.python.org/mailman/listinfo/python-list

Re: Generic singleton

2010-03-03 Thread Jack Diederich
On Wed, Mar 3, 2010 at 5:18 PM, Jonathan Gardner jgard...@jonathangardner.net wrote: On Wed, Mar 3, 2010 at 1:11 PM, mk mrk...@gmail.com wrote: Or I could make my life simpler and use global variable. :-) Ding ding ding! 90% of Design Patterns is making Java suck less. Other languages

<    1   2   3   >