Summary
Site.pagereferences() may return the same page twice under certain conditions.
Details
If only_template_inclusion=False and with_template_inclusion=True (the default settings), then pagereferences() combines the results of pagebacklinks() and page_embeddedin().
Since both iterables can contain the same pages, duplicates may occur.
Example
On https://en.wikipedia.org/wiki/Special:WhatLinksHere?target=File%3ABoA+%E2%80%93+Woman.png&namespace=&limit=50, [[File:BoA - Woman.png]] is listed twice:
- once as a backlink with redirects,
- once as a transclusion.
Expected behavior
pagereferences() should not return duplicates (except it is explicitly wanted to prevent huge memory usage)