python / cpython

The Python programming language
https://www.python.org/
Other
61.29k stars 29.55k forks source link

turtle.fillcolor doesn't accept a tuple of floats #71406

Open JelleZijlstra opened 8 years ago

JelleZijlstra commented 8 years ago
BPO 27219
Nosy @serhiy-storchaka, @JelleZijlstra
Dependencies
  • bpo-21916: Create unit tests for turtle textonly
  • Files
  • issue27219.patch: patch adding support for float color tuples
  • issue27219-cr.patch
  • 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: ```python assignee = None closed_at = None created_at = labels = ['type-feature', 'library'] title = "turtle.fillcolor doesn't accept a tuple of floats" updated_at = user = 'https://github.com/JelleZijlstra' ``` bugs.python.org fields: ```python activity = actor = 'JelleZijlstra' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'JelleZijlstra' dependencies = ['21916'] files = ['43217', '43236'] hgrepos = [] issue_num = 27219 keywords = ['patch'] message_count = 3.0 messages = ['267263', '267394', '267423'] nosy_count = 2.0 nosy_names = ['serhiy.storchaka', 'JelleZijlstra'] pr_nums = [] priority = 'normal' resolution = None stage = 'patch review' status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue27219' versions = ['Python 3.6'] ```

    JelleZijlstra commented 8 years ago

    But turtle.pencolor() returns a tuple of floats, so calling turtle.fillcolor(turtle.pencolor()). This issue shows up in the doctest at library/turtle.rst line 936. I can submit a patch with tests once the tests in bpo-21916 are in.

    serhiy-storchaka commented 8 years ago

    _color_triple_to_hexstring() is implementation detail. It would be better to test it indirectly using public method (like fillcolor()). Added other comments on Rietveld.

    JelleZijlstra commented 8 years ago

    New patch