Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Portage Developer (http://www.linux-archive.org/gentoo-portage-developer/)
-   -   New objects cpv, pv and version to be used instead of raw strings. (http://www.linux-archive.org/gentoo-portage-developer/127178-new-objects-cpv-pv-version-used-instead-raw-strings.html)

Ali Polatel 07-18-2008 01:56 PM

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


All times are GMT. The time now is 06:03 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.