A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-August/028350.html below:

[Python-Dev] type categories

[Python-Dev] type categoriesOren Tirosh oren-py-d@hishome.net
Tue, 27 Aug 2002 00:51:51 +0300
On Mon, Aug 26, 2002 at 05:17:28PM -0400, Andrew Koenig wrote:
> >> Remember that one thing I consider important is the ability to claim
> >> that classes written by others belong to a category defined by me.  I do not
> >> want to have to modify those classes in order to do so.
> 
> Oren> How about union(int, long, float, has_marker("TotallyOrdered")) ?
> 
> How about it?  There is still the question of how to make such claims.
> 
> Oren> Inheritance of implementation also inherits the form (methods
> Oren> and call signatures). If you don't go out of your way to modify
> Oren> it a subclass will usually also be a subcategory so this should
> Oren> be pretty transparent most of the time.
> 
> Right.  So how do you define a subclass that you do not want to be
> a subcategory?

If you make an incompatible change to a method call signature it will just
happen by itself. If that's what you meant - good. It that wasn't what you
meant this serves as a form of error checking.  

It gets harder if you want to remove a method or marker. The problem is 
that there is currently no way to mask inherited attributes. This will
require either a language extension that will allow you to del them or 
using some other convention for this purpose.

	Oren




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4