Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/794791 )
Change subject: [IMPR] Improve pywikibot.Site() documentation ......................................................................
[IMPR] Improve pywikibot.Site() documentation
Change-Id: I04eafbae47cd32bb34a9eabbc5084bf9acaae4bb --- M pywikibot/__init__.py 1 file changed, 6 insertions(+), 6 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 1df2fb1..e6231e6 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -1132,8 +1132,8 @@
site = pywikibot.Site('wikisource:fr')
- :Note: An already created site is cached an a new variable points to - the same object if interface, family, code and user are equal: + .. note:: An already created site is cached an a new variable points + to the same object if interface, family, code and user are equal:
>>> import pywikibot >>> site_1 = pywikibot.Site('wikisource:fr') @@ -1143,11 +1143,11 @@ >>> site_1 APISite("fr", "wikisource")
- ``APISite`` is the default interface. Refer :py:obj:`pywikibot.site` for - other interface types. + :class:`APISite<pywikibot.site._apisite.APISite>` is the default + interface. Refer :py:obj:`pywikibot.site` for other interface types.
- **Never create a site object via interface class directly.** - Always use this factory method. + .. warning:: Never create a site object via interface class directly. + Always use this factory method.
.. versionchanged:: 7.3 Short creation if site code is equal to family name like