Opened 3 weeks ago

Closed 2 weeks ago

Last modified 9 days ago

#37142 closed Cleanup/optimization (fixed)

Move django.utils.deprecation.django_file_prefixes to a dedicated warnings module.

Reported by: Jacob Walls Owned by: zky
Component: Utilities Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm preparing a documentation section "Writing your own fetch mode" as suggested in a review of the feature.

Emitting a warning rather than an exception is the most obvious simple use case. I'd like my example to skip over Django frames when emitting the warning, just like we do for deprecations. So, I'd like to import and use django_file_prefixes() for this.

But:

We have 4 +1s for moving it out of .deprecation in this review thread.

I propose to move it and document it (outside the contributor documentation), to make it public API.

Change History (9)

comment:1 by zky, 3 weeks ago

Owner: set to zky
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 by pradhvan, 3 weeks ago

Owner: changed from zky to pradhvan

comment:3 by pradhvan, 3 weeks ago

Owner: changed from pradhvan to zky

comment:4 by zky, 3 weeks ago

Has patch: set

comment:6 by Jacob Walls, 2 weeks ago

Triage Stage: AcceptedReady for checkin

comment:7 by Jacob Walls <jacobtylerwalls@…>, 2 weeks ago

Resolution: fixed
Status: assignedclosed

In f970a98e:

Fixed #37142 -- Moved django_file_prefixes() to django.utils.warnings.

comment:8 by Natalia Bidart, 9 days ago

Summary: Document and move django.utils.deprecation.django_file_prefixesMove django.utils.deprecation.django_file_prefixes to a dedicated warnings module.

Jacob and I discussed these changes and we agreed the documentation additions should be reverted. While django_file_prefixes() is a handy utility that sets a good example for issuing warnings, it is an internal helper and documenting it implies public API support and a stability commitment we do not intend to make (at least not for now).

comment:9 by nessita <124304+nessita@…>, 9 days ago

In b3af340:

Refs #37142 -- Removed docs for django.utils.warnings.django_file_prefixes().

This reverts docs changes from commit f970a98e464320c09dde8d45009eadfb4d038a57.

Note: See TracTickets for help on using tickets.
Back to Top