This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients brett.cannon, captain-kark, eric.smith, ethan.furman, rhettinger
Date 2019-07-19.09:49:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563529777.68.0.372054517083.issue37623@roundup.psfhosted.org>
In-reply-to
Content
I think using a dataclass here would be easier, since you can control class variables. Is there some reason that your loader must be a namedtuple?

Something like:

from typing import ClassVar
from dataclasses import dataclass

@dataclass
class MyLoader:
    __spec__: ClassVar["Any"] = None
    name: str

l = MyLoader('test')

I'm not sure of the actual type of __spec__, I'm just using "Any" as a convenient placeholder. I'm also not sure if your intention is to inherit from importlib.abc.Loader, but that's easy enough.
History
Date User Action Args
2019-07-19 09:49:37eric.smithsetrecipients: + eric.smith, brett.cannon, rhettinger, ethan.furman, captain-kark
2019-07-19 09:49:37eric.smithsetmessageid: <1563529777.68.0.372054517083.issue37623@roundup.psfhosted.org>
2019-07-19 09:49:37eric.smithlinkissue37623 messages
2019-07-19 09:49:37eric.smithcreate