[Django] #28854: django/db/backends/sqlite3/schema.py: type(True)

48 views
Skip to first unread message

Django

unread,
Nov 28, 2017, 9:21:46 AM11/28/17
to django-...@googlegroups.com
#28854: django/db/backends/sqlite3/schema.py: type(True)
------------------------------------------+------------------------
Reporter: Дилян Палаузов | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
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)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28854>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 28, 2017, 10:48:45 AM11/28/17
to django-...@googlegroups.com
#28854: Replace type(True) with bool in django/db/backends/sqlite3/schema.py
-------------------------------------+-------------------------------------

Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Migrations
* stage: Unreviewed => Ready for checkin
* type: Uncategorized => Cleanup/optimization


--
Ticket URL: <https://code.djangoproject.com/ticket/28854#comment:1>

Django

unread,
Nov 28, 2017, 11:00:27 AM11/28/17
to django-...@googlegroups.com
#28854: Replace type(True) with bool in django/db/backends/sqlite3/schema.py
-------------------------------------+-------------------------------------
Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Migrations | Version: 1.11
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"3308085838f520db49f606b72345a301c1cf2a3e" 3308085]:
{{{
#!CommitTicketReference repository=""
revision="3308085838f520db49f606b72345a301c1cf2a3e"
Fixed #28854 -- Replaced type(True) with bool in sqlite's SchemaEditor.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28854#comment:2>

Reply all
Reply to author
Forward
0 new messages