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

Allow "datetime in date" #44704

Closed
collinwinter mannequin opened this issue Mar 12, 2007 · 3 comments
Closed

Allow "datetime in date" #44704

collinwinter mannequin opened this issue Mar 12, 2007 · 3 comments
Labels
extension-modules C modules in the Modules dir

Comments

@collinwinter
Copy link
Mannequin

collinwinter mannequin commented Mar 12, 2007

BPO 1679204
Nosy @birkenfeld
Files
  • date_contains.patch: Version 1, against 54295
  • 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 = None
    closed_at = <Date 2007-03-13.02:12:14.000>
    created_at = <Date 2007-03-12.18:58:44.000>
    labels = ['extension-modules']
    title = 'Allow "datetime in date"'
    updated_at = <Date 2007-03-13.02:12:14.000>
    user = 'https://bugs.python.org/collinwinter'

    bugs.python.org fields:

    activity = <Date 2007-03-13.02:12:14.000>
    actor = 'collinwinter'
    assignee = 'collinwinter'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2007-03-12.18:58:44.000>
    creator = 'collinwinter'
    dependencies = []
    files = ['7864']
    hgrepos = []
    issue_num = 1679204
    keywords = ['patch']
    message_count = 3.0
    messages = ['52186', '52187', '52188']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'collinwinter']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1679204'
    versions = ['Python 2.6']

    @collinwinter
    Copy link
    Mannequin Author

    collinwinter mannequin commented Mar 12, 2007

    As discussed in http://mail.python.org/pipermail/python-ideas/2007-March/000320.html, this patch adds a __contains__ method to datetime.date objects:

    datetime(2007, 3, 4, x, y, z) in date(2007, 3, 4) -> True
    datetime(2007, 3, 5, x, y, z) in date(2007, 3, 4) -> False

    Trying to see if a date contains anything other than a datetime results in a TypeError. Patch includes docs and tests.

    @collinwinter collinwinter mannequin closed this as completed Mar 12, 2007
    @collinwinter collinwinter mannequin self-assigned this Mar 12, 2007
    @collinwinter collinwinter mannequin added the extension-modules C modules in the Modules dir label Mar 12, 2007
    @collinwinter collinwinter mannequin closed this as completed Mar 12, 2007
    @collinwinter collinwinter mannequin self-assigned this Mar 12, 2007
    @collinwinter collinwinter mannequin added the extension-modules C modules in the Modules dir label Mar 12, 2007
    @birkenfeld
    Copy link
    Member

    Patch looks good, but the indentation of the /* nb_xyz */ comments seems to be messed up ;)

    @collinwinter
    Copy link
    Mannequin Author

    collinwinter mannequin commented Mar 13, 2007

    Closing. Comparing dates and datetimes is just a bad idea. This was more a proof-of-concept than anything else.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant