Re: Generic singleton

2010-03-04 Thread Gregory Ewing
mk wrote: Or I could make my life simpler and use global variable. :-) Indeed. You actually *have* a global variable already, you've just hidden it inside another object. That doesn't make it any less global, though. If you want to defer creation of the object until the first time it's used,

Re: _winreg and accessing registry settings of another user

2010-03-04 Thread News123
Mensanator wrote: > On Mar 4, 3:24 pm, News123 wrote: >> Hi, >> >> I have administrator privilege on a window host and would like to write >> a script setting some registry entries for other users. > > Why? Are you writing a virus? > Writing a virus in python Why not? though I didn't think

Re: NoSQL Movement?

2010-03-04 Thread Gregory Ewing
Duncan Booth wrote: Did I mention that bigtable doesn't require you to have the same columns in every record? The main use of bigtable (outside of Google's internal use) is Google App Engine and that apparently uses one table. Not one table per application, one table total. It's a big table.

Re: NoSQL Movement?

2010-03-04 Thread John Nagle
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 fittin

Re: WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Aahz
In article , Tim Chase wrote: >Jonathan Fine wrote: >> >> We can call a function fn using >> val = fn(*args, **kwargs) >> >> I'm looking for a good name for the pair (args, kwargs). Any suggestions? >> >> For now I'll use argpair, but if anyone has a better idea, I'll use it. > >In the le

Re: Draft PEP on RSON configuration file format

2010-03-04 Thread Steve Howell
On Mar 4, 9:36 pm, Gregory Ewing wrote: > Paul Rubin wrote: > > ReST was another solution in search of a problem. > > I think the basic idea behind ReST is quite good, i.e. > understanding as markup various typographical conventions > that make sense in plain text, such as underlined > headings, b

IMAP mail filters tool

2010-03-04 Thread Ken Seehart
I'm thinking of possibly making a simple client-agnostic tool for filtering and processing IMAP email. I'm a Thunderbird user, but I'm interested in a tool that is not client software specific. So I am is checking for prior art. Does anyone know of a filter tool with most of these features?

Re: Draft PEP on RSON configuration file format

2010-03-04 Thread Gregory Ewing
Paul Rubin wrote: ReST was another solution in search of a problem. I think the basic idea behind ReST is quite good, i.e. understanding as markup various typographical conventions that make sense in plain text, such as underlined headings, bullets, numbered paragraphs. Unfortunately it went o

Re: Draft PEP on RSON configuration file format

2010-03-04 Thread Steve Howell
On Mar 4, 12:52 am, Paul Rubin wrote: > mk writes: > > OK, but how? How would you make up e.g. for JSON's lack of comments? > > Modify the JSON standard so that "JSON 2.0" allows comments. If you don't control the JSON standard, providing a compelling alternative to JSON might be the best way to

Re: A "scopeguard" for Python

2010-03-04 Thread Steve Howell
On Mar 3, 7:10 am, "Alf P. Steinbach" wrote: > For C++ Petru Marginean once invented the "scope guard" technique (elaborated > on > by Andrei Alexandrescu, they published an article about it in DDJ) where all > you > need to do to ensure some desired cleanup at the end of a scope, even when the

Re: Generic singleton

2010-03-04 Thread Steve Howell
On Mar 4, 7:32 pm, Steven D'Aprano wrote: > > Python does have it's own singletons, like None, True and False. For some > reason, they behave quite differently: NoneType fails if you try to > instantiate it again, while bool returns the appropriate existing > singleton: > > >>> NoneType = type(Non

Re: Failure in test_hashlib.py and test_hmac.py

2010-03-04 Thread Chris Lieb
On Mar 3, 8:33 pm, Chris Lieb wrote: > 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

Re: Problem with modules reloading

2010-03-04 Thread Steven D'Aprano
On Thu, 04 Mar 2010 18:10:59 -0800, DSblizzard wrote: > I have had already following question: "How to use *.py modules instead > of *.pyc?" > > Last time I when asked that question I resolved problem by using one big > .py file. I think you are confused. .pyc files are Python compiled byte-co

Re: python 2.6: how to modify a PIL image from C without copying forth and back

2010-03-04 Thread Tim Roberts
News123 wrote: > >Yes, this might be an option >Somehow though it didn't feel right for me to depend on internal non >documented data types, which might change between releases of PIL. That's absolutely true. If performance is a priority, somethimes you have to do things that are "dirty". Just

Re: Generic singleton

2010-03-04 Thread Steven D'Aprano
On Thu, 04 Mar 2010 12:21:26 +, Duncan Booth wrote: > Steven D'Aprano wrote: > >> 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: >> >> Gro

[no subject]

2010-03-04 Thread Adhitya Jiwa Pratama
-- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with modules reloading

2010-03-04 Thread Rami Chowdhury
On Mar 4, 2010, at 18:10 , DSblizzard wrote: > I have had already following question: > "How to use *.py modules instead of *.pyc?" > > Last time I when asked that question I resolved problem by using one > big .py file. And answers doesn't work in my case. Now I ought to use > several files and

baufinanzierung berechnung , eigentumswohnungen finanzieren , eigenheimzulage verdienstgrenze , eigenheimzulage unentgeltliche , bauspardarlehen in anspruch nehmen , immobilienfinanzierung von , ei

2010-03-04 Thread lucky-villa
baufinanzierung berechnung , eigentumswohnungen finanzieren , eigenheimzulage verdienstgrenze , eigenheimzulage unentgeltliche , bauspardarlehen in anspruch nehmen , immobilienfinanzierung von , eigenheimzulage ab 2009 , + + +++ GUENSTIGE KREDITE ONLINE +++ KREDITE IM INTERNET OHNE SCHUFA IMMOBILI

Re: Docstrings considered too complicated

2010-03-04 Thread Steven D'Aprano
On Thu, 04 Mar 2010 23:38:31 +1300, Gregory Ewing wrote: > Steven D'Aprano wrote: > >> True, but one can look at "best practice", or even "standard practice". >> For Python coders, using docstrings is standard practice if not best >> practice. Using strings as comments is not. > > In that partic

Re: NoSQL Movement?

2010-03-04 Thread Tim X
ccc31807 writes: > On Mar 3, 4:55 pm, toby wrote: >> >  where you have to store data and >> >> "relational data" > > Data is neither relational nor unrelational. Data is data. > Relationships are an artifact, something we impose on the data. > Relations are for human convenience, not something i

Re: Looking for the mysterious zlib.py* files in Python 2.6.4 (32-bit) for Windows

2010-03-04 Thread python
> IIRC a pyd file is really a DLL, but for a built-in its included into in this > case python26.dll. Mystery solved! Thanks Mark! Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Problem with modules reloading

2010-03-04 Thread DSblizzard
I have had already following question: "How to use *.py modules instead of *.pyc?" Last time I when asked that question I resolved problem by using one big .py file. And answers doesn't work in my case. Now I ought to use several files and almost the same problem arises again. Admit I have 2 modul

Re: Looking for the mysterious zlib.py* files in Python 2.6.4 (32-bit) for Windows

2010-03-04 Thread Mark Lawrence
pyt...@bdurham.com wrote: In the process of building an EXE with py2exe, I noticed that there's no physical zlib files anywhere on my workstation. I can import zlib and use this module's features without problem. But when I query zlib.__file__, I get back an empty string. Where does the zlib co

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Robert Kern: [...] No, it only argues that "with Cleanup():" is supernumerary. I don't know what "supernumerary" means, but to the degree that the argument says anything about a construct that is not 'finally', it says the same about general "with".

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 15:19 PM, Mike Kent wrote: On Mar 3, 12:00 pm, Robert Kern wrote: On 2010-03-03 09:39 AM, Mike Kent wrote: What's the compelling use case for this vs. a simple try/finally? original_dir = os.getcwd() try: os.chdir(somewhere) # Do other stuff f

Re: A "scopeguard" for Python

2010-03-04 Thread Steve Holden
Alf P. Steinbach wrote: > * Robert Kern: [...] >> No, it only argues that "with Cleanup():" is supernumerary. > > I don't know what "supernumerary" means, but to the degree that the > argument says anything about a construct that is not 'finally', it says > the same about general "with". > So rat

Re: pyao makes the right sound but why?

2010-03-04 Thread '2+
o .. but u can use ur own tits.wav if it is 44100 mono 16bit and picklin n uploading the tofu n having lots of those on the net 2 increase vegetrians is what soy.py wanted to mean On Fri, Mar 5, 2010 at 9:48 AM, '2+ wrote: > omg! u r actually testin my dirty code?! > tnx that's great! > to create

Re: Python Opportunity at OPNET

2010-03-04 Thread Steven Howe
On 03/04/2010 04:45 PM, Harold Meder wrote: I stumbled across this Job Posting at OPNET. I hope that it is acceptable to post this type of info on this mailing list. I do not know any further information regarding this opportun

Re: pyao makes the right sound but why?

2010-03-04 Thread '2+
omg! u r actually testin my dirty code?! tnx that's great! to create an instance soy.py depends on(needs all of em): http://sarigama.namaste.jp/oil/tit01.wav http://sarigama.namaste.jp/oil/tit02.wav http://sarigama.namaste.jp/oil/tit03.wav http://sarigama.namaste.jp/oil/tit04.wav http://sarigama.n

Python Opportunity at OPNET

2010-03-04 Thread Harold Meder
I stumbled across this Job Postingat OPNET. I hope that it is acceptable to post this type of info on this mailing list. I do not know any further information regarding this opportunity. Harold Meder. -- http://mail.python.org/m

Re: Fast GUI pipemeter: gprog

2010-03-04 Thread Dan Stromberg
On Mar 4, 1:15 pm, pk wrote: > Dan Stromberg wrote: > > In case you're interested, I've put a fast GUI pipemeter (measures how > > fast data is moving through a pipe or redirect and gives two estimates > > of time-to-completion - one based on the entire transfer so far, and > > one based on a user

Re: using subprocess.Popen env parameter

2010-03-04 Thread Nobody
On Wed, 03 Mar 2010 09:05:47 -0800, enda man wrote: > cl_path = ms_vc_path + '\VC\bin' The backslash is used as an escape character within string literals. Either use raw strings: cl_path = ms_vc_path + r'\VC\bin' or escape the backslashes: cl_path = ms_vc_path + '\\VC\\bin' o

Re: Challenge: escape from the pysandbox

2010-03-04 Thread Nobody
On Wed, 03 Mar 2010 03:37:44 +0100, Victor Stinner wrote: >> I see, makes perfect sense. This then raises the question whether it's >> important to have a 100% fool proof python sandbox without help from >> the OS, or this goal is not only too ambitious but also not really a >> useful one. > > T

Re: Evaluate my first python script, please

2010-03-04 Thread Pete Emerson
Great responses, thank you all very much. I read Jonathan Gardner's solution first and investigated sets. It's clearly superior to my first cut. I love the comment about regular expressions. In perl, I've reached for regexes WAY too much. That's a big lesson learned too, and from my point of view

highlight words by regex in pdf files using python

2010-03-04 Thread Peng Yu
I don't find a general pdf library in python that can do any operations on pdfs. I want to automatically highlight certain words (using regex) in a pdf. Could somebody let me know if there is a tool to do so in python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Google AI Challenge at U of Waterloo

2010-03-04 Thread Forthminder
Google AI Challenge post-mortem report by the winner is at http://a1k0n.net/blah/archives/2010/03/index.html#e2010-03-04T14_00_21.txt Mentifex -- http://cyborg.blogspot.com http://code.google.com/p/mindforth/wiki/AiHasBeenSolved -- http://mail.python.org/mailman/listinfo/python-list

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-04 12:37 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-04 10:56 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: [snippety] If you call the possibly failing operation "A", then that systematic approach goes like t

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 12:37 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-04 10:56 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: [snippety] If you call the possibly failing operation "A", then that systematic approach goes like this: if A fails,

Looking for the mysterious zlib.py* files in Python 2.6.4 (32-bit) for Windows

2010-03-04 Thread python
In the process of building an EXE with py2exe, I noticed that there's no physical zlib files anywhere on my workstation. I can import zlib and use this module's features without problem. But when I query zlib.__file__, I get back an empty string. Where does the zlib code live? Is zlib a in 2.6?

Re: Evaluate my first python script, please

2010-03-04 Thread sjdevn...@yahoo.com
On Mar 4, 1:39 pm, Pete Emerson wrote: > I've written my first python program, and would love suggestions for > improvement. > > I'm a perl programmer and used a perl version of this program to guide > me. So in that sense, the python is "perlesque" > > This script parses /etc/hosts for hostnames,

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Mike Kent: On Mar 4, 12:30 pm, Robert Kern wrote: He's ignorant of the use cases of the with: statement, true. Ouch! Ignorant of the use cases of the with statement, am I? Odd, I use it all the time. Given only your example of the with: statement, it is hard to fault him for thinking

Pydev 1.5.5 Released

2010-03-04 Thread Fabio Zadrozny
Hi All, Pydev 1.5.5 has been released Details on Pydev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- * Predefined completions available for code completion: * Predefined completions may be created for use when so

Re: _winreg and access registry settings of another user

2010-03-04 Thread Mensanator
On Mar 4, 3:24 pm, News123 wrote: > Hi, > > I habe administrator privilege  on a window host and would like to write > a script setting some registry entries for other users. Why? Are you writing a virus? > > There are potentially at least two wo ways of doing this: > > 1.) start a subprocess as

Re: Evaluate my first python script, please

2010-03-04 Thread Jonathan Gardner
On Thu, Mar 4, 2010 at 10:39 AM, Pete Emerson wrote: > > #!/usr/bin/python > More common: #!/usr/bin/env python > import sys, fileinput, re, os > > filename = '/etc/hosts' > > hosts = [] > > for line in open(filename, 'r'): >        match = re.search('\d+\.\d+\.\d+\.\d+\s+(\S+)', line) >      

Re: Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Jussi Piitulainen
This is the full data file on which my regress/Tribug exhibits the behaviour that I find incomprehensible, described in the first post in this thread. The comment in the beginning of the file below was written before I commented out some records in the data, so the actual numbers now are not ten ex

Re: python SUDS library

2010-03-04 Thread Diez B. Roggisch
Am 04.03.10 06:23, schrieb yamamoto: Hi, I tried to make a simple script with SUD library for caching torrent files. it doenst work! [versions] suds: 0.4, python: 2.6.4 [code] from suds.client import Client import base64 path = 'sample.torrent' doc = open(path, 'rb').read() encoded_doc = base6

Re: Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Jussi Piitulainen
Stefan Behnel writes: > Jussi Piitulainen, 04.03.2010 11:46: > > I am observing weird semi-erratic behaviour that involves Python 3 > > and lxml, is extremely sensitive to changes in the input data, and > > only occurs when I name a partial result. I would like some help > > with this, please. (Pyt

_winreg and access registry settings of another user

2010-03-04 Thread News123
Hi, I habe administrator privilege on a window host and would like to write a script setting some registry entries for other users. There are potentially at least two wo ways of doing this: 1.) start a subprocess as other user and change the regitrey for CURRENT_USER However I don't know ho

Re: A "scopeguard" for Python

2010-03-04 Thread Mike Kent
On Mar 3, 12:00 pm, Robert Kern wrote: > On 2010-03-03 09:39 AM, Mike Kent wrote: > > > What's the compelling use case for this vs. a simple try/finally? > > >     original_dir = os.getcwd() > >     try: > >         os.chdir(somewhere) > >         # Do other stuff > >     finally: > >         os.c

Re: Method / Functions - What are the differences?

2010-03-04 Thread John Posner
On 3/3/2010 6:56 PM, John Posner wrote: ... I was thinking today about "doing a Bruno", and producing similar pieces on: * properties created with the @property decorator * the descriptor protocol I'll try to produce something over the next couple of days. Starting to think about a writeup

Re: A "scopeguard" for Python

2010-03-04 Thread Mike Kent
On Mar 4, 12:30 pm, Robert Kern wrote: > He's ignorant of the use cases of the with: statement, true. Ouch! Ignorant of the use cases of the with statement, am I? Odd, I use it all the time. > Given only your > example of the with: statement, it is hard to fault him for thinking that try: >

Re: loop over list and process into groups

2010-03-04 Thread Chris Colbert
Man, deja-vu, I could have sworn I read this thread months ago... On Thu, Mar 4, 2010 at 2:18 PM, nn wrote: > > > lbolla wrote: > > On Mar 4, 3:57 pm, Sneaky Wombat wrote: > > > [ {'vlan_or_intf': 'VLAN2021'}, > > > {'vlan_or_intf': 'Interface'}, > > > {'vlan_or_intf': 'Po1'}, > > > {'vlan_o

Re: Pylint Argument number differs from overridden method

2010-03-04 Thread Wanderer
On Mar 4, 5:45 am, Jean-Michel Pichavant wrote: > Wanderer wrote: > > On Mar 3, 2:33 pm, Robert Kern 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

Re: A "scopeguard" for Python

2010-03-04 Thread Mike Kent
On Mar 3, 10: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 incorrect for cleanup > > by the way, that's one advantag

ANNOUNCE: Exscript 2.0

2010-03-04 Thread knipknap
Introduction - Exscript is a Python module and template processor for automating Telnet or SSH sessions. Exscript supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Please refer to the project page for upd

Re: Evaluate my first python script, please

2010-03-04 Thread nn
On Mar 4, 2:30 pm, MRAB wrote: > Pete Emerson wrote: > > I've written my first python program, and would love suggestions for > > improvement. > > > I'm a perl programmer and used a perl version of this program to guide > > me. So in that sense, the python is "perlesque" > > > This script parses /

Re: Evaluate my first python script, please

2010-03-04 Thread MRAB
Pete Emerson wrote: I've written my first python program, and would love suggestions for improvement. I'm a perl programmer and used a perl version of this program to guide me. So in that sense, the python is "perlesque" This script parses /etc/hosts for hostnames, and based on terms given on t

Re: Generic singleton

2010-03-04 Thread David Bolen
Duncan Booth writes: > It is also *everywhere* in the Python world. Unlike Java and C++, Python > even has its own built-in type for singletons. > > If you want a singleton in Python use a module. > > So the OP's original examples become: > > --- file singleton.py --- > foo = {} > bar = [] > > -

Re: loop over list and process into groups

2010-03-04 Thread nn
lbolla wrote: > On Mar 4, 3:57 pm, Sneaky Wombat wrote: > > [ {'vlan_or_intf': 'VLAN2021'}, > >  {'vlan_or_intf': 'Interface'}, > >  {'vlan_or_intf': 'Po1'}, > >  {'vlan_or_intf': 'Po306'}, > >  {'vlan_or_intf': 'VLAN2022'}, > >  {'vlan_or_intf': 'Interface'}, > >  {'vlan_or_intf': 'Gi7/33'}, >

Re: NoSQL Movement?

2010-03-04 Thread Duncan Booth
mk wrote: > Duncan Booth wrote: > >> If you look at some of the uses of bigtable you may begin to >> understand the tradeoffs that are made with sql. When you use >> bigtable you have records with fields, and you have indices, but >> there are limitations on the kinds of queries you can perform:

Re: Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Stefan Behnel
Jussi Piitulainen, 04.03.2010 11:46: I am observing weird semi-erratic behaviour that involves Python 3 and lxml, is extremely sensitive to changes in the input data, and only occurs when I name a partial result. I would like some help with this, please. (Python 3.1.1; GNU/Linux; how do I find lx

Re: pyao makes the right sound but why?

2010-03-04 Thread Anssi Saari
"'2+" writes: > dev = ao.AudioDevice('alsa') > dev.play(x) > > could launch me a semi realtime dj kinda sys > luckily .. it does seem to be making the right sound > but why? > the default of the samplerate and that 16bit happened to match with my thing > x? Yes, that seems to be the case from h

Evaluate my first python script, please

2010-03-04 Thread Pete Emerson
I've written my first python program, and would love suggestions for improvement. I'm a perl programmer and used a perl version of this program to guide me. So in that sense, the python is "perlesque" This script parses /etc/hosts for hostnames, and based on terms given on the command line (argv)

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-04 10:56 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: [snippety] If you call the possibly failing operation "A", then that systematic approach goes like this: if A fails, then it has cleaned up its own mess, but if A su

Re: A "scopeguard" for Python

2010-03-04 Thread Jean-Michel Pichavant
Michael Rudolf wrote: Am 04.03.2010 17:32, schrieb Jean-Michel Pichavant: It looks like to me that 'with' statements are like decorators: overrated. Oh no, you just insulted my favourite two python features, followed immediately by generators, iterators and list comprehensions / generator ex

Re: WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Steve Holden
Jonathan Fine wrote: > Hi > > We can call a function fn using > val = fn(*args, **kwargs) > > I'm looking for a good name for the pair (args, kwargs). Any suggestions? > > Here's my use case: > def doit(fn , wibble, expect): > args, kwargs = wibble > actual = fn(*args, *

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread John Bokma
Ben Finney writes: > Terry Reedy 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. [..] >> > CPAN enforces standard organization on

Re: memory usage, temporary and otherwise

2010-03-04 Thread Steve Holden
Duncan Booth wrote: > mk wrote: > >> Hm, apparently Python didn't spot that 'spam'*10 in a's values is really >> the same string, right? > > If you want it to spot that then give it a hint that it should be looking > for identical strings: > > >>> a={} > >>> for i in range(1000): > ...

Re: A "scopeguard" for Python

2010-03-04 Thread Michael Rudolf
Am 04.03.2010 18:20, schrieb Robert Kern: What I'm trying to explain is that the with: statement has a use even if Cleanup doesn't. Arguing that Cleanup doesn't improve on try: finally: does not mean that the with: statement doesn't improve on try: finally:. Yes, the with-statement rocks :) I

Re: A "scopeguard" for Python

2010-03-04 Thread Michael Rudolf
Am 04.03.2010 17:32, schrieb Jean-Michel Pichavant: It looks like to me that 'with' statements are like decorators: overrated. Oh no, you just insulted my favourite two python features, followed immediately by generators, iterators and list comprehensions / generator expressions :p No, real

Re: memory usage, temporary and otherwise

2010-03-04 Thread Terry Reedy
On 3/4/2010 6:56 AM, mk wrote: Bruno Desthuilliers wrote: Huh? I was under impression that some time after 2.0 range was made to work "under the covers" like xrange when used in a loop? Or is it 3.0 that does that? 3.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: loop over list and process into groups

2010-03-04 Thread lbolla
On Mar 4, 3:57 pm, Sneaky Wombat wrote: > [ {'vlan_or_intf': 'VLAN2021'}, >  {'vlan_or_intf': 'Interface'}, >  {'vlan_or_intf': 'Po1'}, >  {'vlan_or_intf': 'Po306'}, >  {'vlan_or_intf': 'VLAN2022'}, >  {'vlan_or_intf': 'Interface'}, >  {'vlan_or_intf': 'Gi7/33'}, >  {'vlan_or_intf': 'Po1'}, >  {'v

ANN: psutil 0.1.3 released

2010-03-04 Thread Giampaolo Rodola'
Hi, I'm pleased to announce the 0.1.3 release of psutil: http://code.google.com/p/psutil === About === psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by using Python, implementing many functionalitie

Re: NoSQL Movement?

2010-03-04 Thread ccc31807
On Mar 4, 11:51 am, Juan Pedro Bolivar Puente wrote: > No, relations are data. This depends on your definition of 'data.' I would say that relationships is information gleaned from the data. > "Data is data" says nothing. Data is > information. To me, data and information are not the same thing

Re: NoSQL Movement?

2010-03-04 Thread George Neuner
On Thu, 04 Mar 2010 18:51:21 +0200, Juan Pedro Bolivar Puente wrote: >On 04/03/10 16:21, ccc31807 wrote: >> On Mar 3, 4:55 pm, toby wrote: where you have to store data and >>> >>> "relational data" >> >> Data is neither relational nor unrelational. Data is data. >> Relationships are an ar

Re: loop over list and process into groups

2010-03-04 Thread Sneaky Wombat
On Mar 4, 10:55 am, mk wrote: > Sneaky Wombat wrote: > > I was going to write a def to loop through and look for certain pre- > > compiled regexs, and then put them in a new dictionary and append to a > > list, > > regexes are overkill in this case I think. > > > [ 'VLAN4065', > >  'Interface', >

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 11:02 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-04 09:48 AM, Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used "to ensure some desired cleanup at the end of a scope, even when the scope is exite

Re: memory usage, temporary and otherwise

2010-03-04 Thread lbolla
On Mar 4, 12:24 pm, Duncan Booth wrote: > >  >>> a={} >  >>> for i in range(1000): > ...     a[i]=intern('spam'*10) > "intern": another name borrowed from Lisp? -- http://mail.python.org/mailman/listinfo/python-list

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 10:56 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: * Robert Kern: [snip] can you understand why we might think that you were saying that try: finally: was wrong and that you were proposing that your code was equivalent to some try: e

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-04 09:48 AM, Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used "to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception." This is precisely what the t

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 10:32 AM, Jean-Michel Pichavant wrote: Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used "to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception." This is precis

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: * Robert Kern: [snip] can you understand why we might think that you were saying that try: finally: was wrong and that you were proposing that your code was equivalent to some try: except: else: suite? No, not really. His code d

Re: loop over list and process into groups

2010-03-04 Thread mk
Sneaky Wombat wrote: I was going to write a def to loop through and look for certain pre- compiled regexs, and then put them in a new dictionary and append to a list, regexes are overkill in this case I think. [ 'VLAN4065', 'Interface', 'Gi9/6', 'Po2', 'Po3', 'Po306', 'VLAN4068', 'Int

Re: NoSQL Movement?

2010-03-04 Thread Juan Pedro Bolivar Puente
On 04/03/10 16:21, ccc31807 wrote: > On Mar 3, 4:55 pm, toby wrote: >>> where you have to store data and >> >> "relational data" > > Data is neither relational nor unrelational. Data is data. > Relationships are an artifact, something we impose on the data. > Relations are for human convenience,

Re: My four-yorkshireprogrammers contribution

2010-03-04 Thread python
Not to out do you guys, but over here in the states, I started out with a Radio Shack 'computer' that consisted of 10 slideable switches and 10 flashlight bulbs. You ran wires betweens the slideable switches to create 'programs'. Wish I could remember what this thing was called - my google-fu fails

Re: How to login https sever with inputing account name and password?

2010-03-04 Thread Steve Holden
Karen Wang wrote: > Hi all, > > I want to use python to access to https server, like > “https://212.218.229.10/chinatest/” > > If open it from IE, will see the pop-up login windows like this > > I tried several ways but always only get page for” HTTP Error 401.2 – > Unauthorized” error. ( myuser

Re: A "scopeguard" for Python

2010-03-04 Thread Jean-Michel Pichavant
Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used "to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception." This is precisely what the try: finally: syntax is for. You'd

Re: My four-yorkshireprogrammers contribution

2010-03-04 Thread MRAB
Gregory Ewing wrote: MRAB 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 chip, so that's 256B (including the memory used by the monitor) + 256B additional RAM

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 09:48 AM, Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used "to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception." This is precisely what the try: finally: syn

loop over list and process into groups

2010-03-04 Thread Sneaky Wombat
[ {'vlan_or_intf': 'VLAN2021'}, {'vlan_or_intf': 'Interface'}, {'vlan_or_intf': 'Po1'}, {'vlan_or_intf': 'Po306'}, {'vlan_or_intf': 'VLAN2022'}, {'vlan_or_intf': 'Interface'}, {'vlan_or_intf': 'Gi7/33'}, {'vlan_or_intf': 'Po1'}, {'vlan_or_intf': 'Po306'}, {'vlan_or_intf': 'VLAN2051'}, {'v

Re: A "scopeguard" for Python

2010-03-04 Thread Alf P. Steinbach
* Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used "to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception." This is precisely what the try: finally: syntax is for. You'd have to nest it. That's u

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread John Gabriele
On Mar 3, 5:30 pm, Ben Finney wrote: > > Terry Reedy writes: > > > On 3/3/2010 12:05 PM, John Nagle wrote: > > > > CPAN enforces standard organization on packages. PyPi does not. > > This is, I think, something we don't need as much in Python; there is a > fundamental difference between Perl's de

Re: A "scopeguard" for Python

2010-03-04 Thread Robert Kern
On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: * 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. Steinba

Re: taking python enterprise level?...

2010-03-04 Thread Tim Wintle
On Wed, 2010-03-03 at 16:23 -0500, D'Arcy J.M. Cain wrote: > On Wed, 03 Mar 2010 20:39:35 +0100 > mk 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 denormaliza

Re: taking python enterprise level?...

2010-03-04 Thread Tim Wintle
On Wed, 2010-03-03 at 20:39 +0100, mk wrote: > Hello Tim, > > Pardon the questions but I haven't had the need to use denormalization > yet, so: > IOW you basically merged the tables like follows? > > CREATE TABLE projects ( > client_id BIGINT NOT NULL, > project_id BIGINT NOT NULL, >

Re: NoSQL Movement?

2010-03-04 Thread mk
Duncan Booth wrote: If you look at some of the uses of bigtable you may begin to understand the tradeoffs that are made with sql. When you use bigtable you have records with fields, and you have indices, but there are limitations on the kinds of queries you can perform: in particular you canno

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread John Gabriele
On Mar 3, 9:11 pm, John Bokma wrote: > Philip Semanchuk writes: > > > In other words, if I was a Perl user under Ubuntu would I use > > the pkg manager to add a Perl module, or CPAN, or would both work? > > Both would work, but I would make very sure to use a separate > installation directory for

Re: NoSQL Movement?

2010-03-04 Thread ccc31807
On Mar 3, 4:55 pm, toby wrote: > >  where you have to store data and > > "relational data" Data is neither relational nor unrelational. Data is data. Relationships are an artifact, something we impose on the data. Relations are for human convenience, not something inherent in the data itself. >

Re: WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Paul Rubin
Jonathan Fine writes: > I'm looking for a good name for the pair (args, kwargs). Any suggestions? > > Here's my use case: > def doit(fn , wibble, expect): > args, kwargs = wibble > actual = fn(*args, **kwargs) I think this may have been broken in 3.x, but in 2.6 the compiler

SQLObject 0.11.4

2010-03-04 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.11.4, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

  1   2   >