Skip to content

super calls with arguments #6630

Closed
Closed

Description

@MSeifert04

I touched a lot of super calls in #6629 and #6613 but there are several remaining occurences that haven't been using the current class as first argument and/or the "bound argument" (first argument of the method) as second argument.

I believe lots of them are actually bugs but some of these look intentional. It could be worthwhile to revisit the remaining ones, just to exclude potential bugs and in case it was accidental to remove the obsolete arguments.

Activity

  1. pllim commented on Sep 30, 2017

    @pllim
    Member

    Do you happen to have notes on where the remaining ones are?

  2. added this to the v3.0.0 milestone on Sep 30, 2017
  3. MSeifert04 commented on Sep 30, 2017

    @MSeifert04
    ContributorAuthor

    Not sure if that's still correct but I have this list:

    file line_number
    coordinates\angles.py 535
    coordinates\angles.py 659
    coordinates\representation.py 2576
    coordinates\tests\test_regression.py 390
    extern\bundled\six.py 105
    extern\bundled\six.py 126
    extern\bundled\six.py 141
    io\ascii\ipac.py 27
    io\ascii\ipac.py 34
    io\ascii\latex.py 339
    io\ascii\latex.py 437
    io\fits\verify.py 129
    io\fits\hdu\compressed.py 1424
    modeling\core.py 369
    modeling\core.py 416
    modeling\parameters.py 100
    modeling\polynomial.py 392
    modeling\polynomial.py 498
    modeling\polynomial.py 701
    table\column.py 315
    table\index.py 402
    tests\command.py 53
    tests\helper.py 292
    tests\helper.py 296
    tests\helper.py 320
    tests\helper.py 339
    tests\pytest_plugins.py 224
    tests\runner.py 130
    tests\runner.py 512
    tests\tests\test_socketblocker.py 21
    tests\tests\test_socketblocker.py 26
    time\core.py 121
    time\core.py 878
    units\format\base.py 16
    

    I haven't touched the extern and tests directories (not sure why I haven't checked tests but extern probably shouldn't be changed at all).

  4. bsipocz commented on Sep 30, 2017

    @bsipocz
    Member

    I've removed the package-novice tag, as for this one has to have some idea about the intentions for those calls, as @MSeifert04 said above they may very well be a bug or there for a reason.

  5. MSeifert04 commented on Sep 30, 2017

    @MSeifert04
    ContributorAuthor

    I also found the script:

    import pathlib
    import re
    
    astropy_dir = ...
    for filepath in pathlib.Path(astropy_dir).glob('**/*.py'):
        for lineno, line in enumerate(filepath.open(encoding='utf-8')):
            if re.search(r'super\(\w', line):
                print(filepath.relative_to(astropy_dir), lineno)
    
  6. pllim commented on Sep 30, 2017

    @pllim
    Member

    Okay, retagged to "expert" (but for an expert, shouldn't take long to determine whether it is bug or not, so also modified the "effort" tag).

  7. mhvk commented on Dec 22, 2017

    @mhvk
    Contributor

    Removing milestone -- not sure what we can do right now. Would be good to update the list with calls that have not been checked.

  8. removed this from the v3.0.0 milestone on Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions