Opened 4 years ago

Closed 4 years ago

#16761 closed Cleanup/optimization (wontfix)

Overriding built-in symbol

Reported by: coreyf@… Owned by: nobody
Component: Core (Management commands) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/dev/howto/custom-management-commands/

This page informs us that we should override a built-in (help) symbol and specify a string to replace it for use in a Django command. while the short name 'help' is nice, it'd be great if we didn't override python globals and confuse new users. i'd love it if django could be a python consistent framework

Change History (2)

comment:1 Changed 4 years ago by aaugustin

  • Component changed from Uncategorized to Core (Management commands)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed
  • Type changed from Uncategorized to Cleanup/optimization

We can't break backwards compatibility here. One solution would be to look for either help_str or help. Then people who don't want to shadow the built-in can use help_str. It's still slightly backwards incompatible if someone, for any reason, has an help_str variable defined for another purpose...

Since the problem is really minor and the ticket doesn't come with a patch, I'm not convinced it's worth the hassle of developing and documenting a solution.

comment:2 Changed 4 years ago by Alex

  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix; there's no horrible consequence for using the same name as a Python builtin, and because this is at class scope it doesn't override any other scope.

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