Update sqlite3-python/README.md

This commit is contained in:
2024-10-05 21:49:03 -04:00
parent 0316785878
commit 0d5798ff89

View File

@@ -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