Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python3-only Django project - the benefits

Python3-only Django project - the benefits

My lightning talk from EuroPython 2014.

Zbigniew Siciarz

July 23, 2014
Tweet

More Decks by Zbigniew Siciarz

Other Decks in Programming

Transcript

  1. None
  2. None
  3. None
  4. None
  5. # -*- coding: utf-8 -*-

  6. # -*- coding: utf-8 -*-

  7. from __future__ import (division, print_function, absolute_import, unicode_literals)

  8. from __future__ import (division, print_function, absolute_import, unicode_literals)

  9. class DocumentForm(forms.Form): def __init__(self, *args, **kwargs): super(DocumentForm, self).__init__(*args, **kwargs) #

    do stuff... class IndexView(TemplateView): def get_context_data(self, **kwargs): data = super(IndexView, self).get_context_data(**kwargs) data["foo"] = "bar" return data
  10. class DocumentForm(forms.Form): def __init__(self, *args, **kwargs): super(DocumentForm, self).__init__(*args, **kwargs) #

    do stuff... class IndexView(TemplateView): def get_context_data(self, **kwargs): data = super(IndexView, self).get_context_data(**kwargs) data["foo"] = "bar" return data
  11. def lazy_id_collector(): yield from ItemA.objects.values("id") yield from ItemB.objects.values("id") yield from

    ItemC.objects.values("id")
  12. import faulthandler faulthandler.enable()

  13. pip install mock from mock import patch from unittest.mock import

    patch
  14. None
  15. None
  16. None