Skip to content

Sweep: add time pretty-printing functionality when you call ._print() on any PrettyTime object #8

@jdotjdot

Description

@jdotjdot
Checklist
  • prettytime.py
  • Add a new method called _print to the t class. This method should return a string that represents the time in a pretty format. The exact format will depend on the attributes of the t object. For example, if the t object represents 3 days, the _print method could return the string "3 days".
    • Add a new method called _print to the PrettyDelta class. This method should return a string that represents the time in a pretty format. The exact format will depend on the attributes of the PrettyDelta object. For example, if the PrettyDelta object represents 2 hours from now, the _print method could return the string "2 hours from now".
    • Add a new method called _print to the PrettyDelta2 class. This method should return a string that represents the time in a pretty format. The exact format will depend on the attributes of the PrettyDelta2 object. For example, if the PrettyDelta2 object represents 1 week ago, the _print method could return the string "1 week ago".
  • README.md
  • Add a new section called "Pretty Printing". In this section, explain that users can call the ._print() method on any PrettyTime object to get a pretty-printed string of the time. Provide some examples of how to use the ._print() method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sweepAssigns Sweep to an issue or pull request.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions