[reportlab-users] Possible bug?
Les
nagylzs at gmail.com
Wed Mar 16 09:18:07 EDT 2022
>
> 2) there is no guarantee that any specific flowable is immutable; to
> support repeated processing we make a shallow copy
> and that works for many cases, but it's not guaranteed if the flowables
> are perverse. Shallow and deep copies may allow
> duplicated usage, but obviously they consume resources.
>
Hello Robin,
I understand the explanation. Just one more question. Nothing is perverse
in my minimal working example, it only contains simple paragraphs. You also
say that generally it is disallowed to use shallow copies for repeated
document generation.
However, BaseDocTemplate.multiBuild also uses a shallow copy:
https://github.com/Distrotech/reportlab/blob/master/src/reportlab/platypus/doctemplate.py#L1042
# work with a copy of the story, since it is consumed
tempStory = story[:]
self.build(tempStory, **buildKwds)
I'm curious - why is it allowed here, and not allowed elsewhere?
Regards,
Laszlo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20220316/e5651acc/attachment.htm>
More information about the reportlab-users
mailing list