Opened 7 years ago
Closed 7 years ago
#28854 closed Cleanup/optimization (fixed)
Replace type(True) with bool in django/db/backends/sqlite3/schema.py
Reported by: | Дилян Палаузов | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Why does the code below use type(True) instead of bool?
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -37,7 +37,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): except sqlite3.ProgrammingError: pass # Manual emulation of SQLite parameter quoting - if isinstance(value, type(True)): + if isinstance(value, bool): return str(int(value)) if isinstance(value, (Decimal, float, int)): return str(value)
Change History (2)
comment:1 by , 7 years ago
Component: | Uncategorized → Migrations |
---|---|
Summary: | django/db/backends/sqlite3/schema.py: type(True) → Replace type(True) with bool in django/db/backends/sqlite3/schema.py |
Triage Stage: | Unreviewed → Ready for checkin |
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 3308085: