Update sqlite3-python/README.md
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user