Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Dwight Hutto
On Sun, Oct 7, 2012 at 2:16 AM, Dwight Hutto wrote: > On Sun, Oct 7, 2012 at 2:03 AM, Dwight Hutto wrote: >> On Sun, Oct 7, 2012 at 1:55 AM, Dwight Hutto wrote: >>> On Sun, Oct 7, 2012 at 1:02 AM, rusi wrote: On Oct 7, 9:15 am, Ramchandra Apte wrote: > On Sunday, 7 October 2012 00:13:

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Dwight Hutto
On Sun, Oct 7, 2012 at 2:03 AM, Dwight Hutto wrote: > On Sun, Oct 7, 2012 at 1:55 AM, Dwight Hutto wrote: >> On Sun, Oct 7, 2012 at 1:02 AM, rusi wrote: >>> On Oct 7, 9:15 am, Ramchandra Apte wrote: On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens wrote: > I am currently sta

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Dwight Hutto
On Sun, Oct 7, 2012 at 1:55 AM, Dwight Hutto wrote: > On Sun, Oct 7, 2012 at 1:02 AM, rusi wrote: >> On Oct 7, 9:15 am, Ramchandra Apte wrote: >>> On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens wrote: >>> > I am currently starting my PhD in software quality assurance and have >>> >

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Dwight Hutto
On Sun, Oct 7, 2012 at 1:02 AM, rusi wrote: > On Oct 7, 9:15 am, Ramchandra Apte wrote: >> On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens wrote: >> > I am currently starting my PhD in software quality assurance and have been >> > doing a lot of reading round this subject. I am just t

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Ramchandra Apte
On Sunday, 7 October 2012 10:32:45 UTC+5:30, rusi wrote: > On Oct 7, 9:15 am, Ramchandra Apte wrote: > > > On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote: > > > > I am currently starting my PhD in software quality assurance and have > > > been doing a lot of reading round thi

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread rusi
On Oct 7, 9:15 am, Ramchandra Apte wrote: > On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens  wrote: > > I am currently starting my PhD in software quality assurance and have been > > doing a lot of reading round this subject. I am just trying to find out if > > there is any relevant/cu

Re: I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Ramchandra Apte
On Sunday, 7 October 2012 00:13:58 UTC+5:30, Darryl Owens wrote: > I am currently starting my PhD in software quality assurance and have been > doing a lot of reading round this subject. I am just trying to find out if > there is any relevant/current research in the production of a generic quali

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Ramchandra Apte
On Sunday, 7 October 2012 01:12:56 UTC+5:30, Terry Reedy wrote: > On 10/6/2012 7:36 AM, Dave Angel wrote: > > > > > The distinction in performance between the success and failure modes of > > > the try/catch isn't nearly as large as one of the other responses might > > > lead you to believe.

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-06 Thread Ian Kelly
On Sat, Oct 6, 2012 at 1:27 AM, wrote: > Using Python on Windows is a dream. > > Python uses and needs the system, but the system does > not use Python. > > Every Python version is installed in its own isolated > space, site-packages included and without any defined > environment variable. Every

Re: Why is pylaucher in Python 3.3 being installed in Windows folder?

2012-10-06 Thread Mark Hammond
On 5/10/2012 2:40 AM, Oscar Benjamin wrote: Having them on PATH means that you can do: > py script.py and the effect will be analogous to (in a unix shell): $ ./script.py Of course the idea with the launcher is that you just do > script.py Unless you want a specific version

Re: [ann] pysha3 0.2.1 released

2012-10-06 Thread Ethan Furman
Christian Heimes wrote: today I've released pysha3 0.2.1 [1]. pysha3 is available for Python 2.6, 2.7, 3.2 and 3.3. It has been tested on Linux (X86, X86_64 with gcc 4.6 and clang), FreeBSD and Windows (X86, X86_64). 32 and 64bit Windows binaries for all supported Python versions are available

Re: Are ABCs an anti-pattern?

2012-10-06 Thread Demian Brecht
On 12-10-05 12:58 PM, Trent Nelson wrote: I like them. In particular, I like that I can enumerate all the subclasses that happen to implement the ABC via the metaclass's __subclasses__() method. As long as you have a common base class (which in your case is a requirement), then __subclasses__ w

Re: fmap(), "inverse" of Python map() function

2012-10-06 Thread vasudevram
> Thanks to all who replied. Always good to learn something new. P.S. A reader posted a good comment with Scala as well as Python code for a compose function (basically same functionality as fmap, or more - the compose once, run many times thing). It's the 4th comment on my blog post. - Vasud

[ann] pysha3 0.2.1 released

2012-10-06 Thread Christian Heimes
Hello, today I've released pysha3 0.2.1 [1]. It's a standalone version of the SHA-3 extension that I merged into CPython's development branch (future 3.4) a couple of hours ago. It provides the Keccak [2] cryptographic hashing algorithm that was officially selected as SHA-3 by NIST a four days ago

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Terry Reedy
On 10/6/2012 7:36 AM, Dave Angel wrote: The distinction in performance between the success and failure modes of the try/catch isn't nearly as large as one of the other responses might lead you to believe. For example, a for loop generally terminates with a raise (of StopIteration exception), an

Re: fmap(), "inverse" of Python map() function

2012-10-06 Thread vasudevram
On Saturday, October 6, 2012 5:01:40 AM UTC+5:30, Devin Jeanpierre wrote: > On Fri, Oct 5, 2012 at 7:24 PM, Ian Kelly wrote: > > > I realize that. My point is that the function *feels* more like a > > > variant of reduce than of map. > > > > > >> If it's meant as a complaint, it's a poor one.

I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool for my PhD.

2012-10-06 Thread Darryl Owens
I am currently starting my PhD in software quality assurance and have been doing a lot of reading round this subject. I am just trying to find out if there is any relevant/current research in the production of a generic quality assurance tool i.e. a tool/methodology that can accept many language

Re: parse an environment file

2012-10-06 Thread Chris Angelico
On Sun, Oct 7, 2012 at 4:14 AM, Jason Friedman wrote: >> The only canned solution for parsing a bash script is bash. Think >> about it the other way around: If you wanted to have a Python variable >> made available to a bash script, the obvious thing to do is to invoke >> Python. It's the same thi

Re: parse an environment file

2012-10-06 Thread Jason Friedman
> The only canned solution for parsing a bash script is bash. Think > about it the other way around: If you wanted to have a Python variable > made available to a bash script, the obvious thing to do is to invoke > Python. It's the same thing. I scratched my own itch: http://code.activestate.com/r

Re: write binary with struct.pack_into

2012-10-06 Thread Alexander Blinne
First, you should consider reading the documentation of struct.unpack_from and struct.pack_into at http://docs.python.org/library/struct.html quite carefully. It says, that these commands take a parameter called offset, which names the location of the data in a buffer (e.g. an opened file). exampl

Re: Combinations of lists

2012-10-06 Thread Joshua Landau
On 4 October 2012 16:12, Steen Lysgaard wrote: > 2012/10/4 Joshua Landau : > > On 3 October 2012 21:15, Steen Lysgaard wrote: > >> > >> Hi, > >> > >> thanks for your interest. Sorry for not being completely clear, yes > >> the length of m will always be half of the length of h. > > > > > > (Plea

Re: write binary with struct.pack_into

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 11:26 PM, Grant Edwards wrote: > On 2012-10-06, Dennis Lee Bieber wrote: >> On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira >> declaimed the following in gmane.comp.python.general: >> >>> >>> #WRITE >>> fb=open('testOUT.bin') >> >> Unless you specify otherwise, ope

Re: write binary with struct.pack_into

2012-10-06 Thread Grant Edwards
On 2012-10-06, Dennis Lee Bieber wrote: > On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira > declaimed the following in gmane.comp.python.general: > >> >> #WRITE >> fb=open('testOUT.bin') > > Unless you specify otherwise, open() defaults to read-only It also defaults to 'text' mode which

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Rodrick Brown
On Oct 5, 2012, at 6:32 PM, Robin Krahl wrote: > Hi all, > > I need to execute untrusted scripts in my Python application. To avoid > security issues, I want to use a sandboxed environment. This means that the > script authors have no access to the file system. They may only access > objects,

Re: Unpaking Tuple

2012-10-06 Thread Roy Smith
In article , Chris Rebert wrote: > But at any rate: > shortfall = 4 - len(your_tuple) > your_tuple += (None,) * shortfall # assuming None is a suitable default > a, b, c, d = your_tuple > > If you also need to handle the "too many items" case, use slicing: > a, b, c, d = your_tuple[:4] I usual

Re: sum function

2012-10-06 Thread Ramchandra Apte
On Saturday, 6 October 2012 02:09:56 UTC+5:30, Dave Angel wrote: > On 10/05/2012 04:09 PM, Mike wrote: > > > Terry, > > > > > > I am not using the mail client. I am just posting on the site. > > > > And which site would that be (that you're using)? There are a few. I'm > > guessing you us

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Dave Angel
On 10/06/2012 02:27 AM, Manuel Pégourié-Gonnard wrote: > Hi, > > I was looking at the example found here [1] which begins with: > > [1] http://docs.python.org/py3k/library/imp.html#examples > > def __import__(name, globals=None, locals=None, fromlist=None): > # Fast path: see if the module has

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Mark Lawrence
On 05/10/2012 23:22, Robin Krahl wrote: Hi all, I need to execute untrusted scripts in my Python application. To avoid security issues, I want to use a sandboxed environment. This means that the script authors have no access to the file system. They may only access objects, modules and classes

Re: Unpaking Tuple

2012-10-06 Thread Chris Rebert
On Sat, Oct 6, 2012 at 3:09 AM, sajuptpm wrote: > Hi, > > I am using python 2.6. > > I need a way to make following code working without any ValueError . a, b, c, d = (1,2,3,4) a, b, c, d = (1,2,3). > > Note: Number of values in the tuple will change dynamically. Then you arguably want

Unpaking Tuple

2012-10-06 Thread sajuptpm
Hi, I am using python 2.6. I need a way to make following code working without any ValueError . >>> a, b, c, d = (1,2,3,4) >>> a, b, c, d = (1,2,3). Note: Number of values in the tuple will change dynamically. I know in python 3, you can do `a, b, c, *d = (1, 2, 3)` and then d will contain an

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Manuel Pégourié-Gonnard
Steven D'Aprano scripsit : > If you expect that most of the time the module will be found, the > try...except version will be faster. If you expect that most of the time > the module will not be found, the "if name in" version will be faster. > Ok. In the particular case of __import__, I guess

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Manuel Pégourié-Gonnard
Günther Dietrich scripsit : > Somewhere I read a text regarding 'try:' versus 'if'. If you take the > probabitility into consideration, how many times the test will fail or > succeed, there are two possibilities: [...] Ok, thanks for the details! -- Manuel Pégourié-Gonnard - http://people.mat

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 7:10 PM, Ramchandra Apte wrote: > On Saturday, 6 October 2012 12:49:29 UTC+5:30, Chris Angelico wrote: >> On Sat, Oct 6, 2012 at 8:22 AM, Robin Krahl wrote: >> > What is the best way to "embed" a script engine in a sandboxed environment >> > that has access to the Python

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Ramchandra Apte
On Saturday, 6 October 2012 12:49:29 UTC+5:30, Chris Angelico wrote: > On Sat, Oct 6, 2012 at 8:22 AM, Robin Krahl wrote: > > > Hi all, > > > > > > I need to execute untrusted scripts in my Python application. To avoid > > security issues, I want to use a sandboxed environment. This means tha

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Ramchandra Apte
On Saturday, 6 October 2012 04:00:08 UTC+5:30, Robin Krahl wrote: > Hi all, > > I need to execute untrusted scripts in my Python application. To avoid > security issues, I want to use a sandboxed environment. This means that the > script authors have no access to the file system. They may only

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Günther Dietrich
Manuel Pégourié-Gonnard wrote: >Hi, >I was looking at the example found here [1] which begins with: > >[1] http://docs.python.org/py3k/library/imp.html#examples > >def __import__(name, globals=None, locals=None, fromlist=None): ># Fast path: see if the module has already been imported. >t

Re: try/except KeyError vs "if name in ..."

2012-10-06 Thread Steven D'Aprano
On Sat, 06 Oct 2012 08:27:25 +0200, Manuel Pégourié-Gonnard wrote: > Hi, > > I was looking at the example found here [1] which begins with: > > [1] http://docs.python.org/py3k/library/imp.html#examples > > def __import__(name, globals=None, locals=None, fromlist=None): > # Fast path: see if

Re: write binary with struct.pack_into

2012-10-06 Thread Peter Otten
palmeira wrote: > Dear pythonists, > > I'm having a problem with read/write binary in python. > I have a binary file that I need to read information, extract a array, > modify this array and put these values into file again in same binary > format. > I need to use unpack_from and pack_into becaus

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-06 Thread wxjmfauth
Using Python on Windows is a dream. Python uses and needs the system, but the system does not use Python. Every Python version is installed in its own isolated space, site-packages included and without any defined environment variable. Every Python can be seen as a different application. Knowing

Re: Executing untrusted scripts in a sandboxed environment

2012-10-06 Thread Chris Angelico
On Sat, Oct 6, 2012 at 8:22 AM, Robin Krahl wrote: > Hi all, > > I need to execute untrusted scripts in my Python application. To avoid > security issues, I want to use a sandboxed environment. This means that the > script authors have no access to the file system. They may only access > object