On 04/20/2010 10:32 AM, Lukas Durfina wrote:
On Mon, 19 Apr 2010 13:20:02 +0200, Miroslav Suchý <msu...@redhat.com>
wrote:

On 04/10/2010 09:27 PM, Lukas Durfina wrote:
So, here is the patch for the backend code.

I have several comments:

backend/server/importlib/debPackage.py:
Why is tagMap and _already_mapped attributes of class? Why not use
attributes of instance and use regular constructor? Then we will not
need createPackage function.


Just curious question:
What is wrong with that way? I have used it, because all other packages
classes (rpmPackage, rpmBinaryPackage, mpmBinaryPackage) are implemented
in that style.

With attributes of class you can do:

#!/usr/bin/python

class A:
        foo = None

a = A()
b = A()
A.foo = 1
print b.foo  # will print 1

Which can be sometime helpfull, but usually you do not want to do this as this can lead to accidental bug.

The fact that we have something dane in past is not excuse. Our code is sometimes worth of rewrite :)


--
Miroslav Suchy
Red Hat Satellite Engineering

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to