On Tue, Jan 06, 2009 at 04:57:02PM -0600, Shawn Walker wrote:

> From what I understand, the re module has an internal cache that 
> automatically does this for re.search and re.match.  Hence why re.purge() 
> exists.

Huh.  So why bother having a re.compile() at all?

>>     done the same way that we have PkgFmri and MatchingPkgFmri classes.
>
> They don't seem to be related.  Those classes appear to be for
> validation, while mine is to extract string components for filtering (not
> really validation).

Ignore the use in client.py -- that just uses the fact that the constraints
for being a MatchingPkgFmri are looser than for being a PkgFmri.  The main
use of the class is in image.py, on line 1806, where they definitely are
used for filtering.

> I would also be concerned about the overhead of using a class like that.

And I'd be wary of using regular expressions when speed is required, too.
Why would a separate class impact performance here?

> However, I could be convinced that this should be a method on the PkgFmri
> class, such as "is_matching_version" (name suggestions?).  Would that
> suffice?

Why would you put a method on PkgFmri and not on Version?

Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to