Skip to content

Conversation

@nedbat
Copy link
Member

@nedbatnedbat commented Dec 13, 2024

This is a reduced summary table, to help with smaller screens and to make the content more scannable.

Compared to #126342, I've:

  • Removed class names and parameters from the summary
  • Used parentheses uniformly to indicate methods
  • Shortened some of the summary descriptions
  • Moved "exceptions" to the end

📚 Documentation preview 📚: https://cpython-previews--127911.org.readthedocs.build/

Link to the pathlib preview: https://cpython-previews--127911.org.readthedocs.build/en/127911/library/pathlib.html#summary

@bedevere-appbedevere-appbot added docs Documentation in the Doc dir skip news awaiting core review labels Dec 13, 2024
@nedbatnedbatforce-pushed the nedbat/pathlib-summary branch from 72669dd to dc2c6aeCompareDecember 13, 2024 12:20
- Removed class names and parameters from the summary - Used parentheses uniformly to indicate methods - Shortened some of the summary descriptions - Move "exceptions" to the end
--------------------------------------------------------------------------------------------------------------------------
:meth:`copy() <Path.copy>` Copy this file or directory tree to the given *target*
:meth:`copy_into() <Path.copy_into>` Copy this file or directory tree into the given *target_dir*
:meth:`rename() <Path.rename>` Rename this file or directory to the given *target*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:meth:`rename() <Path.rename>` Rename this file or directory to the given *target*
:meth:`rename() <Path.rename>` Rename this file or directory to the given *target*. Raises an exception if the *target* already exists.

I think is clarification would be good.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to add this second sentence. This table is meant to help people find what they need, and then go read the full description. There are many reasons why a method could raise an exception. This doesn't need to be mentioned in the summary.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not differentiate between rename/replace as they share the first sentence which may be confusing?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, now I see what you mean. Reading the full descriptions, it's even more subtle, and OS-specific. I would go with:

rename: Rename this path to the given target if possible. replace: Rename this path to the given target unconditionally. 

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind which one you go with both mine and yours get the point across.

@Nodd
Copy link
Contributor

Nodd commented Mar 19, 2025

Thanks @nedbat for improving my work.

  • Removed class names and parameters from the summary

I can agree on the class names to reduce redundancy, even if I think that it can be less explicit and annoying when you're viewing the middle of a table and don't remember which class you're looking at. On the other hand I think that removing the parameters removes valuable information and is detrimental to understand the purpose of a function at a glance, and I'm not convinced that it's an improvement.

  • Used parentheses uniformly to indicate methods

+1 for adding the missing parentheses.

  • Shortened some of the summary descriptions

+1

  • Moved "exceptions" to the end

+1

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants

@nedbat@Nodd@merwok@StanFromIreland