- UTF-8 default encoding: https://docs.python.org/3.15/whatsnew/3.15.html#other-language-changes
$ python -W ignore:/<message_regex>/: https://docs.python.org/3.15/using/cmdline.html#cmdoption-Wbytearray.take_bytes(): https://docs.python.org/3.15/library/stdtypes.html#bytearray.take_bytes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare different stdlib methods to read an UTF-8 encoded text file.""" | |
| import codecs | |
| import io | |
| import os | |
| import pathlib | |
| import time | |
| TEST_FILE = pathlib.Path('read_text.txt') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Benchmark FCA concepts lattice generation with bob_ross.csv.""" | |
| from collections.abc import Iterable, Iterator, Sequence | |
| import csv | |
| import os | |
| import pathlib | |
| import time | |
| from typing import NamedTuple | |
| import urllib.request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare different brute-force FCA concept generation methods.""" | |
| from collections.abc import Iterator, Sequence | |
| from itertools import combinations, compress | |
| import time | |
| import gmpy2 | |
| import numpy as np | |
| OBJECTS = ('1s', '1de', '1pe', '1di', '1pi', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare two ways to iterate over subdirectories of a tree.""" | |
| from collections.abc import Iterator | |
| import os | |
| import platform | |
| import time | |
| START_DIR = 'c:\\Users' if platform.system() == 'Windows' else '/usr' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare four ways to iterate over a large binary file in chunks.""" | |
| import functools | |
| import hashlib | |
| import mmap | |
| import os | |
| import pathlib | |
| import shutil | |
| import time | |
| import types |
NewerOlder