0

I asked this previously here but unfortuantely no full standalone answers were given. I'm trying hacky alternatives to subclassing but they're just not convenient. That's why I', putting this up again, looking for answers.

from pathlib import Path
class Pl(Path):
    def __init__(self, *pathsegments: str):
        super().__init__(*pathsegments)

Error at instantiation

AttributeError: type object 'Pl' has no attribute '_flavour'

I'm interested in a solution that works across different machines.

Alex Deft
  • 2,531
  • 1
  • 19
  • 34
  • 2
    Does this answer your question? [Error with simple subclassing of pathlib.Path: no \_flavour attribute](https://stackoverflow.com/questions/61689391/error-with-simple-subclassing-of-pathlib-path-no-flavour-attribute) – DV82XL May 31 '20 at 00:23
  • You're posting what again? The same question? This is like running code over and over expecting different results without changing anything, aka madness. Please refrain from "bumping my old question" questions, as they serve little to no purpose, start a bounty on your old question instead. Voting to close. – Torxed May 31 '20 at 00:30
  • @Torxed In my opinion I thought this question is more explicit. – Alex Deft May 31 '20 at 00:35
  • Edit your previous question to add more details to it instead. As there's nothing more "explicit" here other than you stating that you didn't like your old question and you want less hacky alternatives. So I suggest you update your previous question with the text "Edit: I would prefer a non-hacky way of solving this" and add a bounty to it. If that doesn't work, my best bet is that there's is no way of solving it in a non-hacky way due to your design limitation or choice of coding style to this particular problem :) Perhaps a re-work of the model is in place? – Torxed May 31 '20 at 00:39
  • I hear ya, and it's fine if you want to post a new question that's targeted for a specific solution. Buf if that's the case this question should have an actual body of contents. Not just a reference as the reference might change in the future (as an example, even tho it's low odds since you own both questions). Edit this question to be a `I want this, and I've tried these things and I would like to not solve it by doing X` kind of approach instead. As I said, currently this is just a "bump" question, there's no body of content here other then a reference :) No idea what you're coding btw heh. – Torxed May 31 '20 at 00:47
  • @Torxed I modified the question to be up to your standards. The language is obvious from the tag `Python`. Thanks for the discussion. – Alex Deft May 31 '20 at 00:54

0 Answers0