Skip to content

fix: Core.get_params() exposing internal state via self.__dict__ (#521)#527

Closed
dkstlzk wants to merge 2 commits into
dswah:mainfrom
dkstlzk:issue/521-get-params-copy
Closed

fix: Core.get_params() exposing internal state via self.__dict__ (#521)#527
dkstlzk wants to merge 2 commits into
dswah:mainfrom
dkstlzk:issue/521-get-params-copy

Conversation

@dkstlzk
Copy link
Copy Markdown

@dkstlzk dkstlzk commented Mar 13, 2026

Fixes #521.

Core.get_params(deep=True) previously returned self.__dict__,which exposed the estimator's internal attribute storage directly. This allowed external mutation of the estimator state when modifying the returned dictionary.

This change returns a shallow copy instead, preventing external mutation while preserving existing behavior.

@dswah
Copy link
Copy Markdown
Owner

dswah commented Apr 17, 2026

hi this PR does not do what the description says. closing :)

@dswah dswah closed this Apr 17, 2026
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.

[BUG] Core.get_params() returns fitted attributes and internal state, violating sklearn estimator API

2 participants