Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread Patrick Mullen
On Wed, Apr 22, 2009 at 9:33 PM, David Lyon wrote: > Hi Steve, >>> Why should the package developer dictacte which python version the >>> package will run on ? >> >> Because they're the developer. Who else should decide what Python >> versions to support? > The developer shouldn't be making such d

Re: Too early implementation

2009-04-18 Thread Patrick Mullen
2009/4/18 Filip Gruszczyński : > Yep, I have heard a lot about test driven development. I am now > programming a lot using DJango and I would like to use its test > framework to try it. However, I have little experience with this (as > most people I know). I also have no idea, how to apply this, wh

Re: Python Goes Mercurial

2009-04-03 Thread Patrick Mullen
2009/4/3 Jeremiah Dodds : > > > On Thu, Apr 2, 2009 at 9:02 PM, andrew cooke wrote: >> >> Echo wrote: >> > 2009/4/2 Jeremiah Dodds >> > >> >> The one thing that makes me want to use git more than any other dvcs is >> >> that you don't have to create a new directory for branches. This may be >> >>

Re: py2exe automatic upgrades of a program while it is running, is that possible?

2009-03-03 Thread Patrick Mullen
On Mon, Mar 2, 2009 at 6:56 PM, Maxim Khitrov wrote: > - Show quoted text - > On Mon, Mar 2, 2009 at 9:18 PM, William Heath wrote: >> Hi All, >> I am using py2exe to create a windows executable.  I am curious if anyone >> knows a way to automatically upgrade a py2exe windows executable while it i

Re: Multiple separate py2exe executables and library.zip

2009-03-01 Thread Patrick Mullen
On Sun, Mar 1, 2009 at 8:35 AM, The Dude wrote: >   Hello, > >   Each invocation of py2exe creates an executable along with a number of > other files which need to be distributed with it, including library.zip. I > noticed that compiling different scripts creates different, and incompatible > libr

Re: How do I DRY the following code?

2008-12-29 Thread Patrick Mullen
On Mon, Dec 29, 2008 at 6:13 PM, R. Bernstein wrote: > How do I DRY the following code? > > class C(): > > def f1(self, arg1, arg2=None, globals=None, locals=None): > ... unique stuff #1 ... > ... some common stuff #1 ... > ret = eval(args, globals, locals) > ... more stuff #2

Re: Are Django/Turbogears too specific?

2008-12-21 Thread Patrick Mullen
On Sun, Dec 21, 2008 at 11:41 AM, Gilles Ganault wrote: > Hi > > I'd like to rewrite a Web 2.0 PHP application in Python with AJAX, and > it seems like Django and Turbogears are the frameworks that have the > most momentum. > > I'd like to use this opportunity to lower the load on servers, as the

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Patrick Mullen
On Sun, Dec 21, 2008 at 11:26 AM, r wrote: > I noticed when i mentioned "self" nobody wants to touch that subject. > There could be many reasons why... > > 0.) nobody but the 10 regulars i see here exists > 1.) nobody cares(doubt it) > 2.) nobody is brave enough to question it(maybe) > 3.) most pe

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Patrick Mullen
On Sat, Dec 20, 2008 at 10:15 PM, r wrote: > On Dec 20, 11:11 pm, walterbyrd wrote: >> On Dec 20, 5:05 pm, Roy Smith >> >> > He got really hung up on the % syntax. >> >> I guess it's good to know that there is, at least, one person in the >> world doesn't like the % formatting. As least the move

Re: "as" keyword woes

2008-12-10 Thread Patrick Mullen
On Wed, Dec 10, 2008 at 11:57 AM, Benjamin Kaplan <[EMAIL PROTECTED]> wrote: > > > On Wed, Dec 10, 2008 at 12:22 PM, Patrick Mullen <[EMAIL PROTECTED]> > wrote: >> >> I don't have a huge stake in this, but I wouldn't mind a change to >> allow any

Re: "as" keyword woes

2008-12-10 Thread Patrick Mullen
On Wed, Dec 10, 2008 at 6:57 AM, MRAB <[EMAIL PROTECTED]> wrote: > Aaron Brady wrote: >> >> On Dec 9, 12:40 pm, MRAB <[EMAIL PROTECTED]> wrote: >>> >>> Aaron Brady wrote: On Dec 9, 8:28 am, MRAB <[EMAIL PROTECTED]> wrote: snip > > In some languages (I think Delphi is one of t

Re: Guido's new method definition idea

2008-12-08 Thread Patrick Mullen
On Mon, Dec 8, 2008 at 12:55 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > >> class C: >> def createfunc(self): >> def self.func(arg): >> return arg + 1 >> >> Or, after the class definition is done, to extend it dynamically: >> >> def C.method

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-07 Thread Patrick Mullen
On Sun, Dec 7, 2008 at 4:43 PM, <[EMAIL PROTECTED]> wrote: > Trying to decide which to get started with. Can anyone suggest some > pros and cons to each of them? > > Would PyOpenGL be in the same camp as Pygame and pyglet? Do either of > Pygame or pyglet make use of PyOpenGL behind the scenes? > -

Re: Guido's new method definition idea

2008-12-05 Thread Patrick Mullen
>> Daniel Fetchinson wrote: >>> http://neopythonic.blogspot.com/2008/10/why-explicit-self-has-to- > stay.html >>> >>> The proposal is to allow this: >>> >>> class C: >>> def self.method( arg ): >>> self.value = arg >>> return self.value >>> >>> instead of this: >>> >>> class C:

Re: using exec() to instantiate a new object.

2008-11-07 Thread Patrick Mullen
On Fri, Nov 7, 2008 at 2:23 PM, RyanN <[EMAIL PROTECTED]> wrote: > > to do this I tried: > >def addCountry(self,country_name): ># create an instance of country >exec(country_name + "= country('" + country_name + "')") ># Add this new instance of a country to a list >

Re: Not fully OO ?

2008-09-28 Thread Patrick Mullen
On Fri, Sep 26, 2008 at 1:11 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Steven D'Aprano a écrit : >> >> On Fri, 26 Sep 2008 17:00:59 +0200, Bruno Desthuilliers wrote: >> >>> Patrick Mullen a écrit : >>>> >>>> Depending on

Re: Not fully OO ?

2008-09-26 Thread Patrick Mullen
Depending on the scale of the website I am making, how much I care about editing it in the future, and how much I just want to get something up, I will occasionally use php. And I am a self confessed php hater :) But it's generally the fastest way I know to get something up. So even terrible lan

Re: Wouldn't it be nice if this worked?

2008-08-10 Thread Patrick Mullen
How about: class A: def add(self,x,y): return x+y class B(A): pass print B().add(1, 2) This also works: class A: def add(self, x, y): return x+y class B: pass B.add = A.add.im_func print B().add(1, 2) -- http://mail.python.org/mailman/listinfo/python-list

Re: Reasoning behind 'self' parameter in classes?

2008-07-30 Thread Patrick Mullen
On Wed, Jul 30, 2008 at 12:27 PM, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Given the code samples above, is there any technical reason why this cannot > be done? Thanks for the input guys, and thanks more over for keeping this > easy-going. > > -- > http://mail.python.org/mailman/listinfo/pyth

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Patrick Mullen
On Wed, Jun 11, 2008 at 12:28 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > If Desthuilliers doesn't like my suggestion, then fine. If no other > Python programmer in the world likes it, then so be it. But do we > really need to get personal about it? Python will not be ruined if it > gets such a key

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Patrick Mullen
Hi Russ, Here are just some pragmatic considerations. Personally I am against data hiding, but I obviously won't convince you in that regard. There are some pros and cons as with anything, and I feel the cons outweight the pros (namely that users of code should be able to use how they want, even

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Patrick Mullen
"Well, "common" in Prolog, Smalltalk, Haskell, ML, and Erlang is hardly common in general. I'll bet that Java and C/C++ are used more in North Dakota than all those languages combined are used in the entire world." I would say python has more in common with the mentioned family than with the C or

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Patrick Mullen
Can we plez not try and ruin my fave language with a useless concept? Strict data hiding is only necessary because textbooks say it is. Use method attributes or some other hack if you really must (people won't know it's there unless they look, and if they are looking, maybe they have a reason?) I

Re: php vs python

2008-06-02 Thread Patrick Mullen
Yeah I would agree that a decent (a few steps below good in my book) programmer should be able to have a decent handle on a new language, given some acclimatization time of course. The amount of time this period lasts varies on the language said programmer is learning, as well as the languages he

Re: Struct usages in Python

2008-05-27 Thread Patrick Mullen
I don't know if this will go through (my posts seem to have become blocked lately), but I'll give it a shot anyhow. You seem to be under a misconception that a python list is similar to a list in say, Java or other languages that have a rigid idea of variables and types. In python, a list is a li

Re: Why does python not have a mechanism for data hiding?

2008-05-25 Thread Patrick Mullen
Here is a quick, ugly way you can easily hide data, although persistent clients can still bypass it. x.__dict__ is ugly, though not any uglier than x.__Ugly__Internal__Variable__Do__Not__Set Another option would be to use another structure, such as a dictionary or list, and store variables in the

Re: Why does python not have a mechanism for data hiding?

2008-05-25 Thread Patrick Mullen
There are certainly situations where data hiding is useful and perhaps a wanted feature, but there has to be at least one place where I can use what I want when I want to with some high and mighty designer telling me what I should and shouldn't access. One of the reasons they have data hiding in s

Re: Python web development that resembles PHP or classic ASP

2008-05-25 Thread Patrick Mullen
Hi Erik, As far as I know the only full web framework that works with a primarily inline style is spyce, which is not currently under active development. I used it for a while and it was the first python framework I used. I think it's pretty good, if a little bit of an underdog. That said, usin

Re: Code correctness, and testing strategies

2008-05-24 Thread Patrick Mullen
I can see both sides of this argument, and I think TDD is great in some cases and not so great in others. I have used it before, but don't use it often, as the programs I write are very difficult to automatically test. (Games, which many of the bugs have to do with whether an optimization produces

Re: Python is slow

2008-05-24 Thread Patrick Mullen
Judging python's speed by how fast websites go is not going to work very well. There are many things that can bog down the "speed" of loading a web site, especially if you are judging speed by how long a page takes to load. torontolife.com is loading extremely slow for me also. So is wikipedia. M

Re: MVC

2008-05-22 Thread Patrick Mullen
In my experience, python is very pattern agnostic. You can do functional or object oriented or procedural fairly easily, have deep or light object trees, or even mix procedural style with some object oriented code if you like. "There should be one way to do it" tends to not apply as much as some

Re: Passing functions around and executing

2008-05-14 Thread Patrick Mullen
Here's a quick dumb example, hope it helps: def function1(a,b,c): print a,b,c def function2(x): print x def function3(y): print y+3 def executeall(list): print "setting up" for function,args in list: function(*args) #Calls the function passing in the arguments mylist = [[f

Re: Free Memory

2008-05-10 Thread Patrick Mullen
Yeah I don't know much about locals or globals. I've never used them before, just know they are there. But anyway, to illustrate what I meant by the interesting behavior, here is the output (and sorry for it being so long): IDLE 2.6a2 >>> globals() {'__builtins__': , '__name__': '__main__', '__d

Re: Now what!?

2008-05-10 Thread Patrick Mullen
On Sat, May 10, 2008 at 3:57 PM, Grant Edwards <[EMAIL PROTECTED]> wrote: > On a Linux system (and I presume on other Unixes), the kernel > itself (if built with the proper options) knows know how start > a "script" file that starts with the characters "#!". When the > kernel is told to execute a

Re: Free Memory

2008-05-09 Thread Patrick Mullen
I had some very interesting results with this code to do what is asked: for key in globals().keys(): del globals()[key] for key in locals().keys(): del locals()[key] It might be better to reverse the two steps, I didn't give it much thought. Anyway, when this is done, all of the builtins

Re: Are rank noobs tolerated, here?

2008-05-04 Thread Patrick Mullen
There is also the python tutor list: http://mail.python.org/mailman/listinfo/tutor Which is more geared toward beginners. Although I am subscribed to both lists, and they are both matched by the same filter for me so I wont know the difference... But there may be people who are not subscribed t

Re: pygame.key.get_pressed[K_a], K_a is not defined!?

2008-05-02 Thread Patrick Mullen
The K_a is a constant integer, but you don't need to worry about it's value. It tells you the index in get_pressed() to check for. So: print pygame.key.get_pressed()[pygame.K_a] Says, look at the 97th index in the get_pressed() list and see if that is a 1 or a 0. Or if you use the pygame event

Re: Best way to store config or preferences in a multi-platform way.

2008-05-01 Thread Patrick Mullen
YAML is a joke if you expect a windows user to be able to hand edit the data. Windows users typically expect a .ini file in the application's directory. (Usually not the users home directory, even if that may be a better location). XML is ok, but .ini is much preferred. If you have a configurat

Re: Python 2.5 adoption

2008-04-21 Thread Patrick Mullen
On Mon, Apr 21, 2008 at 1:49 PM, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > OP: keep in mind that your users do not see any gain from you using > 2.5. All they see is something that makes your software harder to > install. At some point you can dismiss them as living in the Stone Age, > but the

Re: python setup.py install on Vista?

2008-04-18 Thread Patrick Mullen
On Fri, Apr 18, 2008 at 4:29 PM, globalrev <[EMAIL PROTECTED]> wrote: > type "python setup.py install" > > that is used in most "addons" for python. > > well using windows vista, where the h*** am i supposed to type this? > > if it is not doable in windows, what do i have to do instead? just >

Re: [Twisted-web] [ANN] Twisted 8.0

2008-03-27 Thread Patrick Mullen
It's dangerously close to april fools for this kind of posting! Congrats on the release, it looks mighty impressive. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does python hate cathy?

2008-03-24 Thread Patrick Mullen
It seems like this is mostly a non-issue. The original code actually works correctly (of course the updated versions that solve the exception problem are probably better). The only thing that is going haywire is the interpreter shutdown process. I think it is going a bit overboard to "consider _

Python to C/C++

2008-03-19 Thread Patrick Mullen
(sorry michael, didn't mean to personal post On Wed, Mar 19, 2008 at 9:24 AM, Michael Wieher wrote: > I think py2exe does this, but it might be a bit bloated No, py2exe basically bundles the main script and the interpreter together so it's easy to run and requires no python installation. Loo

Re: a Roguelike in Python

2008-03-12 Thread Patrick Mullen
On Wed, Mar 12, 2008 at 9:23 AM, Carl Banks <[EMAIL PROTECTED]> wrote: > Even though it's typically used for graphical games, PyGame would be a > good way to make a cross-platform "text-mode" game. It should be > pretty straightforward to simulate a text mode terminal using a grid > of sprites

Re: Removing objects

2008-01-23 Thread Patrick Mullen
On Jan 22, 2008 10:59 PM, <[EMAIL PROTECTED]> wrote: > I am writing a game, and it must keep a list of objects. I've been > representing this as a list, but I need an object to be able to remove > itself. It doesn't know it's own index. If I tried to make each object > keep track of it's own index

Re: Another newbie design question

2007-12-17 Thread Patrick Mullen
On Dec 17, 2007 1:10 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Hem... May I remind you that Python doesn't have block comments ?-) I suppose we could argue semantics, since """ strings are actually processed, but they are basically block comments. So, there we are, multiline strings A

Re: Is a "real" C-Python possible?

2007-12-13 Thread Patrick Mullen
> > > > Kay Schluehr wrote: > > > > Python 2.6 and 3.0 have a more Pythonic way for the problem: > > > > class A(object): > > > > @property > > > > def foo(self): > > > > return self._foo > > > > @foo.setter > > > > def foo(self, value) > > > > self._foo = value > >

Re: "Python" is not a good name, should rename to "Athon"

2007-12-06 Thread Patrick Mullen
Monty Python pioneered (or at least pioneered the organized televising of) a form of humor where there is no punchline or reason something is funny, it just is (or isn't). I find about half of it very funny, and the rest very unfunny. I used to find it more hilarious than I do now. It's an extre

Re: the annoying, verbose self

2007-11-24 Thread Patrick Mullen
On 24 Nov 2007 13:56:37 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > So:: > > def meth(self): > using self: > tmp = raw_input('Enter age: ') > age = int(tmp) > > becomes:: > > def meth(self): > using self: > self.tmp = self.

Re: the annoying, verbose self

2007-11-24 Thread Patrick Mullen
Ton Van Vliet: > [... using/with ...] This looks like a really nice little construct, and solves my small quirk issue (which has popped up maybe twice in my python experience). It could also be a solution to the OP's problem. The issue of course is disambiguation. Is EVERY name looked up in the

Re: Catching a segfault in a Python library

2007-11-24 Thread Patrick Mullen
On 24 Nov 2007 08:41:24 GMT, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > Donn Ingle wrote: > > Already done, the code within PIL is causing the crash. It gets ugly and > > out of my remit. It's a freetype/Pil thing and I simply want to a way to > > catch it when it happens. > > Since a segfault e

Re: the annoying, verbose self

2007-11-23 Thread Patrick Mullen
Most of the time self doesn't bother me in the slightest. The one time it does bother me however, is when I am turning a function into a method. In this case, often I have many local variables which I actually want to be instance variables, so I have to add self to all of them. Of course, this i

Re: Python too complex ?!?!?!

2007-11-23 Thread Patrick Mullen
On Nov 22, 2007 1:04 PM, Brian <[EMAIL PROTECTED]> wrote: > / Chime Mode > I have, in fact, sent this thread to my friend. > His limiting factors are > > - money-control people favor MS platforms > - C# and VS have minimal cost impact for academia > - sys admins have everything locked down (probab

Re: Python too complex ?!?!?!

2007-11-20 Thread Patrick Mullen
(Oops, sent as private, reposting to list) On Nov 20, 2007 12:36 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > FWIW it's trivial to run pyflakes on your code (automatically behind > the scenes) to get syntax checking; in vim, my syntax errors get > underlined immediately for python code. It

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Patrick Mullen
You would use setattr to bind a name that you don't know: for pin in self.pin: setattr(self,pin.Name,pin.Value) However, I'm not sure why you're using a dictionary in this way. I don't totally understand the context, so I may be wrong, but I would code it more like this: class Power_Supply(d