From 0d5798ff8949dcc132ca006bcaaed44beef1a490 Mon Sep 17 00:00:00 2001 From: jay817 Date: Sat, 5 Oct 2024 21:49:03 -0400 Subject: [PATCH] Update sqlite3-python/README.md --- sqlite3-python/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlite3-python/README.md b/sqlite3-python/README.md index 45b68da..cfc64f0 100644 --- a/sqlite3-python/README.md +++ b/sqlite3-python/README.md @@ -24,7 +24,7 @@ print(list(sql)) # [4] # Cache ```python -class SQL: +class Cache: def __init__(self): import sqlite3 con = sqlite3.connect('fetch.db', isolation_level=None, timeout=1e999) @@ -44,9 +44,9 @@ class SQL: import urllib.request if not (blob := self[url]): self[url] = urllib.request.urlopen(url).read() return self[url] -sql = SQL() -sql.fetch('https://example.com') -list(sql) +cache = Cache() +cache.fetch('https://example.com') +print(list(cache)) ``` # Class