FLOSS Project Planets

GNU Guix: Support the growth of the distribution into 2023 and beyond

FSF Blogs - Tue, 2022-11-29 17:25
An update from GNU Guix co-maintainer Maxim Cournoyer on the impressive work they did in 2022.
Categories: FLOSS Project Planets

Jonathan McDowell: onak 0.6.2 released

Planet Debian - Tue, 2022-11-29 16:41

Over the weekend I released a new version of onak, my OpenPGP compatible keyserver. At 2 years since the last release that means I’ve at least managed to speed up a bit, but it’s fair to say its development isn’t a high priority for me at present.

This release is largely driven by a collection of minor fixes that have built up, and the knowledge that a Debian freeze is coming in the new year. The fixes largely revolve around the signature verification that was introduced in 0.6.0, which makes it a bit safer to run a keyserver by only accepting key material that can be validated. All of the major items I wanted to work on post 0.6.0 remain outstanding.

For the next release I’d like to get some basic Stateless OpenPGP Command Line Interface support integrated. That would then allow onak to be tested with the OpenPGP interoperability test suite, which has recently added support for verification only OpenPGP implementations.

I realise most people like to dismiss OpenPGP, and the tooling has been fairly dreadful for as long as I’ve been using it, but I do think it fills a space that no competing system has bothered to try and replicate. And that’s the web of trust, which helps provide some ability to verify keys without relying on (but also without preventing) a central authority to do so.

Anyway. Available locally or via GitHub.

0.6.2 - 27th November 2022

  • Don’t take creation time from unhashed subpackets
  • Fix ECDSA/SHA1 signature check
  • Fix handling of other signature requirement
  • Fix deletion of keys with PostgreSQL backend
  • Add support for verifying v3 signature packets
Categories: FLOSS Project Planets

PyCoder’s Weekly: Issue #553 (Nov. 29, 2022)

Planet Python - Tue, 2022-11-29 14:30

#553 – NOVEMBER 29, 2022
View in Browser »

Microsoft Power BI and Python: Two Superpowers Combined

In this tutorial, you’ll learn how to install and configure Microsoft Power BI to work with Python. Using Python, you’ll import data from a SQLite database, transform and augment your dataset with pandas, and visualize it with Matplotlib.
REAL PYTHON

Parallel Nested for-Loops in Python

Nested for-loops often are an opportunity for parallel code. This article covers when it is a good idea to split them up and the variety of different parallel coding approaches you can use.
JASON BROWNLEE

Painless and Worry Free Postgres

Find out why vanilla Postgres is a more cost effective and simple way to manage your database than shiny Postgres “compatible” databases. Performance tuned, no-forks, quality Postgres with expert support. Built for developer experience. Get started today →
CRUNCHY DATA sponsor

How We Run Tests in Hundreds of Environments Really Fast

Anton describes the test setup at Sentry and how they use both tox in parallel as well as GitHub actions to run a large test suite quickly.
ANTON PIRKER

Discussions The Origins of Python

This discussion is around the excellent article by Lambert Meertens called The Origins of Python that delves into Python’s history.
HACKER NEWS

Python Jobs Software Engineer - Weissman Lab (Cambridge, MA, USA)

Whitehead Institute for Biomedical Research

Senior Software Engineer (Python, Qt, Linux) (Anywhere)

VIOLET

More Python Jobs >>>

Articles & Tutorials Everyday Project Packaging With pyproject.toml

In this Code Conversation video course, you’ll learn how to package your everyday projects with pyproject.toml. Playing on the same team as the import system means you can call your project from anywhere, ensure consistent imports, and have one file that’ll work for many build systems.
REAL PYTHON course

Always Use [closed, open) Intervals

“Intervals or ranges pop-up everywhere in the programming world. The classic example is picking a start and end date, like you would when booking an AirBnB or a flight. Have you ever wondered why they are always implemented as [closed, open) as opposed to [closed, closed]?”
FERNANDO HURTADO CARDENAS

Top 10 Vulns Impacting Open Source in 2022

You might know all about the incredibly useful and insightful OWASP Top 10 list from 2021, but what about the exact CVEs that could be lurking in your applications? Check out Snyk Top 10 Open Source Vulnerability report to get up to date on 2022’s most common vulnerabilities →
SNYK.IO sponsor

16 Reasons to Use VS Code for Developing Jupyter Notebooks

“Visual Studio Code is one of the most popular text editors with a track record of continual improvements. One area where VS Code has been recently innovating is its Jupyter Notebook support.” Read on to see how this might help you.
CHRIS MOFFITT

Python Bytecode Explained

When a Python program is run, the interpreter first parses your code and checks for syntax errors, then it translates it into bytecode instructions. This article explains some of the features of Python bytecode.
MOSER MICHAEL

plydata: Piping for Pandas

The plydata Python package enables you to use the pipe operator, ">>", to chain operations on a pandas dataframe. Read on to learn how to use it and how it compares to the equivalent operation in R.
MARCIN KOZAK • Shared by Marcin

REPL Driven Development

REPL Driven Development is about fast feedback loops during development. It is not about typing code into a terminal window. David talks about this coding workflow and how it is similar to TDD.
DAVID VUJIC • Shared by David Vujic

Python JSONPath With Example

JSONPath is an expression language that is used to parse the JSON data in Python, similar to XPath in XML. This article covers the basics of finding paths in JSON using the library.
SRINIVAS RAMAKRISHNA

Deploy Django, Celery, Redis & Postgres With Docker-Compose

Deployments can be painful. This article describes one approach to deploying Django, Celery, Redis, and Postgres with docker-compose so you can reuse it in your app!
PIOTR PŁOŃSKI • Shared by Piotr Płoński

Deepnote Is a Modern Notebook Where Data Teams Go to Explore, Collaborate, and Solve Hard Problems

Explore data with Python & SQL from your browser. Add context with data visualizations and rich text editing. Share analysis with stakeholders by simply sending a link. Plans start at $0 (free).
DEEPNOTE sponsor

Private, “Protected” Attributes in Python Demystified

A guide to private and protected attributes in Python, learn all about when to use and when not to use leading underscores and double underscores (dunder).
AMIR AFIANIAN • Shared by Amir Afianian

Investigating a Backdoored PyPI Package Targeting FastAPI

Using an open source security scanner, the authors found a backdoored package on PyPI. Read on for details about how they found it and what it contained.
TURCKHEIM & TAFANI-DEREEPER

Projects & Code quickadd: Parse Natural Language Time and Date Expressions

GITHUB.COM/ACREOM

Python Tools for the Polylith Architecture

GITHUB.COM/DAVIDVUJIC • Shared by David Vujic

django-virtual-models: Django ORM Prefetching Layer

GITHUB.COM/VINTASOFTWARE

Colossal-AI: Unified Deep Learning System for Big Model Era

GITHUB.COM/HPCAITECH

pytorch-image-models: Models, Scripts, Pre-Trained Weights

GITHUB.COM/RWIGHTMAN

Events NZPUG-Auckland Coding Challenge “Office Hours”

November 30, 2022
MEETUP.COM

Deep Learning With PyTorch

November 30, 2022
MEETUP.COM

Weekly Real Python Office Hours Q&A (Virtual)

November 30, 2022
REALPYTHON.COM

PyDelhi User Group Meetup

December 3, 2022
MEETUP.COM

Sydney Python User Group (SyPy)

December 1, 2022
SYPY.ORG

Happy Pythoning!
This was PyCoder’s Weekly Issue #553.
View in Browser »

[ Subscribe to 🐍 PyCoder’s Weekly 💌 – Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]

Categories: FLOSS Project Planets

PyCharm: The Second Release Candidate for PyCharm 2022.3 Is Out!

Planet Python - Tue, 2022-11-29 12:21

PyCharm 2022.3 is just around the corner and the second Release Candidate is here!

You can download the new version from our website, update directly from the IDE or via the free Toolbox App, or use snaps for Ubuntu.

Download PyCharm 2022.3 RC

This build requires an active subscription to PyCharm Professional.

Here are the most important improvements in this build:

  • You can now use Conda with remote interpreters, such as interpreters on WSL and Docker. To install the packages on remote Conda environments, please use the Python Packages tool window. [PY-35978]
  • We fixed several issues that were affecting the use of Python interpreters on Docker and Docker Compose, including the issue preventing users from choosing a specific interpreter for their run/debug configurations. [PY-55360], [PY-57484], [PY-57460].
  • Debug Console now works as expected after starting the debugging process. [PY-57296]
  • Mapping now works normally for debugging files on WSL. [PY-55800
  • On Windows, Python Console now has the UTF-8 encoding by default [PY-57519]

Please share your feedback in the comments, on Twitter, or on our issue tracker. Your feedback is highly appreciated!

Categories: FLOSS Project Planets

Ixis.co.uk - Thoughts: 5 Top Tips to Securing Your Drupal Website

Planet Drupal - Tue, 2022-11-29 09:10
Keeping your website secure is vital for every website and business; in this blog, we cover 5 top tips to keep your Drupal site secure.
Categories: FLOSS Project Planets

Real Python: Using Python's pathlib Module

Planet Python - Tue, 2022-11-29 09:00

Have you struggled with file path handling in Python? With the pathlib module, the struggle is now over! You no longer need to scratch your head over code like this:

>>>>>> path.rsplit('\\', maxsplit=1)[0]

And you don’t have to cringe at the verbosity of something like this:

>>>>>> os.path.isfile(os.path.join(os.path.expanduser('~'), 'realpython.txt'))

In this video course, you’ll learn how to:

  • Work with file paths in Python
  • Read and write files in new ways
  • Manipulate paths and the underlying file system
  • List files and iterate over them

Using the pathlib module, the two examples above can be rewritten using elegant, readable, and Pythonic code:

>>>>>> path.parent >>> (pathlib.Path.home() / 'realpython.txt').is_file()

That’s what you’ll master in this video course!

[ 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

Django Weblog: 2023 DSF Board Election Results

Planet Python - Tue, 2022-11-29 08:19

The 2023 Board is transitional to our new staggered 2 year term board membership model.
Here are the results of this year's election as selected by ranked choice voting:

  1. Chaim Kirby*
  2. Jacob Kaplan-Moss
  3. Katie McLaughlin*
  4. Aaron Bassett
  5. Kátia Yoshime Nakamura*
  6. Peter Baumgartner
  7. Cagil Ulusahin Sonmez*
* Elected to a two (2) year term

Congratulations to our winners and a huge thank you to our departing board members Anna Makarudze, Mfon Eti-mfon, William Vincent, and Žan Anderle. You all set the bar very high for the next board.

Also a special thank you to the 30 candidates we had this year. The DSF simply isn't possible without the help of all of our volunteers.

Categories: FLOSS Project Planets

Salsa Digital Drupal-Related Articles: Melbourne Drupal Meetup — December 2022

Planet Drupal - Tue, 2022-11-29 07:27
It's time for another Meetup! This month we return with another hybrid event (in-person PLUS virtual). Same location as last month: Inspire9 Level 1/41-43 Stewart St Richmond VIC 3121 Drupal 10 celebration This Drupal Meetup is a special one as we officially launch Drupal 10.  Present at the Meetup Would you like to talk for 5 minutes about what you did last week/month? We've had some great topics so far this year, and we're keen to continue that trend!  Please ping Suchi Garg on Drupal Slack if you're interested in presenting or if there's a specific topic you'd like to discuss.
Categories: FLOSS Project Planets

S. Lott: Functional Programming and Finite State Automata (FSA)

Planet Python - Tue, 2022-11-29 06:00

When I talk about functional programming in Python, folks like to look for place where functional programming isn't appropriate. They latch onto finite-state automata (FSA) because "state" of an automata doesn't seem to fit with stateless objects used in functional programming.

This is a false dichotomy. 

It's emphatically false in Python, where we don't have a purely functional language.

(In a purely functional language, monads can help make FSA's behave properly and avoid optimization. The use of a recursion to consume an iterable and make state transitions is sometimes hard to visualize. We don't have these constraints.)

Let's look at a trivial kind of FSA: the parity computation. We want to know how many 1-bits are in a given value. Step 1 is to expand an integer into bits.

def bits(n: int) -> Iterable[int]:
if n < 0:
raise ValueError(f"{n} must be >= 0")
while n > 0:
n, bit = divmod(n, 2)
yield bit

This will transform a number into a sequence of bits. (They're in order from LSB to MSB, which is the reverse order of the bin() function.)

>>> list(bits(42))
[0, 1, 0, 1, 0, 1]

Given a sequence of bits, is there an odd number or an even number? This is the parity question. The parity FSA is often depicted like this:

When the parity is in the even state, a 1-bit transitions to the odd state. When the parity is in the odd, a 1-bit transitions to the even state.

Clearly, this demands the State design pattern, right?

An OO Implementation

Here's a detailed OO implementation using the State design pattern.


class Parity:
def signal(self, bit: int) -> "Parity":
...


class EvenParity(Parity):
def signal(self, bit: int) -> Parity:
if bit % 2 == 1:
return OddParity()
else:
return self


class OddParity(Parity):
def signal(self, bit: int) -> Parity:
if bit % 2 == 1:
return EvenParity()
else:
return self


class ParityCheck:
def __init__(self):
self.parity = EvenParity()

def check(self, message: Iterable[int]) -> None:
for bit in message:
self.parity = self.parity.signal(bit)

@property
def even_parity(self) -> bool:
return isinstance(self.parity, EvenParity)

Each of the Parity subclasses implements one of the states of the FSA. The lonely signal() method implements state-specific behavior. In this case, it's a transition to another state. In more complex examples it may involve side-effects like updating a mutable data structure to log progress.

This mapping from state to diagram to class is pretty pleasant. Folks really like to implement each state as a distinct class. It somehow feels really solid.

It's import to note the loneliness of the lonely signal() method. It's all by itself in that big, empty class.

Hint. This could be a function.

It's also important to note that this kind of design is subject to odd, unpleasant design tweaks. Ideally, the transition is *only* done by the lonely signal() method. Nothing stops the unscrupulous programmer from putting state transitions in other methods. Sigh.

We'll look at more complex kinds of state transitions later. In the UML state chart diagrams sates may also have entry actions and exit actions, a bit more complex behavior than we we're showing in this example.

A Functional Implementation

What's the alternative? Instead of modeling state as an object with methods for behavior, we can model state as a function. The state is a function that transitions to the next state.

def even(bit: int) -> ParityF:
if bit % 2 == 1:
return odd
else:
return even


def odd(bit: int) -> ParityF:
if bit % 2 == 1:
return even
else:
return odd


def parity_check(message: Iterable[int], init: ParityF = None) -> ParityF:
parity = init or even
for bit in message:
parity = parity(bit)
return parity


def even_parity(p: ParityF) -> bool:
return p is even

Each state is modeled by a function.

The parity_check() function examines each bit, and applies the current state function (either even() or odd()) to compute the next state, and save this as the vakue of the parity variable.

What's the ParityF type? This:

from typing import Protocol


class ParityF(Protocol):
def __call__(self, bit: int) -> "ParityF":
...

This uses a Protocol to define a type with a recursive cycle in it. It would be more fun to use something like ParityF = Callable[[int], "ParityF"], but that's not (yet) supported.

Some Extensions

What if we need each state to have more attributes?

Python functions have attributes. Like this: even.some_value = 2; odd.some_value = 1. We can add all the attributes we require.

What about other functions that happen on entry to a state or exit from a state? This is trickier. My preference is to use a class as a namespace that contains a number of related functions.

class Even:
@staticmethod
def __call__(bit: int) -> ParityF:
if bit % 2 == 1:
odd.enter()
return odd
else:
return even
@staticmethod
def enter() -> None:
print("even")

even = Even()

This seems to work out well, and keeps each state-specific material in a single namespace. It uses static methods to follow the same design principle as the previous example -- these are pure functions, collected into the class only to provide a namespace so we can use odd.enter() or even.enter().

TL;DR

The State design pattern isn't required to implement a FSA.

Categories: FLOSS Project Planets

testmon: pytest-testmon v1.4 with xdist support is out.

Planet Python - Tue, 2022-11-29 03:49

I'm happy to announce that this long-standing limitation of pytest-testmon has been fixed.

To find more go to: New features in 1.4.x

Categories: FLOSS Project Planets

Talk Python to Me: #391: Pyscript powered by MicroPython

Planet Python - Tue, 2022-11-29 03:00
No Python announcement of 2022 was met with more fanfare than pyscript. This project, announced at PyCon 2022, allows you to write Python files and run them in your browser in place of JavaScript or even with interactions between Python and JavaScript. There was just one catch: The runtime download was a 9MB WebAssembly file. That made its uses quite limited. <br/> <br/> On this episode, we dive into some news that might change that calculus. The MicroPython and PyScript folks have been teaming up to get PyScript running in the browser on MicroPython. Yes, that's the embedded chip Python. Here's the good news: MicroPython's WebAssembly is just 300k to download and loads in under 100ms. Now that could unlock some possibilities. <br/> <br/> We have Brett Cannon, Nicholas Tollervey, and Fabio Pliger on the show to discuss. <br/> <br/> <br/> YOUTUBE: id=ABVn6uMG1OI<br/> <br/> <strong>Links from the show</strong><br/> <br/> <div><b>Guests and Host Links</b><br/> <b>Brett Cannon</b>: <a href="https://fosstodon.org/@brettcannon" target="_blank" rel="noopener">@brettcannon@fosstodon.org</a><br/> <b>Nicholas Tollervey</b>: <a href="https://mastodon.social/@ntoll" target="_blank" rel="noopener">@ntoll@mastodon.social</a><br/> <b>Fabio Pliger</b>: <a href="https://twitter.com/b_smoke" target="_blank" rel="noopener">@b_smoke</a><br/> <b>Michael Kennedy</b>: <a href="https://fosstodon.org/@mkennedy" target="_blank" rel="noopener">@mkennedy@fosstodon.org</a><br/> <br/> <b>Web Assembly</b>: <a href="https://developer.mozilla.org/en-US/docs/WebAssembly" target="_blank" rel="noopener">developer.mozilla.org</a><br/> <b>pyodide</b>: <a href="https://pyodide.org/en/stable/" target="_blank" rel="noopener">pyodide.org</a><br/> <b>micropython</b>: <a href="https://www.micropython.org" target="_blank" rel="noopener">micropython.org</a><br/> <b>Picture of TFT ESP32 Board</b>: <a href="https://pythonbytes.fm/episodes/youtube_image/A8nwbD3loIs" target="_blank" rel="noopener">pythonbytes.fm</a><br/> <b>pyscript</b>: <a href="https://pyscript.net" target="_blank" rel="noopener">pyscript.net</a><br/> <b>Simon Willison's Post About micropython + pyscript</b>: <a href="https://fedi.simonwillison.net/@simon/109314695365668203" target="_blank" rel="noopener">fedi.simonwillison.net</a><br/> <b>WASI</b>: <a href="https://github.com/WebAssembly/WASI" target="_blank" rel="noopener">github.com</a><br/> <b>Watch this episode on YouTube</b>: <a href="https://www.youtube.com/watch?v=ABVn6uMG1OI" target="_blank" rel="noopener">youtube.com</a><br/> <b>Episode transcripts</b>: <a href="https://talkpython.fm/episodes/transcript/391/pyscript-powered-by-micropython" target="_blank" rel="noopener">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" rel="noopener">youtube.com</a><br/> <b>Follow Talk Python on Mastodon</b>: <a href="https://fosstodon.org/web/@talkpython" target="_blank" rel="noopener"><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" rel="noopener"><i class="fa-brands fa-mastodon"></i>mkennedy</a><br/></div><br/> <strong>Sponsors</strong><br/> <a href='https://talkpython.fm/awsinsiders'>AWS Insiders</a><br> <a href='https://talkpython.fm/max'>Local Maximum Podcast</a><br> <a href='https://talkpython.fm/assemblyai'>AssemblyAI</a><br> <a href='https://talkpython.fm/training'>Talk Python Training</a>
Categories: FLOSS Project Planets

Python Bytes: #312 AI Goes on Trial For Writing Code

Planet Python - Tue, 2022-11-29 03:00
<a href='https://www.youtube.com/watch?v=BTVrhmcjy9c' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored by <a href="https://pythonbytes.fm/compiler"><strong>Complier Podcast from RedHat</strong></a></p> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy"><strong>@mkennedy@fosstodon.org</strong></a></li> <li>Brian: <a href="https://fosstodon.org/@brianokken"><strong>@brianokken@fosstodon.org</strong></a></li> </ul> <p><strong>Brian #1:</strong> <a href="https://simonwillison.net/2022/Nov/26/productivity/"><strong>Coping strategies for the serial project hoarder</strong></a></p> <ul> <li>Simon Willison</li> <li>Also a talk from DjangoCon2022 <ul> <li><a href="https://www.youtube.com/watch?v=GLkRK2rJGB0">Massively increase your productivity on personal projects with comprehensive documentation and automated tests.</a></li> </ul></li> <li>I’m actually not sure what title would be best, but this is an incredible video that I’m encouraging every developer to watch, whether or not you work with open source projects.</li> <li>Covers <ul> <li>The perfect commit <ul> <li>Implementation, Tests, Documentation, and a link to an issue thread</li> </ul></li> <li>Tests <ul> <li>Prove the implementation works, pass if it works, fails otherwise</li> <li>A discussion of how adding tests is way easier than starting testing a project, so get the framework in place early, and devs won’t be afraid to add to it.</li> </ul></li> <li>Cookiecutter repo templates for projects you will likely start <ul> <li>super cool idea to have your own that you keep up to date with your preferred best practices</li> </ul></li> <li>A trick for using GitHub actions to use those templates to populate new repos <ul> <li>Trying this out is on my todo list</li> </ul></li> <li>Documentation must live in the same repo as the code <ul> <li>and be included in PRs for the PR to be accepted by code review</li> <li>maybe even test this using documentation unit tests</li> </ul></li> <li>Everything links to an issue thread <ul> <li>Keep all of your thoughts in an issue thread</li> <li>Doesn’t have to be a dialog with anyone but yourself</li> <li>This allows you to NOT HAVE TO REMEMBER ANYTHING</li> </ul></li> <li>Tell people what you did <ul> <li>This is just as important in work projects as it is in open source</li> <li>Blog about it </li> <li>Post on Twitter (or Mastodon, etc.)</li> </ul></li> <li>Avoid side projects with user accounts <ul> <li>“If you build something that people can sign into, that’s not a side-project, it’s an unpaid job. It’s a very big responsibility, avoid at all costs!” - this is hilarious and something I’m probably not going to follow</li> </ul></li> </ul></li> </ul> <p><strong>Michael #2:</strong> <a href="https://githubcopilotlitigation.com/"><strong>GitHub copilot lawsuit</strong></a></p> <ul> <li>First, we aren’t lawyers</li> <li>Lawsuit filed on November 3, 2022</li> <li>We’ve filed a lawsuit challenging GitHub Copilot, an AI product that relies on unprecedented open-source software piracy.</li> <li>GitHub copilot is trained on projects on GitHub, including GPL and other restrictive licenses</li> <li>This is the first class-action case in the US challenging the training and output of AI systems.</li> </ul> <p><strong>Brian #3:</strong> <a href="https://mfcallahan.blog/2022/11/10/display-a-message-box-with-python-without-using-a-library-or-other-dependency-windows/"><strong>Use Windows Dialog Boxes from Python with no extra libraries</strong></a></p> <ul> <li>Actual title: <strong>Display a message box with Python without using a non-standard library or other dependency (Windows)</strong></li> <li>By Matt Callahan / learned about from from PyCoders weekly</li> <li>When I need a simple pop up dialog box that’s cross platform, <a href="https://www.pysimplegui.org/en/latest/">PySimpleGUI</a> is awesome and so easy.</li> <li>But when I KNOW it’s only going to run on Windows, why not just use native dialog boxes?</li> <li>Matt’s article shows you how, using <a href="https://docs.python.org/3/library/ctypes.html?utm_source=pocket_saves">ctypes</a> to call into a Windows dll.</li> <li><p>Small example from article:</p> <pre><code>import ctypes def main(): WS_EX_TOPMOST = 0x40000 windowTitle = "Python Windows Message Box Test" message = "Hello, world!" # display a message box; execution will stop here until user acknowledges ctypes.windll.user32.MessageBoxExW(None, message, windowTitle, WS_EX_TOPMOST) print("User clicked OK.") if __name__ == "__main__": main() </code></pre></li> <li><p>Notes:</p> <ul> <li>The uType (fourth) parameter is a multi-use value that can be or-ed for things like: <ul> <li>Type of dialog box: Help, OK, OK/Cancel, Retry/Cancel, Yes/No, etc.</li> <li>The icon to use: Exclamation, Info, Question, etc.</li> <li>Modality, …</li> </ul></li> <li>Return value is used to understand how user reacted: <ul> <li>1 - OK, 2 - Cancel (or x), …, 6 - Yes, 7 - No, …</li> </ul></li> </ul></li> </ul> <p><strong>Michael #4:</strong> <strong>Extra Extra Extra</strong></p> <ul> <li><a href="https://twitter.com/pycoders/status/1593259414437478400"><strong>Python browser extensions</strong></a> </li> <li><a href="https://jointakahe.org"><strong>takahe</strong></a> - Mastodon on Python - the right way</li> <li><a href="https://mkennedy.codes/posts/black-friday-almost-melted-servers/"><strong>Michael’s article in Black Friday perf</strong></a> <ul> <li>We could scale down our server after what I’ve learned. But we’d pay 10x more in bandwidth overages ironically: Last month Talk Python broadly transferred 20.2 TB of data from our servers</li> </ul></li> <li>Moved our static traffic to <a href="https://bunny.net?ref=b4f3tqcyae"><strong>Bunny CDN</strong></a>, highly recommended service</li> <li>RSS revival <ul> <li>My blog: <a href="https://mkennedy.codes"><strong>mkennedy.codes</strong></a> </li> <li><a href="https://reederapp.com"><strong>Reeder 5 app</strong></a> on iOS and macOS</li> </ul></li> <li>Rivers Cuomo (from Weezer) and Guido <a href="https://www.singforscience.org/episodes/rivers-cuomo-guido-van-rossum"><strong>sit down for a talk together</strong></a> <ul> <li>Also check out the Talk Python episode with Rivers: <a href="https://talkpython.fm/episodes/show/327/little-automation-tools-in-python"><strong>talkpython.fm/327</strong></a></li> </ul></li> <li><a href="http://www.libhunt.com/ahoy/messages/ARRuCh7igpeLGSpmZv3TX5meA1oAEq79/click?signature=487fbf5cec0d22c6fdf56d1cfccc493fac8d2044&amp;url=https%3A%2F%2Fwww.kite.com%2Fblog%2Fproduct%2Fkite-is-saying-farewell"><strong>Kite is saying farewell</strong></a></li> </ul>
Categories: FLOSS Project Planets

Specbee: Things you need for a Drupal 8 to Drupal 9 Upgrade - A Checklist

Planet Drupal - Tue, 2022-11-29 02:39
Things you need for a Drupal 8 to Drupal 9 Upgrade - A Checklist Chaitanya R Dessai 29 Nov, 2022 Subscribe to our Newsletter Now Subscribe Leave this field blank

Since Drupal 8, upgrades to the subsequent versions are meant to be way easier than in the past. And by all accounts, that’s been accomplished! Even though Drupal 8 to Drupal 9 is a major release and upgrade, it almost feels like a minor release upgrade. There’s no rebuild that needs to be done when updating from Drupal 8.9 to Drupal 9.0 because they are almost the same. Only deprecated code should be removed and dependency libraries (Symfony, PHP, etc.) should be upgraded to the latest version.

If you’re looking for a quick, no-frills checklist article to guide you through your Drupal 8 to Drupal 9 upgrade, you have arrived just at the right place. Take a look!

Tools you will need for an effective upgrade
  • Upgrade Status: Install tools like Upgrade Status will give you a list of modules and themes that need to be worked on or are up-to-date.
  • Drupal-Check: This one’s a very useful analysis tool that checks for the correctness of classes and reports errors found in deprecated core or contributed modules.
  • Upgrade Rector: Install the Upgrade Rector modules as it helps in fixing deprecation errors for the modules installed. It provides code fix suggestions and makes it easy to generate patches for them.
A Compatible Hosting Environment

Now here’s what you need for a compatible hosting environment to welcome your brand new Drupal 9 site:

  • Apache version must be 2.4.7
  • Php version should be 7.4 or 8
  • MySQL version should be 5.7.8+
Using the Upgrade Status Module

Using the Upgrade status module, you can find out what changes you need to make to make your website compatible with Drupal 9.

Go to Admin -> Reports -> Upgrade status. Now select the modules/themes and click on the Scan selected button.

Checklist for a Quick Drupal 8 to 9 Upgrade
  1. Make sure the current core version of your website is updated. It should be 8.8.x or 8.9.x.
  2. Document the libraries and themes installed on the website. List all the contributed and custom themes that are installed on the website. 
  3. Document contributed and custom modules installed on the website. The Upgrade Status module can assist in identifying the modules. This module inspects the website, gives information about the modules compatible with Drupal 9, and suggests updating them to the latest version if any of them have been released. Upgrade Status also suggests removing modules that have been disabled.
  4. Identify deprecated code. The Drupal-check module can be used to identify the deprecations for modules and themes.
  5. Update the contributed modules. Update contributed modules to the latest compatible version of Drupal 9.
  6. Update the custom modules. You will need to manually update the code to make custom modules compatible with Drupal 9. Add the core version requirement key in info.yml file.
  7. Update the contributed themes. Update contributed themes to the latest compatible version of Drupal 9.
  8. Update the custom themes. To make custom themes compatible with Drupal 9, any deprecation code needs to be removed/updated. Add the core version requirement key in info.yml file.
  9. Make sure that the libraries are compatible with Drupal 9. For example, if your website is using the jquery timepicker library then it should be upgraded to the latest version which is 1.14.0 in the composer.json file.
  10. Make sure that the unused modules are uninstalled. Remove unused modules using composer.
  11. Update the core codebase to Drupal 9. Once all the modules, themes and libraries are compatible with Drupal 9, add drupal/core-composer-scaffold, drupal/core-recommended specifying the Drupal version in composer.json and run the composer update.
"drupal/core-composer-scaffold" : "^9.2" , "drupal/core-recommended" : "^9.2" , Final Thoughts

And that’s it! You have successfully upgraded your Drupal 8 website to Drupal 9. Wasn’t that easy? If you’re looking for further assistance with your Drupal site, talk to our Drupal experts today.

Author: Chaitanya R Dessai

Meet Chaitanya R Dessai, a Drupal Developer who is a Cricket fanatic and dreams about traveling to Switzerland and North America. And if he sees a cool car drive by, nothing can stop him from turning his head for a second look!

Drupal Drupal 9 Drupal 8 Drupal Module Drupal Development Drupal Planet

Leave us a Comment

  Recent Blogs Image Things you need for a Drupal 8 to Drupal 9 Upgrade - A Checklist Image Getting Started with Layout Builder in Drupal 9 - A Complete Guide Image Why You Should Consider Being on Social Media Beyond Your Doubts? Need help Upgrading to Drupal 9 Schedule a call Featured Success Stories

Upgrading and consolidating multiple web properties to offer a coherent digital experience for Physicians Insurance

Upgrading the web presence of IEEE Information Theory Society, the most trusted voice for advanced technology

Great Southern Homes, one of the fastest growing home builders in the United States, sees greater results with Drupal 9

View all Case Studies
Categories: FLOSS Project Planets

OpenSense Labs: Overview of Drupal & Pattern Lab

Planet Drupal - Tue, 2022-11-29 02:27
Overview of Drupal & Pattern Lab Maitreayee Bora Tue, 11/29/2022 - 12:57

The way companies are developing their products is changing. That’s because more people are accessing websites in more ways than ever before. To create and innovate at a faster pace, developers are leveraging reusable components. Pattern Lab is one such front-end framework that uses atomic design architecture to execute the component-based design. Reusability and portability of components are the prime reasons for its fast-gaining popularity. 

In this blog, we’ll cover what Pattern Lab is, and how developers can use it with Drupal to create their own frontend library and accelerate their product development. 

What is Pattern Lab?

Pattern Lab is based on Brad Frost’s Atomic Design concept. Pattern Lab proves to be one of the best dynamic prototyping and organization tools for professionals. It is easily available for download on GitHub and can be used as part of existing or new projects. 

It helps in transforming pattern templates, authored by developers, into a full-featured, static site. Easy to learn, it can be used in different types of projects. In fact, it can also be used as a front-end style guide, a rapid prototyping tool, and the actual templates powering one or more live sites. It uses atomic design for accelerating the process of creating modular designs.


Now, let’s break down the above visual building blocks:

  • Atoms: They are the basic building blocks of design. For example, UI elements such as buttons, search fields, form elements, and labels.
     
  • Molecules: These are groups of atoms that work together for performing a particular action. For example, search navigation involves a combination of atoms such as a search button, a search field, and a label.
     
  • Organisms: These are molecules and atoms grouped together to define sections of the application. They’re more complex and also have more interactions. For example, a footer a header, or a related blog post section.
     
  • Templates: Groups of organisms form Templates. They are placeholders for organisms. For example, a login page template, a blog page template, or a shopping cart page template.
     
  • Pages: When we combine a template with real content, we get a page.
Pattern Lab with Drupal

Pattern Lab has become popular in the Drupal community, since the release of Drupal 8 with Twig. The combination of Pattern Lab and Drupal leads to better performance of Drupal websites that are complex in nature. Pattern Lab ensures that its Twig templates and CSS can be consumed like a service by Drupal.

Contributed theme such as Emulsify Drupal that comes with inbuilt the Pattern Lab architecture. Emulsify is basically a component-driven prototyping tool that uses atomic design principles and modern frontend practices in order to build a living style guide. It can be executed easily into any CMS for rendering twig files since it adopts the methodology where the smallest components are atoms, which are assembled into organisms, molecules, templates, and pages.

Emulsify authorizes us to manage and assemble components in a way that improves the workflow by integrating Pattern Lab. So, the Emulsify-based project works with custom template names that are very particular to the project, clients, and developers. This helps in segregating the category-wise patterns (modules) and also increases the expertise of the process.

When the templates are ready for production, Emulsify then connects them to Drupal in a non-complex way as a Twig function (include, extend, or embed) and connects the Drupal templates to the component files.

Emulsify prioritizes a "living style guide" approach where the style guide components are basically the same ones in use on the live websites. And we do not need to worry about the components becoming outdated or more unusual than the normal style guide.

Why should we use Pattern Lab?

Let’s now look at why should we use Pattern Lab.

  1. Dynamic Data: Patterns are supposed to be authored to work with dynamic data. Example data files are easily customizable, included, and available to templates. Also, we will find a global set of data and the capability to customize per component, and variant. This will further encourage writing templates in such a manner that they can also be used outside of the pattern lab, with real data.
     
  2. Organization and Presentation: A high-level structure, or groups, based on "Atomic Design" principles is offered in Pattern Lab. We can choose to work within that structure or change the terminology to whatever fits our wants by directly renaming file system directories. These groups happen to turn into dropdown menus, that expands in order to show all the pattern templates in that group and also allow navigating to them. This indeed makes it very simple for the team members to browse and discover what patterns actually exist.
     
  3. Proper documentation: Documentation can be easily added at group and component levels, as wished, by simply adding a markdown file, with the same name. This documentation happens to be exposed in the static site, along with the source code of the template.
     
  4. Variants: It’s very common to have several variants of a pattern. For instance, in a typical "Hero" pattern we might just have a "light" and "dark" version. So, basically, Pattern Lab supports variants, which it calls "Pseudo Patterns" and displays them very clearly in the static build. 
Conclusion

By implementing Pattern Lab, teams can quickly prototype and iterate without multiple rounds of expensive redesigns with the help of traditional design flats. It enables us to be more efficient when it comes to multi-device testing and cross-browser and also makes the job of a front-end developer a lot easier and more fun. 

Pattern Lab supports keeping designers, developers, and stakeholders on track in regard to visual decisions. So, if we prioritize brand consistency, and value design, and wish to have a website that works in a very effective way both on the front-end and the back-end then Pattern Lab is the right choice.
 

Articles Off
Categories: FLOSS Project Planets

Evolving Web: Maintaining and Growing Your Digital Platform: UX/UI Considerations

Planet Drupal - Tue, 2022-11-29 01:36

Every website has the potential to deliver ever-better results. The trick? Continuous evolution. Your digital presence should be a living thing that’s always adjusting to stay relevant and valuable. 

I like to think of a website as a houseplant. Give it some tender love and care and you’ll be rewarded with freshness and growth. But neglect it or add the wrong things and you’ve got a mess on your hands. 

Image

 

This article explains how to nurture your digital platform, with a focus on Drupal sites. You’ll also learn how to avoid common pitfalls that weaken the user experience. Here’s what we’ll cover:

  • Preparing your team to update your site
  • Creating a strategic plan for new pages 
  • Structuring new pages with web components
  • Creating compelling content
  • Using WYSIWYG for unique content needs
Preparing Your Team

Make sure your whole team is on the same page and following the same ground rules. This will help you save time and money, ensure consistency and quality, and ultimately set you up for success. 

Here are some tips to get your team ready:

  • On-board: Familiarize team members with your style guide and branding guidelines, as well as your site’s design, structure and web components.
  • Train: Ensure web editors and developers understand how Drupal works and give them time to practice. Consider building your in-house expertise with Drupal training
  • Manage: Create clear processes for approval and quality control. Ensure team members have the appropriate permissions in Drupal. 
Image Creating a Strategic Plan

Before you create a new page (or update an existing one) you need to figure out its overall goal. What value does it offer to users? Where are they going next? What business objectives are you hoping to achieve?

Ensure new pages have a purposeful place in your site architecture, your brand story and the user journey. Pin down the key messages and calls to action you need to convey. 

Don’t be tempted to skip or rush this stage. It’s all too easy for websites to get bogged down with pages that do little to enhance the user experience – or worse, impair it. 

If you’re lacking the internal capabilities to plan new pages, consider adding a digital strategist to your team, investing in content strategy training or hiring an agency for your digital strategy needs

Structuring the Page Using Web Components

Once you know why you need a new page, you can start structuring and visualizing it. Create mockups and wireframes using a tool such as Miro or Figma. It’s important to leverage the brand elements and web components that are available to you. 

Image

 

Brand elements are tangible representations of your brand identity and character. They can include your logo, typography, colour palette, and shapes. Featuring them will create a recognizable look and feel and help you build brand equity. 

Web components are powerful tools for creating balanced and visually striking pages. They allow for variation and creativity while helping you maintain consistency across your platform. 

Here are some tips to make the most of your web components:

  • Tell a story. Choose components that enhance the message you want to convey. Structure them in a way that creates a clear narrative on the page. 
  • Use variety. If you need to use the same component twice, try a different background colour or image alignment (left / right) to create contrast.
  • Hire a digital strategist or UX designer. It’s worth getting help from an expert to translate your strategy into a meaningful user experience. 
Creating Compelling Content

Consider developing the content and wireframes in parallel and incrementally to ensure they work together. At the very least you should have an idea of the key messages you want to convey in each section when you structure the page.

The quality of your content has a huge impact on the success of a new page. Here are some tips to ensure your message makes its mark: 

  • Write for components. Think about how the content will fit. Check character count specifications and avoid forcing components to adapt to your copy.
  • Use a consistent style. For example, if you use title case for headings then make sure this is applied to all of them. Give content creators clear style guidelines to prevent inconsistencies that may take a lot of time to fix.
  • Avoid ‘orphans’. These are single words on their own line. It’s possible to add non-breaking spaces in the front-end but this isn’t best practice. 
  • Make it easy to read. Follow best practices for writing for the web such as using the active voice and keeping paragraphs short. It’s worth hiring a copywriter if you don’t have one in-house. 
  • Consider the translation. If your website is bilingual, think about how the content will look when it’s translated. For example, a French version is usually longer than an English version.
  • Select images carefully. Ensure images are high-quality and aligned with your organization’s offering and personality. Prepare them to fit the component specifications. 
  • Finalize content outside Drupal. Ensure copy and images are approved before you populate the new page with them.
Image Using WYSIWYG for Unique Content Needs

WYSIWYG stands for “what you see is what you get.” The WYSIWYG Editor can give you more creative freedom than web components. But this brings a higher risk of breaking the design or creating accessibility issues. Try not to use WYSIWYG unless absolutely necessary, such as for content-heavy pages and unique content needs. Include web components on WYSIWYG pages wherever possible. 

Here are some tips to help you use the WYSIWYG Editor successfully:

  • Test the page on all devices. Ensure the content looks good across desktop, tablet and mobile. Look at each breakpoint carefully before publishing a page.
  • Add images to make the content more engaging. Try to use large images or videos that fill the container for a bolder and more balanced composition. 
  • Prepare images carefully. Remember that the WYSIWYG Editor doesn’t necessarily adapt images to specific sizes. Use a consistent ratio and size.
  • Follow your style and branding guidelines. Pay attention to things like typography, heading and link styles, colour palettes, and buttons.
  • Optimize web accessibility. For example, use headings (H1-H5) in chronological order so you don’t cause issues for screenreaders.
  • See if you need new components. If you find you often have to use WYSIWYG to meet your content needs, consider getting new web components created instead.
Image Need More Guidance?

This article gives you a strong starting point for maintaining and growing your digital platform.

Need specific advice?

//--> //--> //--> //-->

+ more awesome articles by Evolving Web
Categories: FLOSS Project Planets

KDE Plasma 5.26.4, Bugfix Release for November

Planet KDE - Mon, 2022-11-28 19:00

Tuesday, 29 November 2022. Today KDE releases a bugfix update to KDE Plasma 5, versioned 5.26.4.

Plasma 5.26 was released in October 2022 with many feature refinements and new modules to complete the desktop experience.

This release adds three weeks' worth of new translations and fixes from KDE's contributors. The bugfixes are typically small but important and include:

  • Bluedevil: Install translated documentation from po/ too. Commit.
  • Discover: Prefer openining the installed version of an app. Commit. Fixes bug #461664
  • Discover Packagekit: check free space when update size changes. Commit.
View full changelog
Categories: FLOSS Project Planets

Declassed Art: torcontrol and Tor circuits managers

Planet Python - Mon, 2022-11-28 19:00
Stem did not encourage me to read specifications. I f*cked error handling up and now proudly introduce my own minimalistic Tor controller.
Categories: FLOSS Project Planets

Jelmer Vernooij: Detecting Package Transitions

Planet Debian - Mon, 2022-11-28 18:04

Larger transitions in Debian are usually announced on e.g. debian-devel, but it’s harder to track the current status of all transitions. Having done a lot of QA uploads recently, I have on occasion uploaded packages involved in a transition. This can be unhelpful for the people handling the transition, but there’s also often not much point in uploading if your uploads are going to get stuck.

Talking to one of the release managers at a recent BSP, it was great to find out that the release team actually publish a data dump with which packages are involved in which transitions.

Here’s the script I use to find out about the transitions the package in my current working directory is involved in:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26#!/usr/bin/python3 from urllib.request import urlopen import sys from debian.deb822 import Deb822 import yaml with open('debian/control', 'r') as f: package = Deb822(f)['Source'] with urlopen("https://release.debian.org/transitions/export/packages.yaml") as f: data = yaml.safe_load(f) def find_transitions(data, package): for entry in data: if entry['name'] != package: continue return dict(entry['list']) return {} transitions = find_transitions(data, package) print(transitions) sys.exit(1 if 'ongoing' in transitions.values() else 0)

In practice, the output looks something like this:

$ debcheckout bctoolbox git clone https://salsa.debian.org/pkg-voip-team/linphone-stack/bctoolbox.git bctoolbox ... Cloning into 'bctoolbox'... ... $ cd bctoolbox $ in-transition.py {'auto-upperlimit-libbctoolbox1': 'ongoing'}
Categories: FLOSS Project Planets

Migrating dinner plans

Planet KDE - Mon, 2022-11-28 18:00

It’s fall, the leaves are on the ground, there are pumpkins on the table (and my local vegetable farm has blogged that the seasons are so screwed up due to climate change that it is no longer predictable which veggies show up when) and so, stew and hearty soup season is upon us.

“If I was to become a vegetarian, what kind of stew would we eat?” was a question kid[1] (the only one still at home) put to me. Good question. I have vague ideas about lentils and celery root and beans and tahin, but nothing as concrete as my beef stew recipe (1 chunk of cow, 1 bottle of beer, 6 onions, 1 potato and seasoning). It bears investigating.

Since kid[0] left the house – and they were the principled vegetarian here – we’ve relapsed to flexitarian habits, 1 meat, 6 vegetarian dinners a week with an accidentally-vegan thrown in with some regularity.

As an odd coincidence, both SMBC and my (paper!) paper NRC published something about eating invasive species this week. Household consensus is that if the cook cuts themself while making dinner, it’s still vegetarian.

I’ll leave you with a concrete recipe (if you come over this evening, this is what’s for dinner).

  • 1 pumpkin
  • 6 carrots
  • 2 potatoes
  • 2 bouillion cubes
  • 1 tablespoon curry powder, the nasty yellowish stuff from the supermarket
  • 2 tablespoons dried parsley or chives

Put all but the parsley in a big pot. Add water to just about cover the veggies. Boil softly for 20-25 minutes. Staafmix the heck out of it (um .. puree? I have not used this particular kitchen utensil in an English-speaking kitchen, so I wouldn’t know what verb to use for “apply a staafmixer until smooth”). Stir in the parsley.

Serve with fresh-baked bread.

Categories: FLOSS Project Planets

Andy Wingo: are ephemerons primitive?

GNU Planet! - Mon, 2022-11-28 16:11

Good evening :) A quick note, tonight: I've long thought that ephemerons are primitive and can't be implemented with mark functions and/or finalizers, but today I think I have a counterexample.

For context, one of the goals of the GC implementation I have been working on on is to replace Guile's current use of the Boehm-Demers-Weiser (BDW) conservative collector. Of course, changing a garbage collector for a production language runtime is risky, and for Guile one of the mitigation strategies for this work is that the new collector is behind an abstract API whose implementation can be chosen at compile-time, without requiring changes to user code. That way we can first switch to BDW-implementing-the-new-GC-API, then switch the implementation behind that API to something else.

Abstracting GC is a tricky problem to get right, and I thank the MMTk project for showing that this is possible -- you have user-facing APIs that need to be implemented by concrete collectors, but also extension points so that the user can provide some compile-time configuration too, for example to provide field-tracing visitors that take into account how a user wants to lay out objects.

Anyway. As we discussed last time, ephemerons are usually have explicit support from the GC, so we need an ephemeron abstraction as part of the abstract GC API. The question is, can BDW-GC provide an implementation of this API?

I think the answer is "yes, but it's very gnarly and will kill performance so bad that you won't want to do it."

the contenders

Consider that the primitives that you get with BDW-GC are custom mark functions, run on objects when they are found to be live by the mark workers; disappearing links, a kind of weak reference; and finalizers, which receive the object being finalized, can allocate, and indeed can resurrect the object.

BDW-GC's finalizers are a powerful primitive, but not one that is useful for implementing the "conjunction" aspect of ephemerons, as they cannot constrain the marker's idea of graph connectivity: a finalizer can only prolong the life of an object subgraph, not cut it short. So let's put finalizers aside.

Weak references have a tantalizingly close kind of conjunction property: if the weak reference itself is alive, and the referent is also otherwise reachable, then the weak reference can be dereferenced. However this primitive only involves the two objects E and K; there's no way to then condition traceability of a third object V to E and K.

We are left with mark functions. These are an extraordinarily powerful interface in BDW-GC, but somewhat expensive also: not inlined, and going against the grain of what BDW-GC is really about (heaps in which the majority of all references are conservative). But, OK. They way they work is, your program allocates a number of GC "kinds", and associates mark functions with those kinds. Then when you allocate objects, you use those kinds. BDW-GC will call your mark functions when tracing an object of those kinds.

Let's assume firstly that you have a kind for ephemerons; then when you go to mark an ephemeron E, you mark the value V only if the key K has been marked. Problem solved, right? Only halfway: you also have to handle the case in which E is marked first, then K. So you publish E to a global hash table, and... well. You would mark V when you mark a K for which there is a published E. But, for that you need a hook into marking V, and V can be any object...

So now we assume additionally that all objects are allocated with user-provided custom mark functions, and that all mark functions check if the marked object is in the published table of pending ephemerons, and if so marks values. This is essentially what a proper ephemeron implementation would do, though there are some optimizations one can do to avoid checking the table for each object before the mark stack runs empty for the first time. In this case, yes you can do it! Additionally if you register disappearing links for the K field in each E, you can know if an ephemeron E was marked dead in a previous collection. Add a pre-mark hook (something BDW-GC provides) to clear the pending ephemeron table, and you are in business.

yes, but no

So, it is possible to implement ephemerons with just custom mark functions. I wouldn't want to do it, though: missing the mostly-avoid-pending-ephemeron-check optimization would be devastating, and really what you want is support in the GC implementation. I think that for the BDW-GC implementation in whippet I'll just implement weak-key associations, in which the value is always marked strongly unless the key was dead on a previous collection, using disappearing links on the key field. That way a (possibly indirect) reference from a value V to a key K can indeed keep K alive, but oh well: it's a conservative approximation of what should happen, and not worse than what Guile has currently.

Good night and happy hacking!

Categories: FLOSS Project Planets

Pages