Skip to content
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

classic division in demos/ directory #37995

Closed
exarkun mannequin opened this issue Feb 16, 2003 · 5 comments
Closed

classic division in demos/ directory #37995

exarkun mannequin opened this issue Feb 16, 2003 · 5 comments
Assignees
Labels

Comments

@exarkun
Copy link
Mannequin

exarkun mannequin commented Feb 16, 2003

BPO 687648
Nosy @gvanrossum, @akuchling, @rhettinger
Files
  • demo_classicdivision.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/akuchling'
    closed_at = <Date 2008-09-13.02:00:00.914>
    created_at = <Date 2003-02-16.22:27:52.000>
    labels = ['easy']
    title = 'classic division in demos/ directory'
    updated_at = <Date 2008-09-13.02:00:00.912>
    user = 'https://bugs.python.org/exarkun'

    bugs.python.org fields:

    activity = <Date 2008-09-13.02:00:00.912>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = <Date 2008-09-13.02:00:00.914>
    closer = 'akuchling'
    components = ['Demos and Tools']
    creation = <Date 2003-02-16.22:27:52.000>
    creator = 'exarkun'
    dependencies = []
    files = ['9585']
    hgrepos = []
    issue_num = 687648
    keywords = ['patch', 'easy']
    message_count = 5.0
    messages = ['14619', '14620', '14621', '63181', '73159']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'akuchling', 'rhettinger', 'exarkun', 'schuppenies']
    pr_nums = []
    priority = 'low'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue687648'
    versions = []

    @exarkun
    Copy link
    Mannequin Author

    exarkun mannequin commented Feb 16, 2003

    PEP-238 states:

     - The standard library will use the future
    

    division statement and
    the // operator when appropriate, so as to
    completely avoid
    classic division.

    While the demos/ directory is not technically part of
    the standard library, it does contain code that should
    work, and that newbies may examine in the course of
    learning Python. Python source there should follow the
    same rules as anyplace else.

    I'll volunteer to make the changes and submit a
    patch, if it is agreed that the changes should indeed
    be made.

    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    Excellent. I hope you'll try to also make a judgement (at
    least in some cases) whether a particular piece of demo code
    is still relevant -- there is unfortunately a lot of stale
    demo code.

    Also see if there are other kinds of modernization that
    could be done (see PEP-290).

    @rhettinger
    Copy link
    Contributor

    Logged In: YES
    user_id=80475

    Is this still open or is there a patch forthcoming?

    @schuppenies
    Copy link
    Mannequin

    schuppenies mannequin commented Mar 2, 2008

    The attached patch applies floor division to all classic divisions where
    only integer input was used, and true division where at least on input
    parameter was of non-integral type.
    In cmptree.py I replaced "int(size/dt)" with "size//dt" as it has the
    same semantic but I thought it to be more explicit.

    @akuchling
    Copy link
    Member

    Changes to curses/ committed in rev. 66424.

    Changes to threading/ committed in rev. 66425.

    Changes to Demo/classes/Dates.py committed in rev. 66426.

    Changes to md5driver/ committed in rev. 66427.

    Rest of the changes committed in rev. 66428.

    Robert, thank you very much for your patch!

    @akuchling akuchling self-assigned this Sep 13, 2008
    @akuchling akuchling self-assigned this Sep 13, 2008
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants