What is more efficient?

placid Bulkan at gmail.com
Sun Feb 18 22:32:59 EST 2007


On Feb 19, 2:17 pm, Karlo Lozovina <_karlo_ at _mosor.net_> wrote:
> Let's say I have a class with few string properties and few integers, and
> a lot of methods defined for that class.
>
> Now if I have hundreds of thousands (or even more) of instances of that
> class - is it more efficient to remove those methods and make them
> separate functions, or it doesn't matter?

What do you mean by efficient. Memory efficient? I would assume that
making them separate functions would use less memory but would you
sacrifice code readability for that (small?) of a memory saving?

Good coding practice suggests that the methods should be bound to
classes.

>
> Thanks...
>
> --
>  _______                                        Karlo Lozovina - Mosor
> |   |   |.-----.-----.     web:http://www.mosor.net|| ICQ#: 10667163
> |       ||  _  |  _  |             Parce mihi domine quia Dalmata sum.
> |__|_|__||_____|_____|



Cheers





More information about the Python-list mailing list