#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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.6791858c73288bb8dd8e4dbe1d6954f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to