Message166511
> I do not think that the purpose of testing is a testing of object.__sizeof__.
> Memory consumption consists of two parts -- memory for C structure (and the
> base object implementation works for this)
Note that object.__sizeof__ does something slightly different, though:
it uses basicsize (which may or may not contain the sizeof() invocation
of the correct C structure), and it considers tp_itemsize (which may or
may not have a correct value).
>
>> I also realize that such tests will be fragile if the the structures
>> change. This is a good thing, IMO: anybody changing the layout of some
>> object should *have* to verify that the size computation is still correct,
>> so it's good that the test breaks if the structures change.
>
> Such tests is too fragile. They force the programmer to write unnecessary code
> in cases when it can be done automatically.
That's not the definition of "fragile", though. What you describe is
that writing the test this way is "tedious" (утомительный); it isn't
(necessarily) "fragile" (хрупкий). I (clearly) disagree that this
approach is "too tedious". |
|
Date |
User |
Action |
Args |
2012-07-26 20:03:49 | loewis | set | recipients:
+ loewis, gregory.p.smith, jcea, mark.dickinson, asvetlov, skrah, meador.inge, serhiy.storchaka |
2012-07-26 20:03:48 | loewis | link | issue15402 messages |
2012-07-26 20:03:48 | loewis | create | |
|