Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 672
    • Issues 672
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Issues
  • #3109

Closed
Open
Created Oct 30, 2019 by Bitbucket Importer@bitbucket_importerMaintainer

Inheriting from a function produces nonsensical-ish error message

Created originally on Bitbucket by JulianB (Julian Berman)

>>> def foo():
...     pass

>>>
>>> class Bar(foo):
...     pass
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'internal-code' object expected, got 'str' instead

'internal-code' object expected, got 'str' instead

(CPython is no better, FWIW, on 3.7:

‌

>>> def foo():
...     pass
...
>>>
>>> class Bar(foo):
...     pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function() argument 1 must be code, not str

)

‌

Something like “superclasses of a class must be instances of type (i.e. classes)” would be a lot nicer (if in fact that is the criteria, I forget)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking