ANN: mock 0.8 final released

2012-02-16 Thread Fuzzyman
After more than six months development work mock 0.8 has been released. 0.8 is a big release with many new features, general improvements and bugfixes. You can download mock 0.8.0 final from the PyPI page or install it with: pip install -U mock mock is a library for testing in Python. It all

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 10, 5:27 pm, Eric Snow wrote: > On Wed, Aug 10, 2011 at 8:33 AM, Fuzzyman wrote: > > On Aug 5, 12:29 pm, Ryan wrote: > >> In the context of descriptors, the __set__ method is not called for > >> class attribute access. __set__ is only > >> called

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Fuzzyman
On Aug 10, 4:25 pm, Ian Kelly wrote: > On Wed, Aug 10, 2011 at 8:48 AM, Fuzzyman wrote: > > __name__ can be a descriptor, so you just need to write a descriptor > > that can be fetched from classes as well as instances. > > > Here's an example with a property (insta

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Fuzzyman
On Aug 7, 4:06 am, Eric Snow wrote: > Thought I knew how to provide a dynamic __name__ on instances of a > class.  My first try was to use a non-data descriptor: > > # module base.py > > class _NameProxy(object): >     def __init__(self, oldname): >         self.oldname = oldname >     def __get__

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 1:16 pm, Duncan Booth wrote: > Ryan wrote: > > In the context of descriptors, the __set__ method is not called for > > class attribute access. __set__ is only > > called to set the attribute on an instance instance of the owner class > > to a new value, value. WHY? Is there some other m

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 12:29 pm, Ryan wrote: > In the context of descriptors, the __set__ method is not called for > class attribute access. __set__ is only > called to set the attribute on an instance instance of the owner class > to a new value, value. WHY? It's an unfortunate asymmetry in the descriptor pr

Re: Interrput a thread

2011-01-04 Thread Fuzzyman
On Jan 4, 3:31 pm, Roy Smith wrote: > In article > <2ebc11a5-1b45-4faa-97b9-c84f0db01...@k22g2000yqh.googlegroups.com>, > >  Fuzzyman wrote: > > It is unsafe to terminate an os level thread at an arbitrary point > > because it may be executing code in a criti

Re: Interrput a thread

2011-01-04 Thread Fuzzyman
On Jan 4, 3:12 pm, Fuzzyman wrote: > On Dec 29 2010, 11:31 pm, gervaz wrote: > > > Hi all, I need to stop a threaded (using CTR+C or kill) application if > > it runs too much or if I decide to resume the work later. > > I come up with the following test implemen

Re: Interrput a thread

2011-01-04 Thread Fuzzyman
On Dec 29 2010, 11:31 pm, gervaz wrote: > Hi all, I need to stop a threaded (using CTR+C or kill) application if > it runs too much or if I decide to resume the work later. > I come up with the following test implementation but I wanted some > suggestion from you on how I can implement what I need

Re: what a cheap rule

2010-11-26 Thread Fuzzyman
On Nov 26, 1:10 am, Steven D'Aprano wrote: > On Thu, 25 Nov 2010 08:15:21 -0800, Yingjie Lan wrote: > > Intuition #1: as if you raise an exception type, and then match that > > type. > > It seems that no instances > > are involved here (Intuitively). > > Your intuition is not my intuition, nor doe

Re: Spreadsheet-style dependency tracking

2010-10-18 Thread Fuzzyman
On Oct 17, 12:35 pm, Florian Weimer wrote: > * Chris Torek: > > > In article <87y69xbz6h@mid.deneb.enyo.de> > > Florian Weimer   wrote: > >>Are there libraries which implement some form of spreadsheet-style > >>dependency tracking?  The idea is to enable incremental updates to > >>some fairly

Re: namespace hacking question

2010-10-01 Thread Fuzzyman
On Sep 30, 6:07 pm, kj wrote: > This is a recurrent situation: I want to initialize a whole bunch > of local variables in a uniform way, but after initialization, I > need to do different things with the various variables. > > What I end up doing is using a dict: > > d = dict() > for v in ('spam',

Re: grailbrowser now running under python 2.5 (probably above too)

2010-07-12 Thread Fuzzyman
On Jul 12, 1:21 am, rantingrick wrote: > On Jul 11, 5:28 pm,Fuzzyman wrote: > > > But why hijack someone else's announcement to do that? Congratulations > > alone would have been great. However good your intentions your message > > came across as "but it would

Re: grailbrowser now running under python 2.5 (probably above too)

2010-07-11 Thread Fuzzyman
On Jul 11, 5:16 pm, rantingrick wrote: > On Jul 11, 9:01 am, a...@pythoncraft.com (Aahz) wrote: > > > As usual, you would rather tell other people what to do instead of doing > > any work yourself. > > Dear God! My statement was intended to fetch responses like... > >   "Hey, that sounds like a gr

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-07 Thread Fuzzyman
On Jul 5, 1:34 am, sturlamolden wrote: > On 5 Jul, 01:58, John Nagle wrote: > > >      Exactly. > > >      The "incompatible with all extension modules I need" part > > is the problem right now.  A good first step would be to > > identify the top 5 or 10 modules that are blocking a move to > > Py

Re: Overriding "__setattr__" of a module - possible?

2010-06-19 Thread Fuzzyman
On Jun 18, 5:25 am, "Gabriel Genellina" wrote: > En Thu, 17 Jun 2010 07:12:23 -0300, Fuzzyman escribi�: > > > On Jun 17, 10:29 am, "Gabriel Genellina" > > wrote: > >> En Thu, 17 Jun 2010 04:52:48 -0300, Alf P. Steinbach   > >> escribiï

Re: Overriding "__setattr__" of a module - possible?

2010-06-17 Thread Fuzzyman
On Jun 17, 10:29 am, "Gabriel Genellina" wrote: > En Thu, 17 Jun 2010 04:52:48 -0300, Alf P. Steinbach   > escribió: > > > But who would have thunk that Python *isn't dynamic enough*? :-) > > Yep... There are other examples too (e.g. the print statement in 2.x   > bypasses sys.stdout.write; Wha

Re: Python is cool!!

2010-05-09 Thread Fuzzyman
On Mar 23, 10:04 pm, geremy condra wrote: > On Tue, Mar 23, 2010 at 1:07 PM, Tim Golden wrote: > > On 23/03/2010 16:55, Jose Manuel wrote: > > >> I have been learning Python, and it is amazing I am using the > >> tutorial that comes with the official distribution. > > >> At the end my goal i

Re: Dreaming of new generation IDE

2010-02-10 Thread Fuzzyman
On Feb 3, 7:38 pm, Phlip wrote: > On Feb 3, 10:57 am, Adam Tauno Williams > wrote: > > > > Current editors suck because they can't see into the code and browse > > > it - unless it's so statically typed it's painful. > > > ?  I edit Python in MonoDevelop  2.2;  and I can browse my file, > > class

ANN: mock 0.6.0, Python mocking and testing library

2009-08-22 Thread Fuzzyman
mock is a Python mock object library for testing, with additional support for runtime monkey patching. Most mocking libraries follow the ‘record -> replay’ pattern of mocking. I prefer the ‘action -> assertion’ pattern, which is more readable and intuitive; particularly when working with the Pytho

ANN: discover 0.3.0 released, automatic test discovery for unittest

2009-08-20 Thread Fuzzyman
The discover module is a backport of the automatic test discovery from the unittest module in Python-trunk (what will become Python 2.7 and 3.2). The discover module should work on versions of Python 2.4 upwards: * discover module on PyPI: http://pypi.python.org/pypi/discover The discover module

Re: Is python buffer overflow proof?

2009-08-07 Thread Fuzzyman
On Aug 4, 6:06 am, John Nagle wrote: > Gabriel Genellina wrote: > > En Mon, 03 Aug 2009 18:04:53 -0300, sturlamolden > > escribió: > > >> On 2 Aug, 15:50, Jizzai wrote: > > >>> Is a _pure_ python program buffer overflow proof? > > >>> For example in C++ you can declare a char[9] to hold user inp

Re: Is python buffer overflow proof?

2009-08-07 Thread Fuzzyman
On Aug 3, 10:04 pm, sturlamolden wrote: > On 2 Aug, 15:50, Jizzai wrote: > > > Is a _pure_ python program buffer overflow proof? > > > For example in C++ you can declare a char[9] to hold user input. > > If the user inputs 10+ chars a buffer overflow occurs. > > Short answer: NO > > Bounds checki

Re: pyc files not automatically compiled on import

2009-07-26 Thread Fuzzyman
On Jul 26, 5:22 pm, Baz Walter wrote: > hello > > i thought that python automatically compiled pyc files after a module is > successfully imported. what could prevent this happening? > > Python 2.6.1 (r261:67515, Apr 12 2009, 03:51:25) > [GCC 4.3.2] on linux2 > Type "help", "copyright", "credits"

Re: Replacing module with a stub for unit testing

2009-06-04 Thread Fuzzyman
On May 23, 2:00 pm, pigmart...@gmail.com wrote: > Hi, > > I'm working on a unit test framework for a module.  The module I'm > testing indirectly calls another module which is expensive to access > --- CDLLs whose functions access a database. > >     test_MyModule --->MyModule--->IntermediateModule

Re: A Special Thanks

2009-04-21 Thread Fuzzyman
On Apr 21, 3:52 pm, a...@pythoncraft.com (Aahz) wrote: > In article , > Nick Craig-Wood   wrote: > > > > >Python also converted me to using unit tests.  If you add unit tests > >into your methodology above then when you re-organize (or refactor to > >use the modern jargon) the code you can be 100%

ANN: Mock 0.5.0 Release

2009-04-19 Thread Fuzzyman
Mock 0.5.0 has just been released. * Mock Homepage http://www.voidspace.org.uk/python/mock/ * Download Mock 0.5.0 release (zip) http://www.voidspace.org.uk/downloads/mock-0.5.0.zip * Mock Documentation as a PDF http://www.voidspace.org.uk/downloads/mock.pdf * Mock entry on PyPI http://pypi.python

ANN: ConfigObj 4.6.0 and Validate 1.0.0 released

2009-04-17 Thread Fuzzyman
Finally a fresh release ConfigObj and Validate. * ConfigObj Home page: http://www.voidspace.org.uk/python/configobj.html * Validate Home page: http://www.voidspace.org.uk/python/validate.html **ConfigObj** is a simple to use but powerful Python library for the reading and writing of configuration

Re: llvm vs. parrot

2009-04-12 Thread Fuzzyman
On Apr 11, 12:16 am, Paul Watson wrote: > Is Parrot out of favor these days?  It appears that Google is going to > use llvm. > > http://code.google.com/p/unladen-swallow/ Has Parrot ever been in favour? Actually they're quite different things. Michael -- http://www.ironpythoninaction.com/ -- ht

Re: PyPy Progress (and Psyco)

2009-03-15 Thread Fuzzyman
On Mar 15, 3:46 pm, Gerhard Häring wrote: > andrew cooke wrote: > > This looks very promising - > >http://www.voidspace.org.uk/python/weblog/arch_d7_2009_03_14.shtml#e1063 > > > I am really looking forwards to PyPy having a final release.  I hope it > > happens. > > Me too. I doubt it, though. Fro

Re: Python 3: range objects cannot be sliced

2009-01-25 Thread Fuzzyman
On Jan 25, 2:28 pm, Alan G Isaac wrote: > On 1/16/2009 3:13 PM Alan G Isaac apparently wrote: >  > It is documented: >  >http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-b... > > But then again, the opposite is also documented, > since `range` is a sequence type.  Quoting: > >  

Re: vb2py status?

2009-01-17 Thread Fuzzyman
On Jan 17, 3:52 pm, Vito De Tullio wrote: > Giampaolo Rodola' wrote: > >> > So is vb2py dead? If not, any idea when it'll support python 3? > >> I don't know this vb2py, but you can do a 2 pass conversion > >> [vb] -> (vb2py) -> [py2] -> (2to3) -> [py3] > > ...and presumibly get something which do

Re: Python 3: range objects cannot be sliced

2009-01-16 Thread Fuzzyman
On Jan 16, 5:45 pm, Alan G Isaac wrote: > Is the behavior below expected? Documented? > (The error msg is misleading.) > Thanks, > Alan Isaac > >  >>> x = range(20) >  >>> s = slice(None,None,2) >  >>> x[s] > Traceback (most recent call last): >    File "", line 1, in > TypeError: sequence index

Re: If your were going to program a game...

2009-01-02 Thread Fuzzyman
On Jan 2, 6:16 pm, Jean-Paul Calderone wrote: > On Fri, 2 Jan 2009 09:44:55 -0800 (PST), Fuzzyman wrote: > >On Jan 2, 3:02 pm, J Kenneth King wrote: > >> Tokyo Dan writes: > >> > If your were going to program a game in python what technologies would > >>

Re: Is there a better algorithm?

2009-01-02 Thread Fuzzyman
On Jan 2, 6:11 pm, Kottiyath wrote: > I have the following list of tuples: > L = [(1, 2), (3, 4, 5), (6, 7)] > > I want to loop through the list and extract the values. > The only algorithm I could think of is:>>> for i in l: > > ...  u = None > ...  try: > ...   (k, v) = i > ...  except ValueErro

Re: FW: python import sys.path

2009-01-02 Thread Fuzzyman
On Jan 2, 2:28 pm, John Machin wrote: > On Jan 3, 1:09 am, "Kelly, Brian" wrote:> After > following your suggestions I was able to confirm that the 2.5 > > interpreter was being invoked. So then I grepped for all instances of python > > in the scripts that were imported as modules: from bacula_c

Re: If your were going to program a game...

2009-01-02 Thread Fuzzyman
On Jan 2, 3:02 pm, J Kenneth King wrote: > Tokyo Dan writes: > > If your were going to program a game in python what technologies would > > you use? > > > The game is a board game with some piece animations, but no movement > > animation...think of a chess king exploding. The game runs in a > > b

Re: mod_pylite?

2009-01-02 Thread Fuzzyman
On Jan 2, 2:49 pm, excord80 wrote: [snip...] > > It sounds interesting, however, after reading a bit about it, I see > that a large part of wsgi is providing a nice interface between web > server and webapp. I don't think I need any such interface, or at > least, a replacement for CGI. I just need

Re: why cannot assign to function call

2009-01-01 Thread Fuzzyman
On Dec 29 2008, 9:34 am, John Machin wrote: > On Dec 29, 5:01 pm, scsoce wrote: > > > I have a function return a reference, > > Stop right there. You don't have (and can't have, in Python) a > function which returns a reference that acts like a pointer in C or C+ > +. Please tell us what manual,

Re: Why not Ruby?

2009-01-01 Thread Fuzzyman
On Jan 2, 12:16 am, Steven D'Aprano wrote: > On Thu, 01 Jan 2009 12:32:53 -0800, Paul Rubin wrote: > > On many occasions I've wished for a functional dictionary implementation > > in Python, like Haskell's Data.Map.  One of these years I'll get around > > to writing one. > > You don't think Pyth

Re: If your were going to program a game...

2009-01-01 Thread Fuzzyman
On Jan 1, 10:24 pm, Aaron Brady wrote: > On Jan 1, 2:55 pm, "Chris Rebert" wrote: > > > > > On Thu, Jan 1, 2009 at 12:24 PM, excord80 wrote: > > > On Jan 1, 2:37 pm, Kay Schluehr wrote: > > > >> There is no solution to this problem from a Python perspective. Do > > >> what everyone does right n

Re: If your were going to program a game...

2009-01-01 Thread Fuzzyman
On Jan 1, 8:55 pm, "Chris Rebert" wrote: > On Thu, Jan 1, 2009 at 12:24 PM, excord80 wrote: > > On Jan 1, 2:37 pm, Kay Schluehr wrote: > > >> There is no solution to this problem from a Python perspective. Do > >> what everyone does right now: [snip] > > > It still surprises me that no one has i

Re: Why not Ruby?

2009-01-01 Thread Fuzzyman
On Jan 1, 8:32 pm, Paul Rubin wrote: [snip...] > > Of course pythons list, dict, strings in my opinion just can't be beat, > > On many occasions I've wished for a functional dictionary > implementation in Python, like Haskell's Data.Map.  One of these years > I'll g

Re: On Whose Desktop

2008-12-23 Thread Fuzzyman
On Dec 23, 12:06 pm, Steve Holden wrote: > Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: > >  http://onyourdesktop.blogspot.com/ > > Who would you like to see profiled next? > > regards >  Steve > -- > Steve Holden        +1 571 484 6266   +1 800 494 3119 > Holden Web LLC

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Fuzzyman
> That's an interesting definition of crash. You're just like saying: "C > has crashed because I made a bug in my program". In this context, it is > your program that crashes, not python nor C, it is misleading to say so. > > It will be python's crash if: > 1. Python 'segfault'ed > 2. Python inter

Re: Looking for the best way to translate an idiom

2008-12-14 Thread Fuzzyman
On Dec 14, 5:51 pm, Paul Moore wrote: > On 14 Dec, 16:22, Bruno Desthuilliers > > wrote: > > if you only want the first returned value, you can just apply a slice: > > > def f(): > >     return 1,2,3 > > > a = f()[0] + 1 > > Hmm, true. I'm not sure it's any less ugly, though :-) > > > FWIW, Pyth

Re: Dabo 0.9.0 Released

2008-12-10 Thread Fuzzyman
On Dec 10, 7:24 pm, Ed Leafe <[EMAIL PROTECTED]> wrote: > We are proud (and relieved!) to finally release Dabo 0.9.0, the first   > official release of the framework in six months. We haven't been   > taking it easy during that period; rather, we made some changes that   > clean up some weak spots

Re: Windows Installer testing using python.

2008-11-29 Thread Fuzzyman
On Nov 28, 10:02 am, kalyan <[EMAIL PROTECTED]> wrote: > Hi, > > How can we test Windows Installer using python. > Is there any module available for testing? > Please mail to [EMAIL PROTECTED] > > Thanks, > Kalyan. What do you need to test? We test our msi installers by automating them from Python

Re: Pycon 2009

2008-11-29 Thread Fuzzyman
On Nov 29, 4:22 am, r <[EMAIL PROTECTED]> wrote: > Sorry friend, i could not view your link, but if you are trying to > garner support for python nobody here cares. I have already been > lynched by the community for tying to promote python. > > see the > thread:http://groups.google.com/group/comp.

Re: double import protection - how to ?

2008-11-29 Thread Fuzzyman
On Nov 29, 3:40 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > > Helmut Jarausch wrote: > > >> I have a module which gets imported at several different places > >> not all of which are under my control. > > >> How can I achieve that  all/some statements within that module > >

Re: Exhaustive Unit Testing

2008-11-29 Thread Fuzzyman
On Nov 29, 3:33 am, "Emanuele D'Arrigo" <[EMAIL PROTECTED]> wrote: > On Nov 29, 12:35 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > Your experiences are one of the reasons that writing the tests *first* > > can be so helpful. You think about the *be

Re: Exhaustive Unit Testing

2008-11-28 Thread Fuzzyman
On Nov 27, 4:32 pm, "Emanuele D'Arrigo" <[EMAIL PROTECTED]> wrote: > On Nov 27, 5:00 am, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > Refactor until your code is simple enough to unit-test effectively, then > > unit-test effectively. > > Ok, I've taken this wise suggestion on board and of cou

Re: Is psyco available for python 2.6?

2008-11-09 Thread Fuzzyman
On Nov 9, 2:18 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > On Thu, 30 Oct 2008 17:45:40 +0100 > > Gerhard Häring <[EMAIL PROTECTED]> wrote: > > psyco seems to just work on Linux with Python 2.6. So it is probably > > "only" a matter of compiling it on Windows for Python 2.6. > > Yes. I compile

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Fuzzyman
On Nov 9, 7:39 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Heh. Well it would, except the administrator user doesn't have a > > password (purely a VM) and this is unacceptable for runas. :-) > > There is, unfortunately, no other way to install Python 2.6 on Vista. > So your choices are rea

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Fuzzyman
On Nov 9, 6:23 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > On Sun, Nov 9, 2008 at 4:14 PM, Fuzzyman <[EMAIL PROTECTED]> wrote: > > Hello guys, > > > Not sure if this is a Windows question or a Python problem... > > > I'm trying to i

Installing Python 2.6 on Vista

2008-11-09 Thread Fuzzyman
Hello guys, Not sure if this is a Windows question or a Python problem... I'm trying to install Python 2.6 from the msi, on Windows Vista as an administrative user with UAC on. If I try to install for all users then I am told I don't have privileges to do that... (No UAC prompt.) The only other

Re: Finding the instance reference of an object

2008-10-30 Thread Fuzzyman
On Oct 30, 1:13 am, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 29, 2008, at 4:52 PM, Fuzzyman wrote: > > > You're pretty straightforwardly wrong. In Python the 'value' of a > > variable is not the reference itself. > > That's the misconc

Re: Finding the instance reference of an object

2008-10-30 Thread Fuzzyman
On Oct 30, 1:13 am, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 29, 2008, at 4:52 PM, Fuzzyman wrote: > > > You're pretty straightforwardly wrong. In Python the 'value' of a > > variable is not the reference itself. > > That's the misconc

Re: Finding the instance reference of an object

2008-10-29 Thread Fuzzyman
On Oct 28, 3:59 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 27, 2008, at 11:28 PM, Gabriel Genellina wrote: > > > > > En Tue, 28 Oct 2008 00:58:10 -0200, greg   > > <[EMAIL PROTECTED]> escribió: > > >> Let's look at the definitions of the terms: > > >> (1) Call by value: The actual parameter

Re: Global dictionary or class variables

2008-10-25 Thread Fuzzyman
On Oct 24, 9:44 pm, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > in an application I have to use some variables with fixed valuse. > > For example, I'm working with musical notes, so I have a global > dictionary like this: > > natural_notes = {'C': 0, 'D': 2, 'E': 4 } > > This actually works fin

Re: How to examine the inheritance of a class?

2008-10-25 Thread Fuzzyman
On Oct 24, 7:27 pm, Derek Martin <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 11:59:46AM +1000, James Mills wrote: > > On Fri, Oct 24, 2008 at 11:36 AM, John Ladasky <[EMAIL PROTECTED]> wrote: > > > etc.  The list of subclasses is not fully defined.  It is supposed to > > > be extensible by

Re: Finding the instance reference of an object

2008-10-22 Thread Fuzzyman
On Oct 17, 10:39 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: > > >> And my real point is that this is exactly the same as in every > >> other modern language. > > > No, it isn't.  In many other languages (C, Pascal, etc.), a > > "variable" is common

Re: compile() and comments

2008-10-13 Thread Fuzzyman
Hello Ed, It is certainly an odd restriction, but the docs for compile [1] do explicitly state that the input must be newline terminated. When compiling multi-line statements, two caveats apply: line endings must be represented by a single newline character ('\n'), and the input must be termi

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Fuzzyman
On Oct 13, 10:11 am, Rafe <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working within an application (making a lot of wrappers), but the > application is not case sensitive. For example, Typing obj.name, > obj.Name, or even object.naMe is all fine (as far as the app is > concerned). The problem is, If

ANN: Mock 0.4.0 released

2008-10-13 Thread Fuzzyman
Mock 0.4.0 has just been released, the first release in about ten months (but worth the wait). Mock is a simple library for testing: specifically for mocking, stubbing and patching. * Mock Homepage & Documentation http://www.voidspace.org.uk/python/mock.html * mock.py (module only)

Re: Python on JavaScript VM's (such as V8)?

2008-10-07 Thread Fuzzyman
On Oct 2, 1:06 pm, lkcl <[EMAIL PROTECTED]> wrote: > On Sep 3, 10:02 pm, [EMAIL PROTECTED] wrote: > > > Berco Beute: > > > > I wonder what it would take to implement Python in JavaScript so it > >  it's been done.  http://pyjamas.sf.net > That's hardly an implementation of Python in Javascript - i

Re: Python 2.6: Determining if a method is inherited

2008-10-07 Thread Fuzzyman
On Oct 7, 2:29 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > > On Oct 6, 7:02 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > >> fuzzyman wrote: > >>> Doesn't sound like a particularly *good* solution to me. :-) > >>  From w

Re: Is PyFIT dead and abandoned?

2008-10-07 Thread Fuzzyman
On Oct 7, 1:34 am, Ben Finney <[EMAIL PROTECTED]> wrote: > "James Mills" <[EMAIL PROTECTED]> writes: > > On Tue, Oct 7, 2008 at 5:18 AM,  <[EMAIL PROTECTED]> wrote: > > > Has PyFIT been completely abandoned? Is there a better alternative or > > > other resources to help me integrate fitnesse and py

Re: Python 2.6: Determining if a method is inherited

2008-10-06 Thread Fuzzyman
On Oct 6, 7:02 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > > On Oct 5, 11:54 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > >> Fuzzyman wrote: > >>> Hello all, > >>> I may well be being dumb (it has happened before), but I&#x

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-06 Thread Fuzzyman
On Oct 6, 7:23 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 6, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Oct 6, 7:01 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > >

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-06 Thread Fuzzyman
On Oct 6, 7:01 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 6, 4:30 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Oct 6, 1:13 am, MRAB <[EMAIL PROTECTED]> wrote: > > > > Fuzzyman wrote: > >

Re: Python 2.6: Determining if a method is inherited

2008-10-06 Thread Fuzzyman
On Oct 6, 7:16 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > In 3.0, the test returns true because function attributes only get > > wrapped when bound. In the meanwhile, " 'object' in repr(X.__lt__)" > > should do it for you. > > This session should give you some hints h

Re: Python 2.6: Determining if a method is inherited

2008-10-06 Thread Fuzzyman
On Oct 5, 11:54 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > > Hello all, > > > I may well be being dumb (it has happened before), but I'm struggling > > to fix some code breakage with Python 2.6. > > > I have some code that looks

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-06 Thread Fuzzyman
On Oct 6, 1:13 am, MRAB <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > > Hello all, > > > I may well be being dumb (it has happened before), but I'm struggling > > to fix some code breakage with Python 2.6. > > > I have some code that looks for the 

Re: Python 2.6: Determining if a method is inherited

2008-10-05 Thread Fuzzyman
On Oct 5, 8:15 pm, [EMAIL PROTECTED] (Valentino Volonghi aka Dialtone) wrote: > Fuzzyman <[EMAIL PROTECTED]> wrote: > > So how do I tell if the X.__lt__ is inherited from object? I can look > > I don't have python 2.6 installed so I can't try but what I think cou

Python 2.6 / 3.0: Determining if a method is inherited (Fixed)

2008-10-05 Thread Fuzzyman
Hello all, Sorry - my messages aren't showing up via google groups, so I'm kind of posting on faith... Anyway, I solved my problem (I think)... import sys if sys.version_info[0] == 3: def _has_method(cls, name): for B in cls.__mro__: if B is object: conti

Python 2.6 / 3.0: Determining if a method is inherited

2008-10-05 Thread Fuzzyman
Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default implementation of '__lt__', s

Python 2.6: Determining if a method is inherited

2008-10-05 Thread Fuzzyman
Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default implementation of '__lt__', s

Re: How to kill threading.Thread instance?

2008-09-21 Thread Fuzzyman
On Sep 21, 4:04 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > >> I wonder why something like myThread.exit() or myThread.quit() or > >> threading.kill(myThread) can't be implemented? > >> Is something like that present in Python 3000? > > > Not that I'm aware of it (which

Re: Cancel instance create

2008-09-09 Thread Fuzzyman
On Sep 6, 1:23 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Mohamed Yousef schrieb: > > > ðWhat about no Constructor , and a custom instancing function that can > > return either None or the instance wanted > > That doesn't solve the underlying problem - the instance is created. > Just becau

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-03 Thread Fuzzyman
On Aug 3, 3:02 pm, CNiall <[EMAIL PROTECTED]> wrote: > I am very new to Python (I started learning it just yesterday), but I > have encountered a problem. > > I want to make a simple script that calculates the n-th root of a given > number (e.g. 4th root of 625--obviously five, but it's just an exa

Re: Questions on 64 bit versions of Python

2008-07-29 Thread Fuzzyman
On Jul 26, 8:02 pm, Rob Williscroft <[EMAIL PROTECTED]> wrote: > Martin v. Löwis wrote innews:[EMAIL PROTECTED] > comp.lang.python: > > >> I just tested, I built a default C# forms app using the "AnyCPU" > >> option and it ran as a 64 bit app (no *32 in Task Manager), this is > >> on XP64. > > >> I

Re: ironpython, exception in mscorlib when reading .py file from network share

2008-07-29 Thread Fuzzyman
On Jul 29, 9:34 am, mindmind <[EMAIL PROTECTED]> wrote: > Hello, > > I have a ironpython 1.1.1.0 host in my c# app, and When doing a >   engine.ExecuteFile(file); > i often get the error below, when "file" is on a network share : > (winXp client , windows ??? server) > > 21-07-2008 12:47:28 : Trace

Re: interpreter vs. compiled

2008-07-28 Thread Fuzzyman
On Jul 27, 6:02 am, castironpi <[EMAIL PROTECTED]> wrote: > On Jul 24, 11:04 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > > > castironpi <[EMAIL PROTECTED]> wrote: > > > >Compiling a program is different than running it.  A JIT compiler is a > > >kind of compiler and it makes a compilation step

ANN: PyCon UK Talks and Tutorials List Up

2008-07-28 Thread Fuzzyman
PyCon UK 2008 is the second PyCon event in the UK, and is being held on 12th to 14th September at the Birmingham Conservatoire. We have a bevy of national and international Python stars speaking as well as a host of members of the Python community. The conference starts with a day of tutorials on

Re: Attack a sacred Python Cow

2008-07-25 Thread Fuzzyman
On Jul 24, 6:41 am, Jordan <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm a big Python fan who used to be involved semi regularly in > comp.lang.python (lots of lurking, occasional posting) but kind of > trailed off a bit. I just wrote a frustration inspired rant on my > blog, and I thought it w

Re: win32api not found?

2008-07-19 Thread Fuzzyman
On Jul 19, 8:45 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote: > On Saturday 19 July 2008 21:13:04 Lamonte Harris wrote: > > > Where can I get the win32api module? I been searching all day on google and > > nothing, i installed > >https://sourceforge.net/project/showfiles.php?group_id=78018which r

Re: Why is this blowing the stack, thought it was tail-recursive...

2008-07-13 Thread Fuzzyman
On Jul 13, 7:56 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 12 Jul 2008 19:25:18 -0400, Terry Reedy wrote: > > ssecorp wrote: > >> def fib(n): > >>     def fibt(a, b, n): > >>         if n <= 1: > >>             return b > >>         else: > >>             return fib

Re: ANN: P4D 1.1

2008-07-11 Thread Fuzzyman
On Jul 11, 10:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > P4D = E4X style embedded DSL for Python but without E and X. > > For more information see: > > http://pypi.python.org/pypi/P4D/1.1-py2.5 That looks a lot like YAML. Any reason to use it over YAML? Michael Foord http://www.ironpythonin

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-03 Thread Fuzzyman
On Jun 30, 11:25 pm, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > On Jul 1, 12:15 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 30, 10:46 pm, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > > > > I don't want to be so mean here, but

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-03 Thread Fuzzyman
On Jul 2, 9:33 am, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > On Jul 1, 12:15 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 30, 10:46 pm, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > > > > I don't want to be so mean here, but

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-03 Thread Fuzzyman
On Jul 2, 9:33 am, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > On Jul 1, 12:15 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 30, 10:46 pm, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > > > > I don't want to be so mean here, but

Re: Freesoftware for auto/intelligent code completing in Python

2008-06-30 Thread Fuzzyman
On Jun 30, 10:46 pm, Ali Servet Dönmez <[EMAIL PROTECTED]> wrote: > I don't want to be so mean here, but how hard it could be be writing a > freesoftware which would automatically/intelligently auto complete > Python code? (I mean something that really does the job, like > Microsoft's Visual Studio

Re: URLLIb2 problem

2008-06-30 Thread Fuzzyman
On Jun 30, 9:11 pm, [EMAIL PROTECTED] wrote: > I am trying to write somecode of this kind :) > > opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) > opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows; U; Windows > NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'), > ('A

Re: An idiom for code generation with exec

2008-06-23 Thread Fuzzyman
On Jun 21, 7:52 am, Peter Otten <[EMAIL PROTECTED]> wrote: > eliben wrote: > > On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > >> eliben wrote: > >> > Additionally, I've found indentation to be a problem in such > >> > constructs. Is there a workable way to indent the code at the level

Re: installed 3.0, rebind winprompt to 2.5?

2008-06-23 Thread Fuzzyman
On Jun 23, 6:53 pm, cirfu <[EMAIL PROTECTED]> wrote: > i installed python 3.0. now when im laucnhing from the dos prompt in > win vista it searches in python3.0 > > i want to rebind it to 2.5, what do i need to change? Reinstalling 2.5 should work. Michael Foord http://www.ironpythoninaction.com/

Re: Fast and easy GUI prototyping with Python

2008-06-21 Thread Fuzzyman
On Jun 21, 6:15 pm, [EMAIL PROTECTED] wrote: > Thanks for your input. The prototype will be running on Windows only. > Portability  and being able to develop on other platforms would be a > bonus, but is not a requirement. I guess the choice is going to be > between Visual Studio and Qt. Of importa

Re: Fast and easy GUI prototyping with Python

2008-06-21 Thread Fuzzyman
On Jun 21, 1:36 pm, [EMAIL PROTECTED] wrote: > Which tools would you use? I want the interface design to be as easy > and fast as possible, all ideology aside. I'm considering > eitherIronPython+Visual Studio or Python+Qt -- but I'm open for other > suggestions. > > Visual Studio seems to offer th

Re: Plotting Graphs using Gnuplot

2008-06-12 Thread Fuzzyman
On Jun 12, 12:30 pm, [EMAIL PROTECTED] wrote: > Hello. Was trying to create a simple plotting function. Wasnt working > however. If i write the same code without putting it inside a function > it works. :S. Could some1 tell me the problem? Heres the code: > > # File name Plotting2 > > import Gnuplo

Re: How to kill a thread?

2008-06-11 Thread Fuzzyman
On Jun 11, 8:41 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 11, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 6:49 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]&g

  1   2   3   4   5   6   7   8   9   >