Create a default module to use as a sentinel value

This looks better in the documentation than utils.Default,
cleans the utils with specific stuff like this, and users
may use it more easily.
This commit is contained in:
Lonami Exo
2018-10-05 14:20:50 +02:00
parent 0fcc2e5e52
commit d392939018
8 changed files with 26 additions and 29 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
import hashlib
from .. import functions, types
from ... import utils
from ... import default, utils
class InlineBuilder:
@@ -55,7 +55,7 @@ class InlineBuilder:
async def article(
self, title, description=None,
*, url=None, thumb=None, content=None,
id=None, text=None, parse_mode=utils.Default, link_preview=True,
id=None, text=None, parse_mode=default, link_preview=True,
geo=None, period=60, contact=None, game=False, buttons=None
):
"""
@@ -105,7 +105,7 @@ class InlineBuilder:
async def photo(
self, file, *, id=None,
text=None, parse_mode=utils.Default, link_preview=True,
text=None, parse_mode=default, link_preview=True,
geo=None, period=60, contact=None, game=False, buttons=None
):
"""
@@ -144,7 +144,7 @@ class InlineBuilder:
self, file, title=None, *, description=None, type=None,
mime_type=None, attributes=None, force_document=False,
voice_note=False, video_note=False, use_cache=True, id=None,
text=None, parse_mode=utils.Default, link_preview=True,
text=None, parse_mode=default, link_preview=True,
geo=None, period=60, contact=None, game=False, buttons=None
):
"""
@@ -219,7 +219,7 @@ class InlineBuilder:
async def game(
self, short_name, *, id=None,
text=None, parse_mode=utils.Default, link_preview=True,
text=None, parse_mode=default, link_preview=True,
geo=None, period=60, contact=None, game=False, buttons=None
):
"""
@@ -247,7 +247,7 @@ class InlineBuilder:
async def _message(
self, *,
text=None, parse_mode=utils.Default, link_preview=True,
text=None, parse_mode=default, link_preview=True,
geo=None, period=60, contact=None, game=False, buttons=None
):
if sum(1 for x in (text, geo, contact, game) if x) != 1: