Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-17 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
-+-
 Reporter:  Collin Anderson  |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  HTTP handling|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson ):

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


Comment:

 In [changeset:"2a5d2eefc751be012fdebd75d8177c42bf5a76fc" 2a5d2ee]:
 {{{
 #!CommitTicketReference repository=""
 revision="2a5d2eefc751be012fdebd75d8177c42bf5a76fc"
 Fixed #33683 -- Document HttpResponseBase and allow import from
 django.http
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180d1002367-f17d6bb4-4922-4733-9651-1b49f0e2d872-00%40eu-central-1.amazonses.com.


Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-17 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
-+-
 Reporter:  Collin Anderson  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  HTTP handling|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180d0ff4979-5d6a1645-745f-4ea2-b7c8-a9a2a2990d13-00%40eu-central-1.amazonses.com.


Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-10 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
--+
 Reporter:  Collin Anderson   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  HTTP handling |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Collin Anderson):

 Ahh, I think. see what you're saying now. Though yeah I think it's
 ultimately up to the stubs projects to figure out what sort of type
 framework to use (protocol vs implementation, etc), unless we do actually
 want type annotations in Django. But maybe there's a chance documenting
 `HttpResponseBase` pushes the type-checking ecosystem in a direction we
 don't necessarily want to go, so I could see holding off on documenting
 it.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180ae1e1353-0429b808-01e0-4c79-ae99-4b75da2ecdab-00%40eu-central-1.amazonses.com.


Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-09 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
--+
 Reporter:  Collin Anderson   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  HTTP handling |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Carlton Gibson):

 Hey Colin.

 There's a PEP here: [https://peps.python.org/pep-0544/ PEP 544 –
 Protocols: Structural Subtyping (Static Duck Typing)]

 The idea roughly being that you declare a protocol, which any class can
 conform to, and use that in your annotations, rather than requiring a
 specific subclass, since folks are used to passing any kind of object that
 responds appropriately.

 > Does Python typing allow... erm... retrofitting — that's probably not
 the word — protocol conformance? 🤔

 Reading from the PEP, on [https://peps.python.org/pep-0544/#explicitly-
 declaring-implementation Explicitly declaring implementation]:

 > Static analysis tools are expected to automatically detect that a class
 implements a given protocol. So while it’s possible to subclass a protocol
 explicitly, it’s not necessary to do so for the sake of type-checking.

 So... testing needed but... one would hope that a suitable Protocol
 definition would satisfy the type-checkers, without needing changes
 everywhere in the existing code.
 With `runtime_checkable()` it looks like that's usable with `isinstance()`
 too which might help avoid issues like #33362.

 None of this is necessary here — more just thinking how we move forward:
 documenting `HttpResponseBase` is fine I think.
 Thanks.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180acb7f703-90c90ef2-a351-4a32-a4dd-765ae6461e8a-00%40eu-central-1.amazonses.com.


Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-06 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
--+
 Reporter:  Collin Anderson   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  HTTP handling |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Collin Anderson):

 I don't really know what you mean by "protocol". Could you explain more or
 give an example of another "protocol"?

 My use case is I have a view that wraps `django.views.static.serve`, which
 returns `HttpResponseBase` according to `django-stubs`
 https://github.com/typeddjango/django-stubs/blob/master/django-
 stubs/views/static.pyi#L8.

 So my view that wraps `serve` needs also needs to be annotated as
 returning `HttpResponseBase`, so it would nice if `HttpResponseBase` was
 part of the official api, rather than being undocumented.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701809a7a66be-a439700d-b123-4889-b7c8-6473ce13a4fa-00%40eu-central-1.amazonses.com.


Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-05 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
--+
 Reporter:  Collin Anderson   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  HTTP handling |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Carlton Gibson):

 * stage:  Unreviewed => Accepted


Comment:

 Hey Collin.

 Question: rather than exposing the base class, should we not be defining a
 protocol here, that you'd then use for type annotations? (Does Python
 typing allow... erm... ''retrofitting'' — that's probably not the word —
 protocol conformance? 🤔)

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701809829a9a0-aeb075ff-250a-43c6-8c98-66c777ac8ae9-00%40eu-central-1.amazonses.com.


Re: [Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-05 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
-+-
 Reporter:  Collin Anderson  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  HTTP handling|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Collin Anderson):

 * has_patch:  0 => 1


Comment:

 https://github.com/django/django/pull/15667

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018095aed58c-8d793ec9-6911-4c58-9a23-574543ae85e6-00%40eu-central-1.amazonses.com.


[Django] #33683: Document HttpResponseBase and allow import from django.http

2022-05-05 Thread Django
#33683: Document HttpResponseBase and allow import from django.http
+
   Reporter:  Collin Anderson   |  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  new
  Component:  HTTP handling |Version:  dev
   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 |
+
 HttpResponseBase shouldn't be used directly for creating responses, but
 it's super useful for type-checking, so I think we should document and
 allow import from django.http.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018095ad7f37-f2820be5-54ff-4411-976a-c48eca3689b3-00%40eu-central-1.amazonses.com.