jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776292 )
Change subject: [doc] Add a Lexeme sample with doctest
......................................................................
[doc] Add a Lexeme sample with doctest
Bug: T305302
Change-Id: I25a53a209e04b543f5ff1c9bf174e5216ee91e48
---
M pywikibot/page/_wikibase.py
1 file changed, 20 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index 72820bd..f7180e4 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -1867,7 +1867,26 @@
class LexemePage(WikibasePage):
- """Wikibase entity of type 'lexeme'."""
+ """Wikibase entity of type 'lexeme'.
+
+ Basic usage sample:
+
+ >>> import pywikibot
+ >>> repo = pywikibot.Site('wikidata:wikidata')
+ >>> L2 = pywikibot.LexemePage(repo, 'L2') # create a Lexeme page
+ >>> list(L2.claims.keys()) # access the claims
+ ['P5831', 'P5402']
+ >>> len(L2.forms) # access the forms
+ 2
+ >>> F1 = L2.forms[0] # access the first form
+ >>> list(F1.claims.keys()) # access its claims
+ ['P898']
+ >>> len(L2.senses) # access the senses
+ 1
+ >>> S1 = L2.senses[0] # access the first sense
+ >>> list(S1.claims.keys()) # and its claims
+ ['P5137', 'P5972', 'P2888']
+ """
_cache_attrs = WikibasePage._cache_attrs + (
'lemmas', 'language', 'lexicalCategory', 'forms', 'senses',
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776292
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I25a53a209e04b543f5ff1c9bf174e5216ee91e48
Gerrit-Change-Number: 776292
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]