Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 4, 2020

@gvanrossum gvanrossum changed the title bpo-36517: Raise error on multiple inharitence with NamedTuple. bpo-36517: Raise error on multiple inheritance with NamedTuple Apr 4, 2020
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LG!

@serhiy-storchaka serhiy-storchaka merged commit a94e627 into python:master Apr 4, 2020
@serhiy-storchaka serhiy-storchaka deleted the typing-namedtuple-no-multiple-inheritance branch April 4, 2020 18:31
nhuet added a commit to nhuet/scikit-decide that referenced this pull request May 12, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/scikit-decide that referenced this pull request May 12, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/scikit-decide that referenced this pull request May 13, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 27, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 27, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 27, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 27, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 28, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 28, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
nhuet added a commit to nhuet/discrete-optimization that referenced this pull request Jun 28, 2022
The error traceback:

/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/discrete_optimization/tsp/tsp_model.py:267: in <module>
    class Point2D(Point, NamedTuple):
/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/typing.py:1929: in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
E   TypeError: Multiple inheritance with NamedTuple is not supported

Coming from python/cpython#19363

Potential solution: replace NamedTuple by Dataclass(frozen=True)
tonio-m added a commit to tonio-m/fsql that referenced this pull request Aug 10, 2022
remove double inheritance with NamedTuple to avoid TypeError, as per python 3.9: 
python/cpython#19363
gmgunter added a commit to isce-framework/isce3 that referenced this pull request May 1, 2025
This doesn't work in Python >=3.9 until Python 3.11. Multiple
inheritance with `NamedTuple` has limited support.

See:

* python/cpython#19363
* python/cpython#88089
* python/cpython#92027
gmgunter added a commit to isce-framework/isce3 that referenced this pull request Aug 18, 2025
…rid (MCR #90132) (#99)

* Add bindings for `GLOBAL_MIN_HEIGHT` and `GLOBAL_MAX_HEIGHT`

Expose the C++ constants `isce3::core::GLOBAL_MIN_HEIGHT` and
`isce3::core::GLOBAL_MAX_HEIGHT` to Python.

* Add function to compute radar grid spanning a geo grid

* Simplify radar grid construction by ignoring grid coordinate conventions

See the discussion on this comment:
https://github-fn.jpl.nasa.gov/isce-3/isce/pull/2097#discussion_r26503

* Un-parameterize `Rectangle`

This doesn't work in Python >=3.9 until Python 3.11. Multiple
inheritance with `NamedTuple` has limited support.

See:

* python/cpython#19363
* python/cpython#88089
* python/cpython#92027

* Add `look_side` to be a string

* Simplify error messages

* Rename inner function to avoid name ambiguity

* Fix test regexes

* Add test cases for antimeridian and pole crossing

* Explain dummy parameter values used in test

* Test `get_bounding_rectangle()` with +/-inf

* Rename inner function to avoid name ambiguity

* Update docstrings

* Swap inner/outer loop order

* Specify default geo2rdr tolerance

* Clarify isce3 projection description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants