Skip to content

Conversation

cmjcharlton
Copy link
Contributor

I have created a local variable to indicate whether the file is being saved to the native byteorder in two places, but am happy to calculate this once in __init__ and store in self for later access if you prefer.

@mroeschke
Copy link
Member

but am happy to calculate this once in init and store in self for later access if you prefer.

I think this would be preferable. Over time we've wanted to avoid mutating state variables in methods if possible

@mroeschke mroeschke added the IO Stata read_stata, to_stata label Jun 10, 2024
@cmjcharlton
Copy link
Contributor Author

but am happy to calculate this once in init and store in self for later access if you prefer.

I think this would be preferable. Over time we've wanted to avoid mutating state variables in methods if possible

Thanks, that's useful to know. I have now changed this.

@mroeschke mroeschke added this to the 3.0 milestone Jun 10, 2024
@mroeschke mroeschke merged commit 629ffeb into pandas-dev:main Jun 10, 2024
@mroeschke
Copy link
Member

Thanks @cmjcharlton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Stata read_stata, to_stata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Invalid Stata file is generated if byteorder='big' is specified and strings are saved as strL type
2 participants