Skip to content

Solved description problem #117600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Solved description problem #117600

wants to merge 2 commits into from

Conversation

Harsh-Govil
Copy link

@Harsh-Govil Harsh-Govil commented Apr 7, 2024

@ghost
Copy link

ghost commented Apr 7, 2024

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Apr 7, 2024
@Harsh-Govil
Copy link
Author

I am sending a new PR pls check

@JelleZijlstra
Copy link
Member

What is the motivation for this change? It doesn't look necessary.

@Harsh-Govil
Copy link
Author

What is the motivation for this change? It doesn't look necessary.

I had to contribute to 1 open source project for my college assignment. I saw this problem and did the changes based on my understanding of the problem statement. If you want me to do some other changes pls clarify. I would be very happy to contribute

@JelleZijlstra
Copy link
Member

This PR is not linked to any issue, so I don't know what the problem is that you are trying to solve.

@Harsh-Govil
Copy link
Author

This PR is not linked to any issue, so I don't know what the problem is that you are trying to solve.

In documentation explanation to command date.replace() is not clear enough.
I'm not that experienced, so it's maybe look from junior perspective, but since documentation quite needed for beginers i think my opinion might be valuable.

In documentation description to this function says "Return a date with the same value, except for those parameters given new values by whichever keyword arguments are specified." and gives an examle:

--- from datetime import date
--- d = date(2002, 12, 31)
--- d.replace(day=26)
datetime.date(2002, 12, 26)
But it confused me, since it looks like you can change datetime object and as documentation says - datetime objects are immutable, so i had to check and of course you can't change variable like that, the only way that works if you create a new variable (for example: d2 = d.replace(day=26))

So i propose to make this part that there won't be any confusion for anyone by rephrasing it.
For example:

Return a new date object with the same value as initial, except for those parameters given new values by whichever keyword arguments are specified.

--- from datetime import date
--- d = date(2002, 12, 31)
--- d2 = d.replace(day=26)
--- d2
datetime.date(2002, 12, 26)
I haven't seen any tickets issued about this one, but i apologise if there is and i've missed it, or if i miss something in documentation itself.

@Harsh-Govil
Copy link
Author

This PR is not linked to any issue, so I don't know what the problem is that you are trying to solve.

I am a beginner and learning things now. Eventually would start doing good contributions but in this problem, if you want me to do anything I would be really happy to do

@encukou
Copy link
Member

encukou commented May 6, 2024

First, report an issue describing the problem. That helps keep related and backported pull requests together.

You'll find the same wording in time.replace and datetime.replace. Change them all, or none of them.

Try to keep source lines below 80 characters, as in (most of) the rest of the document.

Avoid adding unnecessary blank lines, or removing existing ones. (Unless you're intentionally improving the source's readability, of course.)

When rewording something in the reference docs, try to be as concise, correct and complete as you can.

@hauntsaninja
Copy link
Contributor

Closing, since OP hasn't replied / signed the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants