From richardjones at optushome.com.au Fri Mar 10 06:12:06 2006 From: richardjones at optushome.com.au (Richard Jones) Date: Fri, 10 Mar 2006 16:12:06 +1100 Subject: [melbourne-pug] OSDC Annual General Meeting Message-ID: <200603101612.07095.richardjones@optushome.com.au> The OSDC AGM will be held on Wednesday the 22nd of March at 6:30pm The address is: myinternet House Level 8, 14-20 Blackwood St. North Melbourne Come along and help us make the 2006 Open Source Developers' Conference a reality. Nominations may be made by the 15th of March by email to ben at osdc.com.au. Your message should include the name of the person you are nominating, and the position you are nominating them for. The current positions are: - President (Committee Chair) - Vice-President - Secretary - Treasurer & Registration - Sponsorship Manager - Publicity Officer - Location Manager & Catering - Programme Committee Chair - Keynote Chair - Paper Chair - Promotions This will be our third year, and we are now in a position to consolidate the gains of the last two conferences, and put on our best conference yet. We are delighted with the increased international awareness of the OSDC movement, now that OSDC Israel is underway and OSDC::Taiwan is planned for April this year. Everyone is welcome to the AGM. This is a grass roots effort and we need all the help we can get. Regards, Simon Taylor OSDC From birchb at anz.com Wed Mar 15 12:02:43 2006 From: birchb at anz.com (Birch, Bill) Date: Wed, 15 Mar 2006 22:02:43 +1100 Subject: [melbourne-pug] New list member Message-ID: Hi, Having just joined this mailing list, I thought I'd introduce myself. I'm currently using Python 2.4 at work to convert images and auto-generate test cases for a Java application. It has been a very pleasant experience using Python. Although I keep forgetting the : Outside work I'm particularly interested in "structural subtyping" and have started a modest project to add some of that to Python. Looking forward to meeting some local Pythonistas! Bill Birch From brucedecoy-post at yahoo.com.au Sun Mar 19 12:26:48 2006 From: brucedecoy-post at yahoo.com.au (brucedecoy-post at yahoo.com.au) Date: Sun, 19 Mar 2006 22:26:48 +1100 (EST) Subject: [melbourne-pug] New list member Message-ID: <20060319112648.47943.qmail@web60219.mail.yahoo.com> Bill Birch wrote: > Hi, > > Having just joined this mailing list, I thought I'd > introduce myself. I'm currently using Python 2.4 at > work to convert images and auto-generate test cases > for a Java application. It has been a very pleasant > experience using Python. Although I keep forgetting > the : You get used to it after a little while: > Outside work I'm particularly interested > in "structural subtyping" and have started a modest > project to add some of that to Python. What do you mean by "structural subtyping"? > Looking forward to meeting some local Pythonistas! We haven't had a get together for quite a while. Anyone interested in meeting to share some experiences? > > Bill Birch Bruce ____________________________________________________ On Yahoo!7 Music: Create your own personalised radio station. http://au.launch.yahoo.com/ From birchb at anz.com Tue Mar 21 08:03:42 2006 From: birchb at anz.com (Birch, Bill) Date: Tue, 21 Mar 2006 18:03:42 +1100 Subject: [melbourne-pug] structual subtyping Message-ID: Hi, You asked: What do you mean by "structural subtyping"? In short if an object looks like another object it's a structural subtype. Given a type T which consists of things with four legs, then dogs and tables are subtypes of T because they have four legs. So if I can see the internal structure of an object I can subytype this way. For OO-encaspulated languages the subtyping is limited to the public methods. Given a type C which consists of things which respond to the command 'draw', both an Artist and a Cowboy are subtyes of C. Note the semantic dissonance ;-) I'm playing with the first kind, ie subtyping of composite, un-named, un-encapsulated objects (which may have been read in as input). The wikipedia definition http://en.wikipedia.org/wiki/Structural_subtyping is here. Cheers, Bill -----Original Message----- From: melbourne-pug-bounces+birchb=anz.com at python.org [mailto:melbourne-pug-bounces+birchb=anz.com at python.org]On Behalf Of melbourne-pug-request at python.org Sent: Monday, 20 March 2006 10:00 PM To: melbourne-pug at python.org Subject: melbourne-pug Digest, Vol 10, Issue 3 Send melbourne-pug mailing list submissions to melbourne-pug at python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/melbourne-pug or, via email, send a message with subject or body 'help' to melbourne-pug-request at python.org You can reach the person managing the list at melbourne-pug-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of melbourne-pug digest..." Today's Topics: 1. Re: New list member (brucedecoy-post at yahoo.com.au) ---------------------------------------------------------------------- Message: 1 Date: Sun, 19 Mar 2006 22:26:48 +1100 (EST) From: Subject: Re: [melbourne-pug] New list member To: melbourne-pug at python.org Message-ID: <20060319112648.47943.qmail at web60219.mail.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Bill Birch wrote: > Hi, > > Having just joined this mailing list, I thought I'd > introduce myself. I'm currently using Python 2.4 at > work to convert images and auto-generate test cases > for a Java application. It has been a very pleasant > experience using Python. Although I keep forgetting > the : You get used to it after a little while: > Outside work I'm particularly interested > in "structural subtyping" and have started a modest > project to add some of that to Python. What do you mean by "structural subtyping"? > Looking forward to meeting some local Pythonistas! We haven't had a get together for quite a while. Anyone interested in meeting to share some experiences? > > Bill Birch Bruce ____________________________________________________ On Yahoo!7 Music: Create your own personalised radio station. http://au.launch.yahoo.com/ ------------------------------ _______________________________________________ melbourne-pug mailing list melbourne-pug at python.org http://mail.python.org/mailman/listinfo/melbourne-pug End of melbourne-pug Digest, Vol 10, Issue 3 ******************************************** From brucedecoy-post at yahoo.com.au Tue Mar 21 12:47:37 2006 From: brucedecoy-post at yahoo.com.au (brucedecoy-post at yahoo.com.au) Date: Tue, 21 Mar 2006 22:47:37 +1100 (EST) Subject: [melbourne-pug] structural subtyping In-Reply-To: Message-ID: <20060321114737.13910.qmail@web60222.mail.yahoo.com> Bill wrote: > > Hi, > > You asked: > What do you mean by "structural subtyping"? > > In short if an object looks like another object it's > a structural subtype. Given a type T which consists > of things with four legs, then dogs and tables are > subtypes of T because they have four legs. So if I > can see the internal structure of an object I can > subtype this way. Interesting. Are you wanting something like Java interfaces, but without the need to explicitly implement the interface? Guido blogged about adding an interface concept to Python recently (around the start of the year?) and raised a bit of a storm. Python's "duck typing" gives you all the flexibility you need, so I'm guessing you're wanting to make some guarantees about the types of objects that are passed to a function. Is that right? IMO, system tests and unit tests nicely balance the flexibility of dynamic typing, no const, unchecked exceptions etc... I would possibly use an interface type occasionally if there was one, but that would typically be when I was writing a published API. Regards, Bruce > For OO-encaspulated languages the subtyping is > limited to the public methods. Given a type C which > consists of things which respond to the command > 'draw', both an Artist and a Cowboy are subtyes of > C. Note the semantic dissonance ;-) > > I'm playing with the first kind, ie subtyping of > composite, un-named, un-encapsulated objects (which > may have been read in as input). > > The wikipedia definition > http://en.wikipedia.org/wiki/Structural_subtyping is > here. > > Cheers, > Bill > > ____________________________________________________ On Yahoo!7 Messenger - Make free PC-to-PC calls to your friends overseas. http://au.messenger.yahoo.com From birchb at anz.com Tue Mar 21 23:45:08 2006 From: birchb at anz.com (Birch, Bill) Date: Wed, 22 Mar 2006 09:45:08 +1100 Subject: [melbourne-pug] structural subtyping Message-ID: I'm not really into declarative interfaces for Python, duck typing works fine. Too many people believe that classes are "factories for creating objects" whereas they ought to be viewed as collections of objects with the same attributes. The problem I am working on is "first construct your object, then figure out which classes it belongs to." This is more in keeping with the dynamic language world view. Here's a code example: >>> it = Shape.classify( [1,2] ) >>> typesOf(it) obj: [1, 2] generalized: [, ] super under: subshape of: subshape of: subshape of: Here I have created an composite object [1,2] and I have asked the system what classes it belongs to. It knows about some classes which I declared previously: class Number : __metaclass__ = Shape shape = Either(int, float, long) # one of either int or float and from shape import * __metaclass__ = Shape class Cartesian : shape = (Number, Number) # two numbers class MyComplex : shape = (Number, Number) # two numbers def real() : return self[0] def imaginary() : return self[1] class BarGraph : shape = (Number, etc) # some numbers def plot() : for r in self: print r[0], "*"*r[1] In the fullness of time I should also handle interface definitions as you say. For now I'm mostly focussed on compound objects made up of collections. My next challenge is get Classify() to dynamically re-write the class and superclasses of [1,2]. so that "it.plot()" work. Any hints? Cheers, Bill -----Original Message----- From: melbourne-pug-bounces at python.org [mailto:melbourne-pug-bounces at python.org]On Behalf Of brucedecoy-post at yahoo.com.au Sent: Tuesday, 21 March 2006 10:48 PM To: melbourne-pug at python.org Subject: Re: [melbourne-pug] structural subtyping Bill wrote: > > Hi, > > You asked: > What do you mean by "structural subtyping"? > > In short if an object looks like another object it's > a structural subtype. Given a type T which consists > of things with four legs, then dogs and tables are > subtypes of T because they have four legs. So if I > can see the internal structure of an object I can > subtype this way. Interesting. Are you wanting something like Java interfaces, but without the need to explicitly implement the interface? Guido blogged about adding an interface concept to Python recently (around the start of the year?) and raised a bit of a storm. Python's "duck typing" gives you all the flexibility you need, so I'm guessing you're wanting to make some guarantees about the types of objects that are passed to a function. Is that right? IMO, system tests and unit tests nicely balance the flexibility of dynamic typing, no const, unchecked exceptions etc... I would possibly use an interface type occasionally if there was one, but that would typically be when I was writing a published API. Regards, Bruce > For OO-encaspulated languages the subtyping is > limited to the public methods. Given a type C which > consists of things which respond to the command > 'draw', both an Artist and a Cowboy are subtyes of > C. Note the semantic dissonance ;-) > > I'm playing with the first kind, ie subtyping of > composite, un-named, un-encapsulated objects (which > may have been read in as input). > > The wikipedia definition > http://en.wikipedia.org/wiki/Structural_subtyping is > here. > > Cheers, > Bill > > ____________________________________________________ On Yahoo!7 Messenger - Make free PC-to-PC calls to your friends overseas. http://au.messenger.yahoo.com _______________________________________________ melbourne-pug mailing list melbourne-pug at python.org http://mail.python.org/mailman/listinfo/melbourne-pug