Author: drweb

You write a script, hit run, and Python throws NameError at you. The traceback names a symbol you thought you had defined. You scroll up, the definition is right there, and the error still fires. You do not need to guess which case you are in. Read the traceback, look at the line number, and check each common cause in order. Python uses the word NameError for one specific thing: you tried to use a name, and the interpreter could not find anything bound to that name in the scope it was looking in. The fix depends on which cause…

Read More

Modern software development moves at a pace that would have been unthinkable a decade ago. Organizations push updates on demand, respond to vulnerabilities within minutes, and integrate new features at a relentless pace. This acceleration is driven by continuous integration and continuous delivery (CI/CD).To understand how CI/CD reshapes the security posture of modern organizations, it’s helpful first to define it clearly: What is CI/CD and how does it transform the way software is built, tested and deployed?What is CI/CD?CI/CD refers to a set of tools and practices that automate the integration, testing, and delivery of software. The “CD” portion of…

Read More

Python raises a TypeError when a function call passes a keyword argument the function’s signature does not accept. The traceback names the offending argument so you can fix the call site, the function definition, or both. An unexpected keyword argument TypeError means the function definition does not name the argument you passed. The fix is to align the call with the signature, accept the argument with **kwargs, or remove the argument at the call site. Reproducing the error Define calculate with one positional parameter and call it with an extra keyword argument: import math def calculate(num): return math.factorial(num) ans =…

Read More

Toronto, Canada, July 6th, 2026, CyberNewswireMost software composition analysis tools read what developers declare. Insignary Clarity’s patented binary-first platform analyzes what is actually built, shipped, and deployed — including the open-source components that never appear in any manifest. Insignary, Inc., whose patented binary fingerprint technology has been cited in four Gartner research reports, today announced its recognition as a Sample Vendor for Reachability Analysis in the Gartner Hype Cycle for Secure Software Engineering, 2026.According to Gartner: “Open-source and third-party components may contain a long list of vulnerabilities, but not all of them directly impact your code base. Reachability analysis helps…

Read More

I had a tuple of integers from a config file and a NumPy function that expected an array. The conversion was a one-liner, but I wanted to be deliberate about which one I called. Tuple, list, array module, NumPy. Each is a different type with a different cost, and the answer changes the downstream code. The exact path you take depends on what you are about to do with the result. Below are the four ways I reach for, when each one is the right pick, and the small gotchas I have hit with each. The four ways to convert…

Read More

Last quarter I had to plan a 12-stop delivery loop and the route my gut picked came out 38% longer than the version a small Python script returned in under a second. That gap is the travelling salesman problem (TSP): given a set of cities and the distance between every pair, find the shortest loop that visits each city once and returns to the start. TSP is NP-hard in general, but two simple methods cover the small and medium cases we actually meet in shipping scripts. Greedy nearest-neighbour runs in O(n²). Brute force tries every permutation and gives you the…

Read More

A newly discovered supply chain security flaw is once again putting a spotlight on inherent weaknesses in CI/CD pipelines and the growing interest among cyberthreat actors to exploit them.Security researchers with Novee, an AI penetration testing platform provider, wrote about Cordyceps, an exploitable pattern in the open source supply chain that can allow attackers to hijack workflows and gain full control of code repositories, including those at dozens of the world’s largest companies, including Microsoft, Google, Python, Apache, and Cloudflare.In addition, the vulnerability can be exploited by any unauthenticated user, according to Elad Meged, founding engineer and security researcher at…

Read More

Last week a junior dev on my team had a list of route stops and a tuple of fallback hubs, and asked which Python incantation would fold the tuple into the list. The answer is not a single incantation. There are four ways, and each one changes the list in a different way. Adding a tuple to a list sounds like a corner case, but it shows up whenever you read a fixed-shape row from a database and want to merge it with a running list of results. Below are the four options, with runnable code and the actual output…

Read More

DevOps.com is now providing a weekly DevOps jobs report through which opportunities for DevOps professionals will be highlighted as part of an effort to better serve our audience.Our goal in these challenging economic times is to make it just that much easier for DevOps professionals to advance their careers.Of course, the pool of available DevOps talent is still relatively constrained, so when one DevOps professional takes on a new role, it tends to create opportunities for others.The ten job postings shared this week are selected based on the company looking to hire, the vertical industry segment and naturally, the pay…

Read More

Random colors are a small exercise with a surprisingly wide footprint. They show up in test fixtures, data visualization placeholders, avatar generators, and the first 20 minutes of any Python graphics tutorial. Below are five ways to generate a random color in Python, from the standard library alone to numpy and matplotlib. Each snippet is short enough to read in one screen, and each one returns a different shape of result. Method 1: the random module random.randint(0, 255) returns a uniform integer in the closed range 0 to 255. Call it three times and pack the results into a tuple.…

Read More