Kaydet (Commit) cd92f375 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Issue 10899: Remove function type annotations from the stdlib

üst 3c94024c
...@@ -345,7 +345,7 @@ class _LoaderBasics: ...@@ -345,7 +345,7 @@ class _LoaderBasics:
class SourceLoader(_LoaderBasics): class SourceLoader(_LoaderBasics):
def path_mtime(self, path:str) -> int: def path_mtime(self, path):
"""Optional method that returns the modification time for the specified """Optional method that returns the modification time for the specified
path. path.
...@@ -354,7 +354,7 @@ class SourceLoader(_LoaderBasics): ...@@ -354,7 +354,7 @@ class SourceLoader(_LoaderBasics):
""" """
raise NotImplementedError raise NotImplementedError
def set_data(self, path:str, data:bytes) -> None: def set_data(self, path, data):
"""Optional method which writes data to a file path. """Optional method which writes data to a file path.
Implementing this method allows for the writing of bytecode files. Implementing this method allows for the writing of bytecode files.
......
...@@ -18,7 +18,7 @@ class Loader(metaclass=abc.ABCMeta): ...@@ -18,7 +18,7 @@ class Loader(metaclass=abc.ABCMeta):
"""Abstract base class for import loaders.""" """Abstract base class for import loaders."""
@abc.abstractmethod @abc.abstractmethod
def load_module(self, fullname:str) -> types.ModuleType: def load_module(self, fullname):
"""Abstract method which when implemented should load a module.""" """Abstract method which when implemented should load a module."""
raise NotImplementedError raise NotImplementedError
...@@ -28,7 +28,7 @@ class Finder(metaclass=abc.ABCMeta): ...@@ -28,7 +28,7 @@ class Finder(metaclass=abc.ABCMeta):
"""Abstract base class for import finders.""" """Abstract base class for import finders."""
@abc.abstractmethod @abc.abstractmethod
def find_module(self, fullname:str, path:[str]=None) -> Loader: def find_module(self, fullname, path=None):
"""Abstract method which when implemented should find a module.""" """Abstract method which when implemented should find a module."""
raise NotImplementedError raise NotImplementedError
...@@ -47,7 +47,7 @@ class ResourceLoader(Loader): ...@@ -47,7 +47,7 @@ class ResourceLoader(Loader):
""" """
@abc.abstractmethod @abc.abstractmethod
def get_data(self, path:str) -> bytes: def get_data(self, path):
"""Abstract method which when implemented should return the bytes for """Abstract method which when implemented should return the bytes for
the specified path.""" the specified path."""
raise NotImplementedError raise NotImplementedError
...@@ -63,19 +63,19 @@ class InspectLoader(Loader): ...@@ -63,19 +63,19 @@ class InspectLoader(Loader):
""" """
@abc.abstractmethod @abc.abstractmethod
def is_package(self, fullname:str) -> bool: def is_package(self, fullname):
"""Abstract method which when implemented should return whether the """Abstract method which when implemented should return whether the
module is a package.""" module is a package."""
raise NotImplementedError raise NotImplementedError
@abc.abstractmethod @abc.abstractmethod
def get_code(self, fullname:str) -> types.CodeType: def get_code(self, fullname):
"""Abstract method which when implemented should return the code object """Abstract method which when implemented should return the code object
for the module""" for the module"""
raise NotImplementedError raise NotImplementedError
@abc.abstractmethod @abc.abstractmethod
def get_source(self, fullname:str) -> str: def get_source(self, fullname):
"""Abstract method which should return the source code for the """Abstract method which should return the source code for the
module.""" module."""
raise NotImplementedError raise NotImplementedError
...@@ -94,7 +94,7 @@ class ExecutionLoader(InspectLoader): ...@@ -94,7 +94,7 @@ class ExecutionLoader(InspectLoader):
""" """
@abc.abstractmethod @abc.abstractmethod
def get_filename(self, fullname:str) -> str: def get_filename(self, fullname):
"""Abstract method which should return the value that __file__ is to be """Abstract method which should return the value that __file__ is to be
set to.""" set to."""
raise NotImplementedError raise NotImplementedError
...@@ -117,11 +117,11 @@ class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader): ...@@ -117,11 +117,11 @@ class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
""" """
def path_mtime(self, path:str) -> int: def path_mtime(self, path):
"""Return the modification time for the path.""" """Return the modification time for the path."""
raise NotImplementedError raise NotImplementedError
def set_data(self, path:str, data:bytes) -> None: def set_data(self, path, data):
"""Write the bytes to the path (if possible). """Write the bytes to the path (if possible).
Any needed intermediary directories are to be created. If for some Any needed intermediary directories are to be created. If for some
...@@ -170,7 +170,7 @@ class PyLoader(SourceLoader): ...@@ -170,7 +170,7 @@ class PyLoader(SourceLoader):
raise NotImplementedError raise NotImplementedError
@abc.abstractmethod @abc.abstractmethod
def source_path(self, fullname:str) -> object: def source_path(self, fullname):
"""Abstract method which when implemented should return the path to the """Abstract method which when implemented should return the path to the
source code for the module.""" source code for the module."""
raise NotImplementedError raise NotImplementedError
...@@ -279,19 +279,19 @@ class PyPycLoader(PyLoader): ...@@ -279,19 +279,19 @@ class PyPycLoader(PyLoader):
return code_object return code_object
@abc.abstractmethod @abc.abstractmethod
def source_mtime(self, fullname:str) -> int: def source_mtime(self, fullname):
"""Abstract method which when implemented should return the """Abstract method which when implemented should return the
modification time for the source of the module.""" modification time for the source of the module."""
raise NotImplementedError raise NotImplementedError
@abc.abstractmethod @abc.abstractmethod
def bytecode_path(self, fullname:str) -> object: def bytecode_path(self, fullname):
"""Abstract method which when implemented should return the path to the """Abstract method which when implemented should return the path to the
bytecode for the module.""" bytecode for the module."""
raise NotImplementedError raise NotImplementedError
@abc.abstractmethod @abc.abstractmethod
def write_bytecode(self, fullname:str, bytecode:bytes) -> bool: def write_bytecode(self, fullname, bytecode):
"""Abstract method which when implemented should attempt to write the """Abstract method which when implemented should attempt to write the
bytecode for the module, returning a boolean representing whether the bytecode for the module, returning a boolean representing whether the
bytecode was written or not.""" bytecode was written or not."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment