Re: Beginner-friendly issue to start contributing to codebase

2020-02-07 Thread Carlton Gibson
Yes, you can assign it to yourself.
If you get stuck, post of the forum.djangoproject.com Mentorship topic.

Welcome aboard! ⛵️

C.

On Fri, 7 Feb 2020 at 11:43, Vibhu Agarwal  wrote:

> Hi Carlton
>
> Thanks for finding me this issue.
>
> I've set up django dev. locally.
> I'm looking into this issue now and I'll try to submit a patch asap :)
>
> Should I claim this ticket?
>
>
> On Thursday, February 6, 2020 at 2:25:08 PM UTC+5:30, Carlton Gibson wrote:
>>
>> Hi Vibhu
>>
>> Take a look at: https://code.djangoproject.com/ticket/29446
>>
>> Create a venv. Install your checkout of Django (with `pip install -e
>> path/to/django`)
>> Create a test project with a simple template view.
>> Pass a callable that raises an error to the template.
>> See the debug view. It should show your error.
>>
>> Adjust the ExceptionReporter (& friends) in django.views.debug to show
>> the template context in this kind of case.
>>
>> (There's a comment on the ticket to the effect of "what should it look
>> like?" — Get it on the page, in roughly the right place, and we can look at
>> that then.)
>>
>> Hopefully that gets you started.
>>
>> Kind Regards,
>>
>> Carlton
>>
>>
>> On Thursday, 6 February 2020 01:41:45 UTC+1, Vibhu Agarwal wrote:
>>>
>>> Hi! I'm Vibhu, currently an undergraduate.
>>> I've been working with Django for over a year now.
>>> And for a long time, I've been wanting to contribute to Django as well.
>>>
>>> So I followed a few links shared repeatedly in the mailing list, like:
>>> -
>>> https://docs.djangoproject.com/en/3.0/internals/contributing/new-contributors/
>>> - https://docs.djangoproject.com/en/dev/internals/contributing/
>>>
>>> Through those, I followed other links and thoroughly read the guides
>>> like:
>>> "Reporting bugs and requesting features", "Triaging tickets",
>>> "Submitting patches" and "Writing your first patch for Django"
>>>
>>> I even tried to get familiar with the process through #31222
>>>  and #31226
>>>  and looked through some
>>> closed PRs as well.
>>> Then I tried to find 'easy pickings' which are directly related to the
>>> codebase, but I couldn't find any which is new or un-assigned.
>>>
>>> I just need to get started with understanding the codebase and its
>>> structure.
>>> If anyone could help me look for an issue which involves writing tests
>>> or changing code in any way, it would be great.
>>> Any beginner-friendly issue will do.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/84f9499b-d2ff-41c5-bb54-98f94df0cb79%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJwKpyQNBfgE-O63JxZN2cNoC6D5jDCUrS35sJW10HdkTS0xjQ%40mail.gmail.com.


Re: Use "raise from" where appropriate, all over the codebase

2020-02-07 Thread Carlton Gibson
Maybe... it's still more verbose for no gain as I see it. 

I think the default implicit chaining is correct in the default case. It's 
only if you want to adjust that (or suppress is with `from None`) that the 
extra clause comes in handy. I think using the default unless there's a 
reason not to is, in general, a good policy. 

I know I'm -1 on this particular change, for the reasons in this thread, 
but thank you for your efforts nonetheless. :)

Kind Regards,

Carlton


On Friday, 7 February 2020 12:17:11 UTC+1, Ram Rachum wrote:
>
>
>
> On Fri, Feb 7, 2020 at 12:23 PM Carlton Gibson  > wrote:
>
>> > I'm basing it on the fact that Carlton approved this PR for the style 
>> guide: https://github.com/django/django/pull/12350
>>
>> No. I don't think we should merge that change. (It's "approved" qua 
>> itself before reviewing, and dependent on the main PR.)
>>
>> To be clear. I think the default implicit chaining should be used unless 
>> there's specific reason not to. 
>>
>> (In hindsight I should have come to this conclusion before agreeing to 
>> the original smaller cleanup.)
>>
>> C.
>>
>
> I understand. Hypothetical question: If the syntax was `raise as 
> NewException`, without having to give the old exception a name, would that 
> change your decision?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0bef0533-553c-41a4-b11a-4346dcc17c83%40googlegroups.com.


Re: Use "raise from" where appropriate, all over the codebase

2020-02-07 Thread Ram Rachum
On Fri, Feb 7, 2020 at 12:23 PM Carlton Gibson 
wrote:

> > I'm basing it on the fact that Carlton approved this PR for the style
> guide: https://github.com/django/django/pull/12350
>
> No. I don't think we should merge that change. (It's "approved" qua itself
> before reviewing, and dependent on the main PR.)
>
> To be clear. I think the default implicit chaining should be used unless
> there's specific reason not to.
>
> (In hindsight I should have come to this conclusion before agreeing to the
> original smaller cleanup.)
>
> C.
>

I understand. Hypothetical question: If the syntax was `raise as
NewException`, without having to give the old exception a name, would that
change your decision?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANXboVayH%2BmwUGgAwX1b4BgDp2T7FtAPO5bfYnkY9gf%2BVy3AgA%40mail.gmail.com.


Re: Beginner-friendly issue to start contributing to codebase

2020-02-07 Thread Vibhu Agarwal
Hi! Thanks for the heads up.
I'll remember to reproduce the bug locally, working on latest dev. branch 
and also ping the owner of ticket before starting to work for the patch.

On Thursday, February 6, 2020 at 2:27:00 PM UTC+5:30, Adam Johnson wrote:
>
> Hi Vibhu
>
> Thank you for your documentation improvements. There are certainly many 
> more bigger improvements that can be made. For similar small typo fixes in 
> the future, you can just directly submit a PR rather than do all the 
> paperwork of adding an issue.
>
> Yes, "easy pickings" tickets get resolved fairly rapidly. There are many 
> eyeballs looking out for such issues. As fran says, you can look for older 
> issues on which work seems to have frozen. But beware - the older the 
> issue, the harder it likely is to be!
>
> Thanks,
>
> Adam
>
> On Thu, 6 Feb 2020 at 01:01, Fran Hrženjak  > wrote:
>
>> Just a quick note: issues that have an owner but weren’t updated in a 
>> reasonably long time are usually open for taking. It is probably polite to 
>> ask the owner first, because maybe they just resumed working on the issue 
>> yesterday :) What is “reasonably long time” is probably open to 
>> interpretation, but I’d say anything that is counted in years has to be 
>> fair game.
>>
>> I’m wondering if it would make sense to have such tickets automatically 
>> unassigned...
>>
>>
>>
>>
>> On Thu, Feb 6, 2020 at 1:41 AM Vibhu Agarwal > > wrote:
>>
>>> Hi! I'm Vibhu, currently an undergraduate.
>>> I've been working with Django for over a year now.
>>> And for a long time, I've been wanting to contribute to Django as well.
>>>
>>> So I followed a few links shared repeatedly in the mailing list, like:
>>> - 
>>> https://docs.djangoproject.com/en/3.0/internals/contributing/new-contributors/
>>> - https://docs.djangoproject.com/en/dev/internals/contributing/
>>>
>>> Through those, I followed other links and thoroughly read the guides 
>>> like:
>>> "Reporting bugs and requesting features", "Triaging tickets", 
>>> "Submitting patches" and "Writing your first patch for Django"
>>>
>>> I even tried to get familiar with the process through #31222 
>>>  and #31226 
>>>  and looked through some 
>>> closed PRs as well.
>>> Then I tried to find 'easy pickings' which are directly related to the 
>>> codebase, but I couldn't find any which is new or un-assigned.
>>>
>>> I just need to get started with understanding the codebase and its 
>>> structure.
>>> If anyone could help me look for an issue which involves writing tests 
>>> or changing code in any way, it would be great.
>>> Any beginner-friendly issue will do.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-d...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-developers/8489e521-d8b4-44b3-9569-3068dd14256d%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-d...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/CAM2o%3DwNBkdPV89JOoCizeKzOG%3D8uarHAnU8FbH08TA_v2L2y9w%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> Adam
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c379f153-db89-47b2-b653-ad1abe13d46c%40googlegroups.com.


Re: Beginner-friendly issue to start contributing to codebase

2020-02-07 Thread Vibhu Agarwal
Hi Carlton

Thanks for finding me this issue.

I've set up django dev. locally.
I'm looking into this issue now and I'll try to submit a patch asap :)

Should I claim this ticket?

On Thursday, February 6, 2020 at 2:25:08 PM UTC+5:30, Carlton Gibson wrote:
>
> Hi Vibhu
>
> Take a look at: https://code.djangoproject.com/ticket/29446
>
> Create a venv. Install your checkout of Django (with `pip install -e 
> path/to/django`)
> Create a test project with a simple template view.
> Pass a callable that raises an error to the template. 
> See the debug view. It should show your error. 
>
> Adjust the ExceptionReporter (& friends) in django.views.debug to show the 
> template context in this kind of case. 
>
> (There's a comment on the ticket to the effect of "what should it look 
> like?" — Get it on the page, in roughly the right place, and we can look at 
> that then.) 
>
> Hopefully that gets you started. 
>
> Kind Regards,
>
> Carlton
>
>
> On Thursday, 6 February 2020 01:41:45 UTC+1, Vibhu Agarwal wrote:
>>
>> Hi! I'm Vibhu, currently an undergraduate.
>> I've been working with Django for over a year now.
>> And for a long time, I've been wanting to contribute to Django as well.
>>
>> So I followed a few links shared repeatedly in the mailing list, like:
>> - 
>> https://docs.djangoproject.com/en/3.0/internals/contributing/new-contributors/
>> - https://docs.djangoproject.com/en/dev/internals/contributing/
>>
>> Through those, I followed other links and thoroughly read the guides like:
>> "Reporting bugs and requesting features", "Triaging tickets", "Submitting 
>> patches" and "Writing your first patch for Django"
>>
>> I even tried to get familiar with the process through #31222 
>>  and #31226 
>>  and looked through some 
>> closed PRs as well.
>> Then I tried to find 'easy pickings' which are directly related to the 
>> codebase, but I couldn't find any which is new or un-assigned.
>>
>> I just need to get started with understanding the codebase and its 
>> structure.
>> If anyone could help me look for an issue which involves writing tests or 
>> changing code in any way, it would be great.
>> Any beginner-friendly issue will do.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/84f9499b-d2ff-41c5-bb54-98f94df0cb79%40googlegroups.com.


Re: Use "raise from" where appropriate, all over the codebase

2020-02-07 Thread Carlton Gibson
> I'm basing it on the fact that Carlton approved this PR for the style 
guide: https://github.com/django/django/pull/12350

No. I don't think we should merge that change. (It's "approved" qua itself 
before reviewing, and dependent on the main PR.)

To be clear. I think the default implicit chaining should be used unless 
there's specific reason not to. 

(In hindsight I should have come to this conclusion before agreeing to the 
original smaller cleanup.)

C.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9ad99f34-f2bc-407f-9bef-8f9cdaa21e5c%40googlegroups.com.


Re: Use "raise from" where appropriate, all over the codebase

2020-02-07 Thread Ram Rachum
On Fri, Feb 7, 2020 at 12:27 AM Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> Hello Ram,
>
> On 6 Feb 2020, at 19:08, Ram Rachum  wrote:
>
> In other words, "raise from" is the inevitable future, it's just that
> we're not in a rush to get there.
>
>
> I'm not sure how you came to this conclusion; I'm not seeing this in
> Carlton's and Mariusz' answers.
>

I'm basing it on the fact that Carlton approved this PR for the style
guide: https://github.com/django/django/pull/12350

I'm not sure though whether he intends to merge it.

In any case, I think it'll be sad if people will just get used to
misleading exception chaining messages.

Shai Berger wrote:
> > > it's very rare to have a legitimate exception
> > > without a "raise from" inside an except clause. In almost any
> > > context in which "during handling of..." is correct, the raising is
> > > done deeper in the stack.
> > >
> I think the conclusion should be to ask for a change in Python, not
> Django. The rule "if an exception is raised explicitly from an except
> clause then it is considered raised-from" seems simple enough to me.

That's an interesting idea, but there are 2-3 problems with it that make it
close to impossible.

An alternative suggestion would be to allow syntax that automatically sets
the cause to be the last-caught exception. I would suggest the `raise as`
syntax, which was one of the rejected alternatives in PEP 409
 for a different
usecase

try:
1/0

except ZeroDivisionError:

raise as ValueError('Whatever')

My suggestion is that this `raise as` line would have the same effect as
`raise ValueError('Whatever') from zero_division_error`, while also
preventing the need to add `as zero_division_error` in the line above.

I think this solves most of the problems with the previous suggestion. What
do you think? Want to write a PEP together? :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANXboVbzHfPVc8uB4nmjy8UzEJBCFYfahKEKt2PcMc3dV3PvPA%40mail.gmail.com.