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

View File

@@ -5,11 +5,11 @@ import os
import pathlib
import re
from io import BytesIO
from mimetypes import guess_type
from .buttons import ButtonMethods
from .messageparse import MessageParseMethods
from .users import UserMethods
from .buttons import ButtonMethods
from .. import default
from .. import utils, helpers
from ..tl import types, functions, custom
@@ -23,7 +23,7 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
async def send_file(
self, entity, file, *, caption='', force_document=False,
progress_callback=None, reply_to=None, attributes=None,
thumb=None, allow_cache=True, parse_mode=utils.Default,
thumb=None, allow_cache=True, parse_mode=default,
voice_note=False, video_note=False, buttons=None, silent=None,
**kwargs):
"""
@@ -180,7 +180,7 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
async def _send_album(self, entity, files, caption='',
progress_callback=None, reply_to=None,
parse_mode=utils.Default, silent=None):
parse_mode=default, silent=None):
"""Specialized version of .send_file for albums"""
# We don't care if the user wants to avoid cache, we will use it
# anyway. Why? The cached version will be exactly the same thing