diff --git a/README.md b/README.md index ac0dc19..9591e36 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,8 @@ explain: - sortingx-1.1.0 is the first version aligned with the `list.sort()` usage method. - sortingx-1.1.1 is the first stable version accelerated with typing_extensions. - sortingx-1.1.2 is the first stable version that has a return value and extends the iterable data types. -- sortingx-1.1.3 is the stable version that complete the typing of local variables and align with `sorted()` usage method. +- sortingx-1.1.3 is the version that complete the typing of local variables and align with `sorted()` usage method. +- sortingx-1.2.0 is the end version of sorting series, which optimize the kernel of generate. ## LICENSE diff --git a/README_release.md b/README_release.md index dfc7be0..42406fc 100644 --- a/README_release.md +++ b/README_release.md @@ -8,5 +8,6 @@ |v1.1.1|`pip install sortingx==1.1.1`|Complete Typing and Accelerate|√| |v1.1.2|`pip install sortingx==1.1.2`|Support More Iterative Data Types|√| |v1.1.3|`pip install sortingx==1.1.3`|Typing Check with More Local Variables|√| +|v1.2.0|`pip install sortingx==1.2.0`|Optimize Generate Function's Kernel|√| \ No newline at end of file diff --git a/sortingx/__init__.py b/sortingx/__init__.py index 3c30850..953e4b5 100644 --- a/sortingx/__init__.py +++ b/sortingx/__init__.py @@ -16,6 +16,6 @@ from .sorting import bubble, insert, shell, heap, quick, merge -__version__ = '1.1.3' +__version__ = '1.2.0' assert sys.version_info >= (3, 7, 0) \ No newline at end of file diff --git a/sortingx/_utils.py b/sortingx/_utils.py index d6c68dc..0412bbf 100644 --- a/sortingx/_utils.py +++ b/sortingx/_utils.py @@ -17,7 +17,7 @@ # Data Generated by Mapping. def generate(__iterable: List[_T], key: Optional[Callable[[_T], SupportsRichComparison]]=None) -> List[_T]: compare: List[_T] = list(map(key, __iterable)) if key != None else __iterable - compare: List[_T] = ([[value] for value in compare] if (compare and not isinstance(compare[0], Iterable)) else compare) if key != None else __iterable + compare: List[_T] = ([[value] for value in compare] if (compare and not isinstance(compare[0], (list, tuple))) else compare) if key != None else __iterable return compare # Redefined Comparison Rules: A High-Speed State Selection Function. diff --git a/sortingx/sorting.py b/sortingx/sorting.py index 5c4c855..845949b 100644 --- a/sortingx/sorting.py +++ b/sortingx/sorting.py @@ -86,7 +86,6 @@ def shell(__iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsRichCom gap: int = int(gap / 3) return __iterable - def heap(__iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsRichComparison]]=None, reverse: bool=False) -> List[_T]: ''' :param __iterable: iterable data.