I would have thought Adrian's deferred fields proposal would fall 
squarely in the post-1.0 bucket.  It clearly has no backward 
compatibility issues, so it can be added after 1.0.  Maybe you aren't 
proposing to include it in 1.0; it wasn't clear from your message.

I'm not arguing against removing positional argument support from model 
constructors, just wondering about the 1.0 focus.

--Ned.

Jacob Kaplan-Moss wrote:
> Howdy folks --
>
> The short version:
>
> I'd like to deprecate initializing models using positional arguments
> (i.e. ``p = Person(1, 'Joe Somebody')``) in favor of only allowing
> keyword-argument initialization (i.e. ``p = Person(id=1, name='Joe
> Somebody')``).
>
> I'd make the ``*args`` style start issuing DeprecationWarnings
> immediately, and remove support entirely when we wipe deprecated
> features in the run-up to 1.0. I'd make this change on the
> queryset-refactor branch.
>
> Long version, with explanation:
>
> This week I've been starting to help Malcolm out the queryset-refactor
> branch. To get my feet wet I've been playing with Adrian's deferred
> fields proposal (http://code.djangoproject.com/ticket/5420).
>
> Turns out it's trickier that I'd though, but mostly because of the
> fact that QuerySets initialize models using ``Model.__init__(*args)``
> instead of using kwargs. I'm almost certainly going to have to change
> the internal behavior to get deferred fields working OK.
>
> As I started down that road, though, I realized that positional
> initialization of models is something I've only seen done internally
> to Django. Further, using this "feature" can lead to all sorts of
> nasty bugs: if you change the order of fields in models.py all of a
> sudden fields start getting the "wrong" values from positional
> initialization. On top of that, removing ``*args`` support from
> ``Model.__init__`` would make the code cleaner and a bit faster.
>
> Thoughts?
>
> Jacob
>
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to