GithubHelp home page GithubHelp logo

Comments (5)

dkriegner avatar dkriegner commented on May 23, 2024

there is a similar issue with LayerModel, Material and DarwinModelAlloy which are not usable themselves, but serve as a useful abstraction for derived classes

from xrayutilities.

eugenwintersberger avatar eugenwintersberger commented on May 23, 2024

Hi Dominik. If I understood that correctly there is no way to render a class pure abstract in Python as long as you want to support both, Python 2.7 and Python 3.X. In Python 3.X ABC would be the right way to go.

from xrayutilities.

dkriegner avatar dkriegner commented on May 23, 2024

I will investigate to which level the abc is usable in python 2.7. I think the goal of this is not to make this 100% clean from programming point of view, but to deliver a reasonable error message to the user when he wants to initialize one of these classes which are not fully functional...

from xrayutilities.

dkriegner avatar dkriegner commented on May 23, 2024

@eugenwintersberger could you comment on the mentioned commit? from my point of view thats a viable solution for this issue. if you agree i will put a similar code into the other mentioned classes.

the python2 & 3 compatible code was taken from https://stackoverflow.com/questions/35673474/using-abc-abcmeta-in-a-way-it-is-compatible-both-with-python-2-7-and-python-3-5

from xrayutilities.

dkriegner avatar dkriegner commented on May 23, 2024

I consider this issue solved for the moment. Once only python3.3+ is considered as target version one could make improvements and use new functionality of the abc module.

from xrayutilities.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.