Skip to content

Consistently prefix (_?)with_ for "this, but with x changed"  #2248

@dangotbanned

Description

@dangotbanned

Originally posted by @dangotbanned in #2232 (comment)

this is fine - I guess we could call it _with_version for consistency with how we're now naming similar methods?

@MarcoGorelli Yeah I like that
I think we should open an issue to identify all the places we could change to that style.

I had a similar thought here - but reverted to keep the PR from spiraling:

Candidates

Important

  • Just for internal API
  • from_ becomes reserved for @classmethod(s)
Current Proposed
Compliant*._change_version() Compliant*._with_version()
Compliant(Data|Lazy)Frame._from_native_frame() Compliant*._with_native()
CompliantSeries._from_native_series() Same as above
(Dask|DuckDB|SparkLike)Expr._from_call() LazyExpr._with_callable()
Expr._from_callable() Expr._with_callable()
(Dask|DuckDB|SparkLike)ExprNameNamespace._from_alias_output_names() LazyExprNameNamespace._with_alias_output_names()

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions