Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Lib/_bootlocale.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Don't import directly from third-party code; use the `locale` module instead!
"""

__lazy_module__ = True
import sys
import _locale

Expand Down
1 change: 1 addition & 0 deletions Lib/_collections_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Unit tests are in test_collections.
"""

__lazy_module__ = True
from abc import ABCMeta, abstractmethod
import sys

Expand Down
2 changes: 2 additions & 0 deletions Lib/_compat_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Python 3 for the pickle module. This needed to make pickle streams
# generated with Python 2 loadable by Python 3.

__lazy_module__ = True

# This is a copy of lib2to3.fixes.fix_imports.MAPPING. We cannot import
# lib2to3 and use the mapping defined there, because lib2to3 uses pickle.
# Thus, this could cause the module to be imported recursively.
Expand Down
2 changes: 2 additions & 0 deletions Lib/_compression.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Internal classes used by the gzip, lzma and bz2 modules"""

__lazy_module__ = True

import io


Expand Down
2 changes: 2 additions & 0 deletions Lib/_sitebuiltins.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# Note this means this module should also avoid keep things alive in its
# globals.

__lazy_module__ = True

import sys

class Quitter(object):
Expand Down
2 changes: 2 additions & 0 deletions Lib/_weakrefset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.

__lazy_module__ = True

from _weakref import ref

__all__ = ['WeakSet']
Expand Down
1 change: 1 addition & 0 deletions Lib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"""Abstract Base Classes (ABCs) according to PEP 3119."""

__lazy_module__ = True

def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Expand Down
2 changes: 2 additions & 0 deletions Lib/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
still considered an implementation detail.)
"""

__lazy_module__ = True

__version__ = '1.1'
__all__ = [
'ArgumentParser',
Expand Down
2 changes: 2 additions & 0 deletions Lib/base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere

__lazy_module__ = True

import re
import struct
import binascii
Expand Down
2 changes: 2 additions & 0 deletions Lib/bisect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Bisection algorithms."""

__lazy_module__ = True

def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.

Expand Down
2 changes: 2 additions & 0 deletions Lib/bz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
(de)compression, and functions for one-shot (de)compression.
"""

__lazy_module__ = True

__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor",
"open", "compress", "decompress"]

Expand Down
2 changes: 2 additions & 0 deletions Lib/codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

"""

__lazy_module__ = True

import builtins
import sys

Expand Down
2 changes: 2 additions & 0 deletions Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

'''

__lazy_module__ = True

__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict', 'ChainMap']

Expand Down
1 change: 1 addition & 0 deletions Lib/collections/abc.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__lazy_module__ = True
from _collections_abc import *
from _collections_abc import __all__
1 change: 1 addition & 0 deletions Lib/contextlib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for with-statement contexts. See PEP 343."""
__lazy_module__ = True
import abc
import sys
import _collections_abc
Expand Down
2 changes: 2 additions & 0 deletions Lib/copyreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
C, not for instances of user-defined classes.
"""

__lazy_module__ = True

__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]

Expand Down
21 changes: 12 additions & 9 deletions Lib/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
time zone and DST data sources.
"""

__lazy_module__ = True

import time as _time
import math as _math

Expand Down Expand Up @@ -2414,15 +2416,16 @@ def _name_from_offset(delta):
pass
else:
# Clean up unused names
del (_DAYNAMES, _DAYS_BEFORE_MONTH, _DAYS_IN_MONTH, _DI100Y, _DI400Y,
_DI4Y, _EPOCH, _MAXORDINAL, _MONTHNAMES, _build_struct_time,
_check_date_fields, _check_int_field, _check_time_fields,
_check_tzinfo_arg, _check_tzname, _check_utc_offset, _cmp, _cmperror,
_date_class, _days_before_month, _days_before_year, _days_in_month,
_format_time, _format_offset, _is_leap, _isoweek1monday, _math,
_ord2ymd, _time, _time_class, _tzinfo_class, _wrap_strftime, _ymd2ord,
_divide_and_round, _parse_isoformat_date, _parse_isoformat_time,
_parse_hh_mm_ss_ff)
if 0:
del (_DAYNAMES, _DAYS_BEFORE_MONTH, _DAYS_IN_MONTH, _DI100Y, _DI400Y,
_DI4Y, _EPOCH, _MAXORDINAL, _MONTHNAMES, _build_struct_time,
_check_date_fields, _check_int_field, _check_time_fields,
_check_tzinfo_arg, _check_tzname, _check_utc_offset, _cmp, _cmperror,
_date_class, _days_before_month, _days_before_year, _days_in_month,
_format_time, _format_offset, _is_leap, _isoweek1monday, _math,
_ord2ymd, _time, _time_class, _tzinfo_class, _wrap_strftime, _ymd2ord,
_divide_and_round, _parse_isoformat_date, _parse_isoformat_time,
_parse_hh_mm_ss_ff)
# XXX Since import * above excludes names that start with _,
# docstring does not get overwritten. In the future, it may be
# appropriate to maintain a single module level docstring and
Expand Down
2 changes: 2 additions & 0 deletions Lib/difflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
For producing HTML side by side comparison with change highlights.
"""

__lazy_module__ = True

__all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher',
'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
'unified_diff', 'diff_bytes', 'HtmlDiff', 'Match']
Expand Down
2 changes: 2 additions & 0 deletions Lib/dis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Disassembler of Python byte code into mnemonics."""

__lazy_module__ = True

import sys
import types
import collections
Expand Down
2 changes: 2 additions & 0 deletions Lib/email/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
]


from . import quoprimime


# Some convenience routines. Don't import Parser and Message as side-effects
# of importing email since those cascadingly import most of the rest of the
Expand Down
2 changes: 2 additions & 0 deletions Lib/email/base64mime.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
module.
"""

__lazy_module__ = True

__all__ = [
'body_decode',
'body_encode',
Expand Down
2 changes: 2 additions & 0 deletions Lib/email/charset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org

__lazy_module__ = True

__all__ = [
'Charset',
'add_alias',
Expand Down
3 changes: 3 additions & 0 deletions Lib/email/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# Author: Barry Warsaw
# Contact: email-sig@python.org


"""Encodings and related functions."""

__lazy_module__ = True

__all__ = [
'encode_7or8bit',
'encode_base64',
Expand Down
1 change: 1 addition & 0 deletions Lib/email/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

"""email package exception classes."""

__lazy_module__ = True

class MessageError(Exception):
"""Base class for errors in the email package."""
Expand Down
2 changes: 2 additions & 0 deletions Lib/email/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

"""Header encoding and decoding functionality."""

__lazy_module__ = True

__all__ = [
'Header',
'decode_header',
Expand Down
2 changes: 2 additions & 0 deletions Lib/email/quoprimime.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
wrapping issues, use the email.header module.
"""

__lazy_module__ = True

__all__ = [
'body_decode',
'body_encode',
Expand Down
1 change: 1 addition & 0 deletions Lib/encodings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"""#"

#__lazy_module__ = True
import codecs
import sys
from . import aliases
Expand Down
3 changes: 3 additions & 0 deletions Lib/encodings/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
aliases have also been added.

"""

__lazy_module__ = True

aliases = {

# Please keep this list sorted alphabetically by value !
Expand Down
3 changes: 3 additions & 0 deletions Lib/encodings/latin_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""

__lazy_module__ = True

import codecs

### Codec APIs
Expand Down
3 changes: 3 additions & 0 deletions Lib/encodings/utf_8.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""

__lazy_module__ = True

import codecs

### Codec APIs
Expand Down
9 changes: 4 additions & 5 deletions Lib/enum.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

#__lazy_module__ = True

import sys
from types import MappingProxyType, DynamicClassAttribute

# try _collections first to reduce startup cost
try:
from _collections import OrderedDict
except ImportError:
from collections import OrderedDict
from collections import OrderedDict


__all__ = [
Expand Down
3 changes: 3 additions & 0 deletions Lib/fnmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
The function translate(PATTERN) returns a regular expression
corresponding to PATTERN. (It does not compile it.)
"""

__lazy_module__ = True

import os
import posixpath
import re
Expand Down
2 changes: 2 additions & 0 deletions Lib/functools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# Copyright (C) 2006-2013 Python Software Foundation.
# See C source code for _functools credits/copyright

__lazy_module__ = True

__all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES',
'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial',
'partialmethod', 'singledispatch']
Expand Down
3 changes: 3 additions & 0 deletions Lib/genericpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""

__lazy_module__ = True

import os
import stat

Expand Down
1 change: 1 addition & 0 deletions Lib/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# - Support Solaris .mo file formats. Unfortunately, we've been unable to
# find this format documented anywhere.

__lazy_module__ = True

import locale
import os
Expand Down
2 changes: 2 additions & 0 deletions Lib/gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# based on Andrew Kuchling's minigzip.py distributed with the zlib module

__lazy_module__ = True

import struct, sys, time, os
import zlib
import builtins
Expand Down
7 changes: 5 additions & 2 deletions Lib/hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Licensed to PSF under a Contributor Agreement.
#

__lazy_module__ = True

__doc__ = """hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
Expand Down Expand Up @@ -247,5 +249,6 @@ def prf(msg, inner=inner, outer=outer):


# Cleanup locals()
del __always_supported, __func_name, __get_hash
del __py_new, __hash_new, __get_openssl_constructor
if 0:
del __always_supported, __func_name, __get_hash
del __py_new, __hash_new, __get_openssl_constructor
2 changes: 2 additions & 0 deletions Lib/heapq.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
From all times, sorting has always been a Great Art! :-)
"""

__lazy_module__ = True

__all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge',
'nlargest', 'nsmallest', 'heappushpop']

Expand Down
2 changes: 2 additions & 0 deletions Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

# This module is in the public domain. No warranties.

__lazy_module__ = True

__author__ = ('Ka-Ping Yee <ping@lfw.org>',
'Yury Selivanov <yselivanov@sprymix.com>')

Expand Down
2 changes: 2 additions & 0 deletions Lib/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"""
# New I/O library conforming to PEP 3116.

__lazy_module__ = True

__author__ = ("Guido van Rossum <guido@python.org>, "
"Mike Verdone <mike.verdone@gmail.com>, "
"Mark Russell <mark.russell@zen.co.uk>, "
Expand Down
Loading