From dt-sapug at handcraftedcomputers.com.au Tue Apr 1 11:38:45 2008 From: dt-sapug at handcraftedcomputers.com.au (Daryl Tester) Date: Tue, 01 Apr 2008 20:08:45 +1030 Subject: [sapug] This week's odd job. Message-ID: <47F202A5.10900@handcraftedcomputers.com.au> OpenVMS *and* Python - could it get any more disparate? (Well, yes - .NET and ENIAC maybe?) (insert odd couple theme music for those old enough to remember it). (which isn't me)(a scheme refugee). -- Regards, Daryl Tester "We are sexy, sexy Von Neumann machines." -- http://www.xkcd.org/387/ From dt-sapug at handcraftedcomputers.com.au Wed Apr 16 07:18:11 2008 From: dt-sapug at handcraftedcomputers.com.au (Daryl Tester) Date: Wed, 16 Apr 2008 14:48:11 +0930 Subject: [sapug] "Ironical" Message-ID: <48058C13.5040409@handcraftedcomputers.com.au> Last week Google "beta'd" [1] their apps hosting service (to compete with Amazon Web Services from the look of it), built on top of Python (see for an online shell demo). At roughly the same time a bug in PyString_FromStringAndSize() surfaces (as much as a bug can surface - it was latently there all along). See . I guess if a service is labeled as Beta, the users don't expect 5 9's in service levels. :-) At least the chap who found the bug says dealing with the Python team was a lot more professionally handled than dealing with the Ruby team, so there's that. :-) [1] Is GMail out of beta yet? -- Regards, Daryl Tester "We are sexy, sexy Von Neumann machines." -- http://www.xkcd.org/387/ From chris at inetd.com.au Thu Apr 17 04:23:10 2008 From: chris at inetd.com.au (Chris Foote) Date: Thu, 17 Apr 2008 11:53:10 +0930 (CST) Subject: [sapug] "Ironical" In-Reply-To: <48058C13.5040409@handcraftedcomputers.com.au> References: <48058C13.5040409@handcraftedcomputers.com.au> Message-ID: On Wed, 16 Apr 2008, Daryl Tester wrote: > Last week Google "beta'd" [1] their apps hosting service (to compete > with Amazon Web Services from the look of it), built on top of Python > (see for an online shell demo). I missed the announcement about Google App Engine (http://code.google.com/appengine/). It looks very cool indeed! It's a shame I didn't catch it earlier, as their 10,000 account limit has been already reached when I tried to sign up for a test account :-( Chris Foote Inetd Pty Ltd T/A HostExpress Web: http://www.hostexpress.com.au Blog: http://www.hostexpress.com.au/drupal/chris Phone: (08) 8410 4566 From dt-sapug at handcraftedcomputers.com.au Thu Apr 17 05:01:13 2008 From: dt-sapug at handcraftedcomputers.com.au (Daryl Tester) Date: Thu, 17 Apr 2008 12:31:13 +0930 Subject: [sapug] "Ironical" In-Reply-To: References: <48058C13.5040409@handcraftedcomputers.com.au> Message-ID: <4806BD79.8040307@handcraftedcomputers.com.au> Chris Foote wrote: > It's a shame I didn't catch it earlier, as their 10,000 account limit > has been already reached when I tried to sign up for a test account :-( I've seen a few people on mailing lists say this, then get an account a few hours later, so this might not be the case yet. Hang in there and hope. :-) -- Regards, Daryl Tester "We are sexy, sexy Von Neumann machines." -- http://www.xkcd.org/387/ From spam at afoyi.com Thu Apr 17 11:12:45 2008 From: spam at afoyi.com (Darryl Ross) Date: Thu, 17 Apr 2008 18:42:45 +0930 Subject: [sapug] "Ironical" In-Reply-To: <4806BD79.8040307@handcraftedcomputers.com.au> References: <48058C13.5040409@handcraftedcomputers.com.au> <4806BD79.8040307@handcraftedcomputers.com.au> Message-ID: <4807148D.9000305@afoyi.com> Daryl Tester wrote: > Chris Foote wrote: >> It's a shame I didn't catch it earlier, as their 10,000 account limit >> has been already reached when I tried to sign up for a test account :-( As far as I can work out, it's just a crippled version of Django. (http://www.djangoproject.com/). Better to just use the real thing. > I've seen a few people on mailing lists say this, then get an account > a few hours later, so this might not be the case yet. Hang in there > and hope. :-) Having said that, I signed up for an account the day after and I haven't received anything, so I'd say they are at the limit. Cheers -D From derek.munneke at acm.org Thu Apr 17 12:19:02 2008 From: derek.munneke at acm.org (Derek Munneke) Date: Thu, 17 Apr 2008 19:49:02 +0930 Subject: [sapug] "Ironical" In-Reply-To: <4807148D.9000305@afoyi.com> References: <48058C13.5040409@handcraftedcomputers.com.au> <4806BD79.8040307@handcraftedcomputers.com.au> <4807148D.9000305@afoyi.com> Message-ID: <377bfd910804170319q37e344e4s5ccc5b24dffa8e92@mail.gmail.com> On Thu, Apr 17, 2008 at 6:42 PM, Darryl Ross wrote: > > As far as I can work out, it's just a crippled version of Django. > (http://www.djangoproject.com/). Better to just use the real thing. Of course your computer room may not be as big as google's and you internet pipe a bit smaller, in which case you might want to try google's version ;) (Or you could run Django on a EC2 instance if you don't mind paying a little : http://developer.amazonwebservices.com/connect/thread.jspa?messageID=60150 ) /derek From dt-sapug at handcraftedcomputers.com.au Fri Apr 18 01:43:18 2008 From: dt-sapug at handcraftedcomputers.com.au (Daryl Tester) Date: Fri, 18 Apr 2008 09:13:18 +0930 Subject: [sapug] "Ironical" In-Reply-To: <4807148D.9000305@afoyi.com> References: <48058C13.5040409@handcraftedcomputers.com.au> <4806BD79.8040307@handcraftedcomputers.com.au> <4807148D.9000305@afoyi.com> Message-ID: <4807E096.8080700@handcraftedcomputers.com.au> Darryl Ross wrote: > As far as I can work out, it's just a crippled version of Django. > (http://www.djangoproject.com/). Better to just use the real thing. Agreed if you were to only use it as a Django clone then yes, it wouldn't be worthwhile. However it's not "just" that - you get access to a datastore that appears to be built on top of GFS which would ease concurrency issues between multiple instances. -- Regards, Daryl Tester "We are sexy, sexy Von Neumann machines." -- http://www.xkcd.org/387/ From steve at adam.com.au Fri Apr 18 09:25:06 2008 From: steve at adam.com.au (stephen white) Date: Fri, 18 Apr 2008 16:55:06 +0930 Subject: [sapug] "Ironical" In-Reply-To: <377bfd910804170319q37e344e4s5ccc5b24dffa8e92@mail.gmail.com> References: <48058C13.5040409@handcraftedcomputers.com.au> <4806BD79.8040307@handcraftedcomputers.com.au> <4807148D.9000305@afoyi.com> <377bfd910804170319q37e344e4s5ccc5b24dffa8e92@mail.gmail.com> Message-ID: <3FF2416B-0358-4756-B993-024D75037CE5@adam.com.au> On 17/04/2008, at 7:49 PM, Derek Munneke wrote: > Of course your computer room may not be as big as google's and you > internet pipe a bit smaller, in which case you might want to try > google's version ;) Or rent/buy a couple of machines at different data centres, then fail- over and load-balance from your locally hosted master copy. That'll let you pass audits instead of saying to the inspectors "it's in the google cloud!" and shrugging. And if you need a library or a specific version or just access to the full environment you're already used to, hey, plop it on! The alternative? To: help at google.com Subject: Please put Python 1.2albatross_buttrose on, libPtoooieee needs it! Or you could use Google's platform if it's something simple and you don't care about it. And other people will have packages that set simple and don't care things up for you. As long as you don't care. And not too much data, and not too processor intensive. -- steve at adam.com.au From spam at afoyi.com Tue Apr 29 05:49:54 2008 From: spam at afoyi.com (Darryl Ross) Date: Tue, 29 Apr 2008 13:19:54 +0930 Subject: [sapug] TypeError: __init__() got multiple values for keyword argument 'value' Message-ID: <48169AE2.2050400@afoyi.com> Heya, I'm sure I've worked out how to to this in the past, but the syntax is escaping me right now. class DooHicky(object): def __init__(self, arg1=None, arg2=None): pass class Thingo(DooHicky): def __init__(self, value=None, *args, **kwargs): self.value = value super(Thingo, self).__init__(self, *args, **kwargs) Basically, I want to pass in an argument to my "Thingo" class which does not get passed back to the parent constructor. Any ideas / pointers? Cheers -D From chris at inetd.com.au Tue Apr 29 06:20:06 2008 From: chris at inetd.com.au (Chris Foote) Date: Tue, 29 Apr 2008 13:50:06 +0930 (CST) Subject: [sapug] TypeError: __init__() got multiple values for keyword argument 'value' In-Reply-To: <48169AE2.2050400@afoyi.com> References: <48169AE2.2050400@afoyi.com> Message-ID: On Tue, 29 Apr 2008, Darryl Ross wrote: > I'm sure I've worked out how to to this in the past, but the syntax is > escaping me right now. > > > class DooHicky(object): > def __init__(self, arg1=None, arg2=None): > pass > > class Thingo(DooHicky): > def __init__(self, value=None, *args, **kwargs): > self.value = value > super(Thingo, self).__init__(self, *args, **kwargs) > > > Basically, I want to pass in an argument to my "Thingo" class which does not > get passed back to the parent constructor. How about: class DooHicky(object): def __init__(self, arg1=None, arg2=None): pass class Thingo(DooHicky): def __init__(self, **kwargs): kwdict = kwargs self.value = kwdict['value'] del kwdict['value'] super(Thingo, self).__init__(**kwdict) you would then need to always use keyword arguments, i.e.: Thingo(arg1=5, arg2="gday", value="fred") is that ok for you ? Chris Foote Inetd Pty Ltd T/A HostExpress Web: http://www.hostexpress.com.au Blog: http://www.hostexpress.com.au/drupal/chris Phone: (08) 8410 4566 From dt-sapug at handcraftedcomputers.com.au Tue Apr 29 06:44:07 2008 From: dt-sapug at handcraftedcomputers.com.au (Daryl Tester) Date: Tue, 29 Apr 2008 14:14:07 +0930 Subject: [sapug] TypeError: __init__() got multiple values for keyword argument 'value' In-Reply-To: <48169AE2.2050400@afoyi.com> References: <48169AE2.2050400@afoyi.com> Message-ID: <4816A797.7000100@handcraftedcomputers.com.au> Darryl Ross wrote: > I'm sure I've worked out how to to this in the past, but the syntax is > escaping me right now. Python version? Under 2.5.1: >>> t = Thingo() >>> t = Thingo(1) >>> t = Thingo(value = 11) >>> -- Regards, Daryl Tester "I hate the Treasury jiggery-pokery / I keep my money in a piggery, locally. It's funny but it's okely-dokely" -- "Do it in style", Keating! From twegener at fastmail.fm Tue Apr 29 06:32:42 2008 From: twegener at fastmail.fm (Tim Wegener) Date: Tue, 29 Apr 2008 14:02:42 +0930 Subject: [sapug] TypeError: __init__() got multiple values for keyword argument 'value' In-Reply-To: <48169AE2.2050400@afoyi.com> References: <48169AE2.2050400@afoyi.com> Message-ID: <1209443563.2631.7.camel@bergamot.wegener.org.au> On Tue, 2008-04-29 at 13:19 +0930, Darryl Ross wrote: > Heya, > > I'm sure I've worked out how to to this in the past, but the syntax is > escaping me right now. > > > class DooHicky(object): > def __init__(self, arg1=None, arg2=None): > pass > > class Thingo(DooHicky): > def __init__(self, value=None, *args, **kwargs): > self.value = value > super(Thingo, self).__init__(self, *args, **kwargs) > > > Basically, I want to pass in an argument to my "Thingo" class which does > not get passed back to the parent constructor. > > Any ideas / pointers? # If you expect the value argument to be unspecified more often than not: class Thingo(DooHicky): def __init__(self, *args, **kwargs): self.value = kwargs.get('value') if self.value is not None: del kwargs['value'] super(Thingo, self).__init__(self, *args, **kwargs) # If you expect the value argument to be specified more often than not: class Thingo(DooHicky): def __init__(self, *args, **kwargs): try: self.value = kwargs.pop('value') except KeyError: pass super(Thingo, self).__init__(self, *args, **kwargs) Both of these will require you to pass value as a keyword argument. You might also want to consider avoiding the use of inheritance. I can't really comment on whether it is desirable to use inheritance here, given the supplied information. Personally I try to avoid inheritance unless it is a really nice fit for the situation. Tim From spam at afoyi.com Tue Apr 29 07:01:45 2008 From: spam at afoyi.com (Darryl Ross) Date: Tue, 29 Apr 2008 14:31:45 +0930 Subject: [sapug] TypeError: __init__() got multiple values for keyword argument 'value' In-Reply-To: <1209443563.2631.7.camel@bergamot.wegener.org.au> References: <48169AE2.2050400@afoyi.com> <1209443563.2631.7.camel@bergamot.wegener.org.au> Message-ID: <4816ABB9.8080401@afoyi.com> Tim Wegener wrote: > # If you expect the value argument to be unspecified more often than not: > class Thingo(DooHicky): > def __init__(self, *args, **kwargs): > self.value = kwargs.get('value') > if self.value is not None: > del kwargs['value'] > super(Thingo, self).__init__(self, *args, **kwargs) This is pretty much exactly what I came up with. > You might also want to consider avoiding the use of inheritance. I > can't really comment on whether it is desirable to use inheritance > here, given the supplied information. Personally I try to avoid > inheritance unless it is a really nice fit for the situation. In this particular instance, I do actually need the inheritance. I'm subclassing a django.newforms.Form. Daryl Tester wrote: > Python version? Under 2.5.1: Hmm, good point, I didn't check that. I was testing under 2.4.3 which is on my CentOS 5.1 server. On my Ubuntu laptop, which has 2.5.1, my sample code works as I was expecting. Thanks guys. Cheers -Darryl