Skip to content

COMPAT: add >= 2.7 features #11993

Closed
Closed
@jreback

Description

@jreback

xref #7718
xref #11988

since we recently removed 2.6 (and 3.3) support, we are now free to use some features of later releases.
Some of these may be useful. We should investigate and create individual issues.

see here

  • The syntax for set literals ({1,2,3} is a mutable set).
  • Dictionary and set comprehensions ({i: i*2 for i in range(3)}).
  • io library (CLN: StringIO from io instead of from StringIO #10470)
  • argparse (rather then optparse)
  • maybe dictviews
  • memoryviews
  • sysconfig
  • automatic number in .format
>>> '{}:{}:{day}'.format(2009, 4, day='Sunday')
'2009:4:Sunday'
  • using assertRaises as a context manager
with self.assertRaises(KeyError):
    {}['foo']
  • lots of other improved testing goodies!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions