this post was submitted on 09 Feb 2025
31 points (100.0% liked)

Python

6684 readers
5 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
 

I'm working on a project that needs lots of toolbars on screen at once, even though not all of them will be used at the same time. So, I'm modelling this 'foldable' dock widget after what I remember Photoshop panels used to be like.

It's a work in progress, but would like to hear constructive suggestions.

https://blocks.programming.dev/0101100101/42c5d67f86c049baa3500aa38e439f8a

you are viewing a single comment's thread
view the rest of the comments

Thanks for the compliment! Python isn't my first language and it's difficult to be able to switch style from one language to another!

I always find it difficult to choose when to use ternary statements. Sometimes, for something quick and simple, I will, otherwise I'll be explicit. This is more of a readability issue than anything else. And I find the ternary statements quite verbose compared to other languages by using the words if/else rather than shorthand symbols.

You're absolutely right about the set_float_icon and corresponding method. Coding's an iterative process and that's a byproduct. I think set_float_icon() along with complimentary methods like set_docked_icon(), set_minimize_icon(), set_restore_icon() etc may be easier to use / remember wtf it does in six months time!

Thanks for the black / ruff suggestion. I've never heard fo them, but I'm about to go look for them.