Skip to content

State assignment via settings objects #85

Done

Description

@seanpearsonuk

I think that using operator= to set_state is powerful but there is arguably a drawback that should be discussed.

I take aliases everywhere to simplify the code and everywhere do:

x.y.z.foo()

or equivalently:

z = x.y.z
z.foo()

This is fine for method calls but assignment at the level of z is pure assignment (that is not forwarded to set_state).

This is Pythonic, but I don't like it.

Activity

  1. dnwillia-work commented on Mar 3, 2022

    @dnwillia-work
    Collaborator

    So, you are saying that this:

    x.y.z = < new state >
    

    works but

    z = <new state>
    

    just ends up setting z to the object? eg: if it's a dictionary z would just be a dictionary after the second bit.

  2. seanpearsonuk commented on Mar 3, 2022

    @seanpearsonuk
    CollaboratorAuthor

    Yeah, that's it. It's all normal Python of course.

  3. dnwillia-work commented on Mar 3, 2022

    @dnwillia-work
    Collaborator

    Alright, just wanted to make sure I understand. Are you suggesting that we don't use operator= at all then for set_state?

  4. seanpearsonuk commented on Mar 18, 2022

    @seanpearsonuk
    CollaboratorAuthor

    Alright, just wanted to make sure I understand. Are you suggesting that we don't use operator= at all then for set_state?

    I'm on the fence but closing this as the current form is idiomatic.

  5. seanpearsonuk commented on Jul 5, 2024

    @seanpearsonuk
    CollaboratorAuthor

    Reopening, pending further discussions.

  6. changed the title [-]Pythonic assignment not up to scratch[/-] [+]State assignment via settings objects[/+] on Jul 5, 2024
  7. seanpearsonuk commented on Nov 7, 2024

    @seanpearsonuk
    CollaboratorAuthor

    Will not change the behaviour of this.

  8. moved this from In progress to Done in PyFluent Public Roadmapon Nov 8, 2024
  9. seanpearsonuk commented on Mar 6, 2025

    @seanpearsonuk
    CollaboratorAuthor

    This assignment style is cropping up as an issue even for PyFluent developers.

    https://github.com/ansys/pyfluent/pull/3807/files#r1983387948

    Let's discuss.

  10. moved this from 2021-2024 to 2025 Q3 Jul - Sep in PyFluent Public Roadmapon Jan 23, 2026
  11. seanpearsonuk commented on Nov 20, 2026

    @seanpearsonuk
    CollaboratorAuthor

    Reopened.

    I have marked this as relating to #5579. We could do both deprecations in a single release.

    @prmukherj @mkundu1 @mayankansys @hpohekar

  12. moved this from 2025 to 2026 Dec in PyFluent Public Roadmapon Nov 20, 2026
  13. self-assigned this
    on Nov 20, 2026
  14. prmukherj commented on Nov 20, 2026

    @prmukherj
    Collaborator

    Remove the syntactic sugar for = from both settings and object model in PyFluent codebase.

  15. prmukherj commented on Nov 28, 2026

    @prmukherj
    Collaborator

    This has been deprecated and a deprecation warning is being emitted for such scenarios.

  16. moved this from 2026 Dec to 2026 Nov in PyFluent Public Roadmapon Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions