FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 07-18-2008, 01:56 PM
Ali Polatel
 
Default New objects cpv, pv and version to be used instead of raw strings.

René 'Necoro' Neumann yazmış:
> On Fri, 18 Jul 2008 12:41:52 +0300, Ali Polatel <hawking@gentoo.org> wrote:
> > Hi,
> > Attached patch adds objects cpv, pv and version to portage.versions. This
> > is
> > meant as a thin layer over functions vercmp(), pkgcmp(), pkgsplit() and
> > catpkgsplit().
> > Using these objects instead of the mentioned functions allows us to write
> > cleaner code and remove deprecated stuff like:
> > list.sort(pkgcmp)
> > which won't exist in py3k.
> >
> > Please comment.
>
> Is there a reason, why you are using "__new__" instead of "__init__"?

__new__ is about object creation and the __new__ methods of these
objects create the objects from raw strings.

__init__ is for initializing and customizing objects and that method
is for application writers who want to customize these objects to suit
their needs.

>
> Regards,
> René
>

--
Regards,
Ali Polatel
 

Thread Tools




All times are GMT. The time now is 08:11 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org