Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two culture setters for world #174

Open
zugnachpankow opened this issue Jun 8, 2022 · 0 comments
Open

two culture setters for world #174

zugnachpankow opened this issue Jun 8, 2022 · 0 comments

Comments

@zugnachpankow
Copy link
Contributor

In
pycopancore/model_components/base/implementation/world.py
line 100 - 130
there are two setters for the culture, is this redundant?

`

@property
def culture(self):
    """Get world's culture."""
    return self._culture

@culture.setter
def culture(self, c):
    """Set world's culture."""
    if self._culture is not None:
        # first deregister from previous culture's list of worlds:
        self._culture.worlds.remove(self)
    if c is not None:
        assert isinstance(c, I.Culture), \
            "Culture must be taxon type Culture"
        c._worlds.add(self)
    self._culture = c

@property
def culture(self):
    """Get the Culture acting in this World."""
    return self._culture

@culture.setter
def culture(self, c):
    """Set the World the SocialSystem is part of."""
    if self._culture is not None:
        self._culture._worlds.remove(self)
    assert isinstance(c, I.Culture), "culture must be of taxon type Culture"
    c._worlds.add(self)
    self._culture = c

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants