Skip to content

CLN: standardize string repr to use __repr__ #26521

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

Closed
wants to merge 1 commit into from

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented May 25, 2019

Removes use of StringMixin from io.pytables and from io.stata. It's now only used in core.computation.

I haven't been able to remove this class from core.computation. If I do, I get an error about setting an attribute:

        # assumes that resolvers are going from outermost scope to inner
        if isinstance(local_dict, Scope):
            resolvers += tuple(local_dict.resolvers.maps)
        self.resolvers = DeepChainMap(*resolvers)
E       AttributeError: 'Scope' object has no attribute 'resolvers'

pandas\core\computation\scope.py:134: AttributeError

I've looked into this and can't understand why this happens. From the looks of it, I should be able to set that atribute. I'd appreciate any hint.

Because of the above problem, I've changed StringMixin to only define a __repr__ and making related changes. This means that all string reps in pandas are now defined through __repr__, which is better than defining them through __str__.

@topper-123 topper-123 force-pushed the StringMixin__repr__ branch from 810032b to 92f0404 Compare May 25, 2019 14:21
@topper-123 topper-123 closed this May 25, 2019
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.

1 participant