Feeds

Oliver Davies' daily list: An interesting thing I spotted about the Override Node Options module

Planet Drupal - Fri, 2024-11-15 19:00

Before my remote talk for the Drupal London meetup, I'm updating the usage statistics for the Override Node Options module - one of the modules I maintain on Drupal.org.

In my slides for DrupalCamp Belgium, I showed the usage figures from October 2023, which showed 38,096 installations and it being the 173rd most installed module.

This week, the number of installations has slightly increased to 38,223.

What's interesting is that whilst the number of installations has been consistent, there are a lot less Drupal 7 websites using the module and a lot more Drupal 8+ sites using it.

October 2023
  • 5.x-1.x: 1
  • 6.x-1.x: 297
  • 7.x-1.x: 13,717
  • 8.x-2.x: 24,081
  • Total: 38,096
November 2024
  • 5.x-1.x: 4
  • 6.x-1.x: 202
  • 7.x-1.x: 10,429
  • 8.x-2.x: 27,588
  • Total: 38,223

Assuming these numbers are correct, this makes me feel very positive and happy about the adoption of newer versions of Drupal and that people are upgrading their D7 websites to Drupal 10 or 11.

Categories: FLOSS Project Planets

digiKam 8.5.0 is released

Planet KDE - Fri, 2024-11-15 19:00

Dear digiKam fans and users,

After five months of active maintenance and many weeks triaging bugs, the digiKam team is proud to present version 8.5.0 of its open source digital photo manager.

Generalities

More than 160 bugs have been fixed and we spent a lot of time contacting users to validate changes in pre-release versions to confirm fixes before deploying the program to production.

Categories: FLOSS Project Planets

FSF Blogs: FSD meeting recap 2024-11-15

GNU Planet! - Fri, 2024-11-15 16:52
Check out the important work our volunteers accomplished at today's Free Software Directory (FSD) IRC meeting.
Categories: FLOSS Project Planets

FSD meeting recap 2024-11-15

FSF Blogs - Fri, 2024-11-15 16:52
Check out the important work our volunteers accomplished at today's Free Software Directory (FSD) IRC meeting.
Categories: FLOSS Project Planets

Keep warm with GNU winter swag

FSF Blogs - Fri, 2024-11-15 16:30
Categories: FLOSS Project Planets

Web Review, Week 2024-46

Planet KDE - Fri, 2024-11-15 10:47

Let’s go for my web review for the week 2024-46.

No GPS required: our app can now locate underground trains

Tags: tech, mobile, sensors, gps, transportation

Now this is definitely a smart trick to estimate position in tunnels.

https://blog.transitapp.com/go-underground/


OpenAI, Google and Anthropic Are Struggling to Build More Advanced AI - Bloomberg

Tags: tech, ai, machine-learning, gpt

More signs of the generative AI companies hitting a plateau…

https://www.bloomberg.com/news/articles/2024-11-13/openai-google-and-anthropic-are-struggling-to-build-more-advanced-ai


Releasing the largest multilingual open pretraining dataset

Tags: tech, ai, machine-learning, gpt, data, copyright, licensing

It shouldn’t be, but it is a big deal. Having such training corpus openly available is one of the big missing pieces to build models.

https://simonwillison.net/2024/Nov/14/releasing-the-largest-multilingual-open-pretraining-dataset/#atom-blogmarks


Everything I’ve learned so far about running local LLMs

Tags: tech, ai, machine-learning, gpt, foss

This is an interesting and balanced view. Also nice to see that local inference is really getting closer. This is mostly a UI problem now.

https://nullprogram.com/blog/2024/11/10/


When Machine Learning Tells the Wrong Story

Tags: tech, cpu, hardware, security, privacy, research

Fascinating research about side-channel attacks. Learned a lot about them and website fingerprinting here. Also interesting the explanations of how the use of machine learning models can actually get in the way of proper understanding of the side-channel really used by an attack which can prevent developing actually useful counter-measures.

https://jackcook.com/2024/11/09/bigger-fish.html


Abusing Ubuntu 24.04 features for root privilege escalation

Tags: tech, linux, security

Nice chain of attacks. This shows more than one vulnerability needs to be leveraged to lead to root access. This provides valuable lessons.

https://snyk.io/blog/abusing-ubuntu-root-privilege-escalation/


Way too many ways to wait on a child process with a timeout

Tags: tech, unix, linux, system

The title says it all. This is very fragmented and there are several options to fulfill the task. Knowing the tradeoffs can be handy.

https://gaultier.github.io/blog/way_too_many_ways_to_wait_for_a_child_process_with_a_timeout.html


The CVM Algorithm

Tags: tech, databases, algorithm

This is a nice view into how a query planner roughly works and a nice algorithm which can be used internally to properly estimate the number of distinct values in a column.

https://buttondown.com/jaffray/archive/the-cvm-algorithm/


Mergiraf

Tags: tech, version-control, git, tools, conflict

Looks like a nice way to improve handling of merge conflicts. I’ll test this one out.

https://mergiraf.org/


Opposite of Cloud Native is?

Tags: tech, cloud, complexity, vendor-lockin, self-hosting

Definitely a good post. No you don’t have to go all in with cloud providers and signing with your blood. It’s often much more expensive for little gain but much more complexity and vendor lock in.

https://mkennedy.codes/posts/opposite-of-cloud-native-is-stack-native/


Booleans Are a Trap

Tags: tech, design, type-systems

Avoiding boolean parameters in library APIs should be a well known advice by now. Still they should probably be avoided when modeling domain types as well.

https://katafrakt.me/2024/11/09/booleans-are-a-trap/


Complex for Whom?

Tags: tech, design, complexity

Good musing about complexity. Very often we need to move it around, the important question is where should it appear. For sure you don’t want it scattered everywhere.

https://notes.billmill.org/link_blog/2024/11/Complex_forWhom.html


What makes concurrency so hard?

Tags: tech, distributed, complexity

Interesting reasoning about what is hard in systems with concurrency. It’s definitely about the state space of the system and the structure of that space.

https://buttondown.com/hillelwayne/archive/what-makes-concurrency-so-hard/


Algorithms we develop software by

Tags: tech, programming, craftsmanship, engineering, problem-solving

Interesting musing on the heuristics we use when solving problems. There are good advices in there to make progress and become a better developer.

https://grantslatton.com/software-pathfinding


Bye for now!

Categories: FLOSS Project Planets

KDE Gear 24.12 Beta Testing

Planet KDE - Fri, 2024-11-15 09:26

KDE Gear is our release service for many apps such as mail and calendaring supremo Kontact, geographers dream Marble, social media influencing Kdenlive and dozens of others. KDE needs you to test that your favourite feature has been added and your worst bug has been squished.

You can do this with KDE neon Testing edition, built from the Git branches which get used to make releases from. You can download the ISO and try it on spare hardware or on a virtual machine to test them out.

But maybe you don’t want the faff of installing a distro. Containers give an easier way to test thanks to Distrobox.

Install Distrobox on your normal computer. Make sure Docker or podman are working.

Download the container with

distrobox create -i invent-registry.kde.org/neon/docker-images/plasma:testing-all

Then start it with
distrobox enter all-testing
And voila it will mount the necessary bits to get Wayland connections working and keep your home directory available and you can run say

kontact

and test the beta for the mail app.

Categories: FLOSS Project Planets

Metadrop: Local tasks hierarchy on Drupal 10

Planet Drupal - Fri, 2024-11-15 07:29

Recently, in one of our projects with Drupal 10, we faced an interesting challenge: implementing two-level "local tasks" for a specific functionality of our module. Despite the number of documentation related to local tasks in Drupal, setting up two levels of these tasks proved challenging, as we couldn't get them to display in the way we needed. However, after exhaustive research, we found an example in an existing module that helped us solve the problem.

Exploring the Problem

The need was to add a main "local task" and three associated subtasks that would show up when viewing or editing a node. Initially, the main obstacle was finding the right way to implement two levels of local tasks.

The Solution: Inspiration from Contributed Modules

During our search among existing contributed modules, we found…

Categories: FLOSS Project Planets

1xINTERNET blog: Reunited in Berlin - DrupalCamp Berlin 2024

Planet Drupal - Fri, 2024-11-15 07:00

10 years after DrupalCity Berlin 2014 the community kicked-off another DrupalCamp in the heart of Europe uniting the global Drupal community. Learn what's behind this triumphant return.

Categories: FLOSS Project Planets

Real Python: The Real Python Podcast – Episode #228: Maintaining the Foundations of Python & Cautionary Tales

Planet Python - Fri, 2024-11-15 07:00

How do you build a sustainable open-source project and community? What lessons can be learned from Python's history and the current mess that the WordPress community is going through? This week on the show, we speak with Paul Everitt from JetBrains about navigating open-source funding and the start of the Python Software Foundation.

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Droptica: How to Integrate Drupal with LDAP? A Comprehensive Step-by-Step Guide

Planet Drupal - Fri, 2024-11-15 04:34

In this article, I’ll demonstrate how to integrate Drupal with a Lightweight Directory Access Protocol (LDAP) server, using JumpCloud as an example. With this guide, you’ll be able to quickly and securely manage users on your website. I encourage you to read the blog post or watch the video in the “Nowoczesny Drupal” series.

Categories: FLOSS Project Planets

Golems GABB: Drupal Automatic Updates

Planet Drupal - Fri, 2024-11-15 04:27
Drupal Automatic Updates Editor Fri, 11/15/2024 - 11:27

This article is about the Automatic Updates module in 2024. Golems web experts will discuss its importance, core functions, recent improvements, and how it benefits the Drupal community. Whether you are experienced in Drupal or just starting to use it as your website's platform, knowing what this module can do is useful for keeping your Drupal site working well and safe in today's digital world.

Categories: FLOSS Project Planets

Talk Python to Me: #485: Secure coding for Python with SheHacksPurple

Planet Python - Fri, 2024-11-15 03:00
What do developers need to know about AppSec and building secure software? We have Tonya Janca (AKA SheHacksPurple) on the show to tell us all about it. We talk about what developers should expect from threat modeling events as well as concrete tips for security your apps and services.<br/> <br/> <strong>Episode sponsors</strong><br/> <br/> <a href='https://talkpython.fm/posit'>Posit</a><br> <a href='https://talkpython.fm/bluehost'>Bluehost</a><br> <a href='https://talkpython.fm/training'>Talk Python Courses</a><br/> <br/> <strong>Links from the show</strong><br/> <br/> <div><b>Tanya on X</b>: <a href="https://x.com/shehackspurple?featured_on=talkpython" target="_blank" >@shehackspurple</a><br/> <b>She Hacks Purple website</b>: <a href="https://shehackspurple.ca/?featured_on=talkpython" target="_blank" >shehackspurple.ca</a><br/> <b>White House recommends memory safe languages</b>: <a href="https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/?featured_on=talkpython" target="_blank" >whitehouse.gov</a><br/> <b>Python Developer Survey Results</b>: <a href="https://lp.jetbrains.com/python-developers-survey-2023/?featured_on=talkpython" target="_blank" >jetbrains.com</a><br/> <b>Bandit</b>: <a href="https://github.com/PyCQA/bandit?featured_on=talkpython" target="_blank" >github.com</a><br/> <b>Semgrep Academy</b>: <a href="https://academy.semgrep.dev/?featured_on=talkpython" target="_blank" >academy.semgrep.dev</a><br/> <b>Watch this episode on YouTube</b>: <a href="https://www.youtube.com/watch?v=ocnFl_Nt-ic" target="_blank" >youtube.com</a><br/> <b>Episode transcripts</b>: <a href="https://talkpython.fm/episodes/transcript/485/secure-coding-for-python-with-shehackspurple" target="_blank" >talkpython.fm</a><br/> <br/> <b>--- Stay in touch with us ---</b><br/> <b>Subscribe to us on YouTube</b>: <a href="https://talkpython.fm/youtube" target="_blank" >youtube.com</a><br/> <b>Follow Talk Python on Mastodon</b>: <a href="https://fosstodon.org/web/@talkpython" target="_blank" ><i class="fa-brands fa-mastodon"></i>talkpython</a><br/> <b>Follow Michael on Mastodon</b>: <a href="https://fosstodon.org/web/@mkennedy" target="_blank" ><i class="fa-brands fa-mastodon"></i>mkennedy</a><br/></div>
Categories: FLOSS Project Planets

Drupal Starshot blog: Looking at what's next for Drupal CMS

Planet Drupal - Fri, 2024-11-15 00:38

With the current Drupal CMS work tracks well on the way to delivering for v1, we're planning ahead to define what's next on the roadmap. We also have a few tracks that were already in progress for v1, but never formally announced.

As we move beyond the basics of a CMS, things get complicated quickly! So several of these tracks are somewhat open-ended, and likely require multiple approaches or solutions.

Tracks already in progress Project Browser

Project Browser is an ongoing initiative, to make it easy for site builders to find modules from within their Drupal sites, led by Leslie Glynn and Chris Wells Redfin. After several years of foundational work, the functionality is now working with a live API endpoint from drupal.org providing the module information. 

Since Project Browser is a critical part of the builder experience for Drupal CMS, we're formally adding it as a work track to recognize that and ensure it is aligned with the product strategy and other work tracks. If you're looking for a way to contribute to Drupal CMS, join the #project-browser channel on Slack for the latest.

Workspaces as content moderation

Drupal core has long provided tools for configurable content workflows, via the Workflows and Content moderation modules. In the meantime, the Workspaces module has become stable, and provides a more scalable method for staging content changes. Experience Builder will require workspaces to provide true content staging, because within XB a user can make changes to a number of different components at once, and content moderation does not allow for this. But right now, the complexity of workspaces makes it challenging for the most basic content moderation use cases.

The team from Tag1 already had a plan to completely replace content moderation with workspaces, and have now committed to delivering this functionality for inclusion in Drupal CMS. The goal of this track is to provide an experience similar to content moderation, where you can edit a single entity and create a draft, using workspaces but without exposing this to the user. So under the hood, workspaces is providing the draft/forward revision, but the user has no direct interaction with the workspace.

Telemetry

Telemetry is a crucial part of modern software development to provide information about how real-world users interact with a software application. Drupal has not integrated a formal telemetry system in the past, but Drupal CMS is a great opportunity both to try a telemetry system, and to take advantage of the insight it provides to rapidly improve the product.

We formed a working group to look into options for telemetry for Drupal CMS and have an early proposal for this now. Ideally, we will include some basic capability in the initial release, but would like to recruit a track lead to oversee this work ongoing, after the initial release.

If you are interested in taking the lead on this track, please apply here.

New tracks we're recruiting for Content import / migration

Enabling users of other platforms to easily migrate their sites to Drupal is critical to delivering on the Starshot strategy. Drupal's migration tools provide a robust foundation, but this is a huge task to undertake, and may require more than one approach. 

So this track may split off into several different efforts. For example, there may be a simple import solution for basic sites that have a structured data source. Another might offer a migration via site scraping. And another might provide a jumping off point for more complex migrations. Rather than prescribing the approach, we are open to all proposals.

If you are interested in proposing a solution for this, please apply here.

Tours

Drupal has long had the capability to add tours, which are guided overviews of the site interface, via the Tour module. These guided tours are practically universal in our competitor products, and will be key to onboarding new Drupal users.

Several Drupal CMS recipes have provided or plan to provide a tour of the functionality they provide. In order to ensure that the tours provided by Drupal CMS are consistently applied and executed, we are seeking a lead to oversee this aspect of the product. This role is non-technical in nature, and requires skills in user experience, training, content writing and product design. The aim with tours will be to use them only where necessary, and not as a workaround for other fundamental UX improvements.

If you are interested in taking the lead on this track, please apply here.

Identity management / SSO

In user interviews with a number of people in our target person, they highlighted identity management and single-sign as a pain point with other platforms. Given Drupal's robust integration options, we feel this is an area where we can differentiate from our competitors, whose offerings may be more limited. But with flexibility comes complexity, and anyone who has tried to set up SSO in Drupal probably knows that it's not usually plug-and-play.

Part of the complexity is the wide range of providers, each with potentially different requirements. The Drupal CMS leadership team is currently undertaking an analysis of key integrations of all kinds, with a focus on user management, to formulate an approach to this that likely will open up one or more work tracks to build or refine the necessary functionality.

If you are interested in proposing a solution for this, please apply here.

Content translation tools

Drupal’s multilingual capabilities are robust, but there is an opportunity to make these tools even more accessible and efficient for content creators managing global audiences. This track focuses on enhancing Drupal’s translation and localization features to streamline content creation and support internationalization needs.

To achieve this, we could explore areas such as UX improvements to simplify translation workflows, AI-driven translation suggestions, integration with translation memories, notifications when content changes require re-translation, and more. Additionally, we can explore refining approval workflows and optimize the interface for managing multilingual content, making Drupal a more powerful, user-friendly platform for international sites.

If you are interested in proposing a solution for this, please apply here.

Front end design system

We are seeking strategic partners interested in designing and implementing a comprehensive design system to integrate with Experience Builder for Drupal CMS. The goal for this initiative is to create a modern and versatile design system that provides designers and front-end developers tools to accelerate their adoption of Drupal as their digital platform, by enabling them to easily adapt it to their own brand. This design system will enable content marketers to efficiently build landing pages and campaigns, allowing them to execute cohesive marketing strategies while maintaining the brand integrity.

More information on this track, including timelines and how to apply, is available in the full brief.

Conclusion

Each of these work tracks is aligned with the goals of the Starshot strategy, which aims to make Drupal CMS the go-to platform for marketers and content creators. 

The tracks we are recruiting for are not expected to be included in the initial 1.0 release of Drupal CMS. That said, development on these tracks could start soon, with target completion in the first half of 2025.

For those looking to apply or contribute, join us on Slack to connect with existing track leads or reach out to the Drupal CMS leadership team with questions. You can also follow developments in the Drupal.org issue queue.

Categories: FLOSS Project Planets

mark.ie: My LocalGov Drupal contributions for week-ending November 15th, 2024

Planet Drupal - Thu, 2024-11-14 19:09

LocalGov Drupal week + code contributions + getting elected on to the board of Open Digital Cooperative. It's been a busy week.

Categories: FLOSS Project Planets

Matt Layman: Heroku To DigitalOcean - Building SaaS #206

Planet Python - Thu, 2024-11-14 19:00
In this episode, I began a migration of my JourneyInbox app from Heroku to DigitalOcean. The first step to this move, since I’m going to use Kamal, is to put the app into a Docker image. We got the whole app into the Docker image, then cleaned up local development and the CI system after making changes that broke those configurations.
Categories: FLOSS Project Planets

Conclusion of KDE and Google Summer of Code 2024

Planet KDE - Thu, 2024-11-14 19:00

All of KDE's Google Summer of Code (GSoC) projects are complete.

GSoC is a program where students or people who are new to Free and Open Source software make programming contributions to an open source project.

This post summarizes the outcomes of KDE project participating in GSoC 2024.

Projects Arianna

Ajay Chauhan worked on porting Arianna from epub.js to use Foliate-js. The work will hopefully be merged soon.

A screenshot of Arianna using Foliate-js to render a table of contents
(Courtesy of Ajay Chauhan, CC BY-NC-SA 4.0) Frameworks

Python bindings for KDE Frameworks:

Manuel Alcaraz Zambrano, implemented Python bindings for KWidgetAddons, KUnitConversion, KCoreAddons, KGuiAddons, KI18n, KNotifications, and KXmlGUI. This was done using Shiboken. In addition, Manuel wrote a tutorial on how to generate Python bindings using Shiboken. The complicated set of merge requests are still being reviewed, and Manuel continues to interact with the KDE community.

Unit conversion example created using Python and KUnitConversion
(Courtesy of Manuel Alcaraz Zambrano, CC BY-NC-SA 4.0) KDE Connect

Update SSHD library in KDE Connect Android app

The main aim of ShellWen Chen's project was to update Apache Mina SSHD from 0.14.0 to 2.12.1. The older version has a few listed vulnerabilities. The newer library required additional code to enable it to work on older Android phones, up to Android API 21.

KDE Games

Implementing a computerized opponent for the Mancala variant Bohnenspiel:

João Gouveia created Mankala engine, a library to enable easy creation of Mancala games. The engine contains implementations for two Mancala games, Bohnenspiel and Oware. Both games contain computerized opponents, João also started on a QtQuick graphical user interface. The games are functional, but additional investigation on computerized opponents may help improve their effectiveness.

Image of text user interface for Bohnenspiel
(Courtesy of João Gouveia, CC BY-SA 4.0) Kdenlive

Improved subtitling support for Kdenlive:

Subtitling support has been improved for Kdenlive. Chengkun Chen added support for using the Advanced SubStation (ASS) file format and for converting SubRip files to ASS files. To support this format, Chengkun Chen also made subtitling editor improvements. The work has been merged in the main repository. Documentation has been written, and will hopefully be merged soon.

The new Style Editor Widget
(Courtesy of Chengkun Chen, CC BY-SA 4.0) Krita

Creating Pixel Perfect Tool for Krita:

Ken Lo worked on implementing Pixel Perfect lines in Krita. As explained by Ricky Han, such algorithms remove corner pixels from L shaped blocks and ensure the thinnest possible line is 1 pixel wide. Implementing such algorithms well is of use not only in Krita, but also in rendering web graphics where user screen resolutions can vary significantly. The algorithm was implemented to work in close to real time while lines are drawn, rather than as a post processing step. Ken Lo's work has been merged into Krita.

An image showing that pixel perfect lines are obtained most of the time
(Courtesy of Ken Lo, CC BY 4.0) Labplot

Improve Python Interoperability with LabPlot

Israel Galadima worked on improving Python support in LabPlot. Shiboken was used for this and it is now possible to call some of LabPlot functions from Python and integrate these into other applications.

An image of a plot produced using Python bindings to Labplot
(Courtesy of Israel Galadima, CC BY-SA 4.0)

3D Visualization for LabPlot:

Kuntal Bar added 3D graphing capabilities to LabPlot. This was done using QtGraphs. The work has yet to be merged, but there are many nice examples of 3D plots for bar charts, scatter and surface plots.

A 3D bar chart
(Courtesy of Kuntal Bar, MIT license) Okular

Forms/Javascript support improvement for Okular:

Pratham Gandhi worked on improving the forms/Javascript support in Okular. Around 25 requests have been merged to improve various features, some in the backend and some directly visible, such as fixing the size of the radio buttons or check boxes, or the one pictured below to improve the handling of floating numbers in different locales.

An image of showing an incorrect total sum calculation fixed during GSoC
(Courtesy of Pratham Gandhi, CC BY-SA 4.0) Snaps

Improving Snap Ecosystem in KDE:

Snaps are self contained linux application packging formats. Soumyadeep Ghosh worked on improving the tooling necessary to make KDE applications easily available in the Snap Store. In addition, Soumyadeep improved packaging of a number of KDE Snap packages, and packaged MarkNote. Finally, Soumyadeep created Snap KCM, a graphical user interface to manage permissions that Snaps have when running.

Snap KCM
(Courtesy of Soumyadeep Ghosh, CC BY-NC-SA 4.0) Next Steps

The 2024 GSoC period is finally over for KDE. A big thank you to all the mentors and contributors who have participated in GSoC! We look forward to your continuing participation in free and open source software communities and in contributing to KDE.

Categories: FLOSS Project Planets

Python Morsels: Inspecting objects in Python

Planet Python - Thu, 2024-11-14 16:49

I rely on 4 functions for inspecting Python objects: type, help, dir, and vars.

Table of contents

  1. Inspecting an object's structure and data
  2. How to see an object's class
  3. Looking up documentation with help
  4. Getting the methods and attributes for an object
  5. Inspecting direct attributes of an object
  6. Base classes, module paths, and more
  7. Inspect Python objects with type, help, dir, and vars

Inspecting an object's structure and data

The scenario is, we're either in the Python REPL or we've used the built-in breakpoint function to drop into the Python debugger within our code. So we're within some sort of interactive Python environment.

For example, we might be running this file, which we've put a breakpoint call in to drop into a Python debugger:

from argparse import ArgumentParser from collections import Counter from pathlib import Path import re def count_letters(text): return Counter( char for char in text.casefold() if char.isalpha() ) def main(): parser = ArgumentParser() parser.add_argument("file", type=Path) args = parser.parse_args() letter_counts = count_letters(args.file.read_text()) breakpoint() for letter, count in letter_counts.most_common(): print(count, letter.upper()) if __name__ == "__main__": main()

And we've used the PDB interact command to start a Python REPL:

~ $ python3 letter_counter.py frankenstein.txt > /home/trey/letter_counter.py(18)main() -> breakpoint() (Pdb) interact *pdb interact start* >>>

We have a letter_counts variable that refers to some sort of object. We want to know what this object is all about.

What questions could we ask of this object?

Well, to start with, we could simply refer to the object, and then hit Enter:

>>> letter_counts Counter({'e': 46043, 't': 30365, 'a': 26743, 'o': 25225, 'i': 24613, 'n': 24367, 's': 21155, 'r': 20818, 'h': 19725, 'd': 16863, 'l': 12739, 'm': 10604, 'u': 10407, 'c': 9243, 'f': 8731, 'y': 7914, 'w': 7638, 'p': 6121, 'g': 5974, 'b': 5026, 'v': 3833, 'k': 1755, 'x': 677, 'j': 504, 'q': 324, 'z': 243})

We've typed the name of a variable that points to an object, and now we see the programmer-readable representation for that object.

How to see an object's class

Often, the string representation tells …

Read the full article: https://www.pythonmorsels.com/inspecting-python-objects/
Categories: FLOSS Project Planets

Five Jars: Enhancing Code Reliability with Effective Vue.js Testing

Planet Drupal - Thu, 2024-11-14 15:47
Writing tests can improve both your coding skills and product reliability, helping you become a better developer by encouraging structured, concise, well-organized, and well documented code.
Categories: FLOSS Project Planets

Pages