One of the most cherished science fiction scenarios is using a black hole as a portal to another dimension or time or universe. That fantasy may be closer to reality than previously imagined.
Black holes are perhaps the most mysterious objects in the universe. They are the consequence of gravity crushing a dying star without limit, leading to the formation of a true singularity – which happens when an entire star gets compressed down to a single point yielding an object with infinite density. This dense and hot singularity punches a hole in the fabric of spacetime itself, possibly opening up an opportunity for hyperspace travel. That is, a short cut through spacetime allowing for travel over cosmic scale distances in a short period.
Researchers previously thought that any spacecraft attempting to use a black hole as a portal of this type would have to reckon with nature at its worst. The hot and dense singularity would cause the spacecraft to endure a sequence of increasingly uncomfortable tidal stretching and squeezing before being completely vaporized.
Flying through a Black Hole
My team at the University of Massachusetts Dartmouth and a colleague at Georgia Gwinnett College have shown that all black holes are not created equal. If the black hole like Sagittarius A*, located at the center of our own galaxy, is large and rotating, then the outlook for a spacecraft changes dramatically. That’s because the singularity that a spacecraft would have to contend with is very gentle and could allow for a very peaceful passage.
The reason that this is possible is that the relevant singularity inside a rotating black hole is technically “weak,” and thus does not damage objects that interact with it. At first, this fact may seem counter intuitive. But one can think of it as analogous to the common experience of quickly passing one’s finger through a candle’s near 2,000-degree flame, without getting burned.
My colleague Lior Burko and I have been investigating the physics of black holes for over two decades. In 2016, my Ph.D. student, Caroline Mallary, inspired by Christopher Nolan’s blockbuster film “Interstellar,” set out to test if Cooper (Matthew McConaughey’s character), could survive his fall deep into Gargantua – a fictional, supermassive, rapidly rotating black hole some 100 million times the mass of our sun. “Interstellar” was based on a book written by Nobel Prize-winning astrophysicist Kip Thorne and Gargantua’s physical properties are central to the plot of this Hollywood movie.
Building on work done by physicist Amos Ori two decades prior, and armed with her strong computational skills, Mallary built a computer model that would capture most of the essential physical effects on a spacecraft, or any large object, falling into a large, rotating black hole like Sagittarius A*.
Not Even a Bumpy Ride?
What she discovered is that under all conditions an object falling into a rotating black hole would not experience infinitely large effects upon passage through the hole’s so-called inner horizon singularity. This is the singularity that an object entering a rotating black hole cannot maneuver around or avoid. Not only that, under the right circumstances, these effects may be negligibly small, allowing for a rather comfortable passage through the singularity. In fact, there may no noticeable effects on the falling object at all. This increases the feasibility of using large, rotating black holes as portals for hyperspace travel.
Mallary also discovered a feature that was not fully appreciated before: the fact that the effects of the singularity in the context of a rotating black hole would result in rapidly increasing cycles of stretching and squeezing on the spacecraft. But for very large black holes like Gargantua, the strength of this effect would be very small. So, the spacecraft and any individuals on board would not detect it.
The crucial point is that these effects do not increase without bound; in fact, they stay finite, even though the stresses on the spacecraft tend to grow indefinitely as it approaches the black hole.
There are a few important simplifying assumptions and resulting caveats in the context of Mallary’s model. The main assumption is that the black hole under consideration is completely isolated and thus not subject to constant disturbances by a source such as another star in its vicinity or even any falling radiation. While this assumption allows important simplifications, it is worth noting that most black holes are surrounded by cosmic material – dust, gas, radiation.
Therefore, a natural extension of Mallary’s work would be to perform a similar study in the context of a more realistic astrophysical black hole.
Mallary’s approach of using a computer simulation to examine the effects of a black hole on an object is very common in the field of black hole physics. Needless to say, we do not have the capability of performing real experiments in or near black holes yet, so scientists resort to theory and simulations to develop an understanding, by making predictions and new discoveries.
Black holes are remarkable entities. On the one hand, they have now become familiar astrophysical objects that have been observed in large numbers and in many ways: we have evidence of stellar-mass holes dancing around with a companion star, of gigantic holes at the center of galaxies pulling in spiraling disks of matter, and of black hole pairs merging in a spray of gravitational waves. All of this is beautifully accounted for by Einstein’s century-old theory of general relativity. Yet, on the other hand, black holes remain highly mysterious. We see matter falling into them, but we are in the dark about what happens to this matter when it reaches the center of the hole.
Abhay Ashtekar and Javier Olmedo at Pennsylvania State University in University Park and Parampreet Singh at Louisiana State University, Baton Rouge, have taken a step toward answering this question . They have shown that loop quantum gravity—a candidate theory for providing a quantum-mechanical description of gravity—predicts that spacetime continues across the center of the hole into a new region that exists in the future and has the geometry of the interior of a white hole. A white hole is the time-reversed image of a black hole: in it, matter can only move outwards. The passage “across the center” into a future region is counterintuitive; it is possible thanks to the strong distortion of the spacetime geometry inside the hole that is allowed by general relativity. This result supports a hypothesis under investigation by numerous research groups: the future of all black holes may be to convert into a real white hole, from which the matter that has fallen inside can bounce out. However, existing theories have not been able to fully show a way for this bounce to happen. That loop quantum gravity manages to do it is an indication that this theory has ripened enough to tackle real-world situations.
The reason why we are in the dark about aspects of black hole physics is that quantum phenomena dominate at the center and in the future of these objects. Classical general relativity predicts that a black hole lives forever and that its center is a “singularity” where space and time end. These predictions are not realistic because they disregard quantum effects. To tackle these effects we need a quantum theory of gravity. We don’t yet have consensus on such a theory, but we have candidates, some of which are now reaching the point of allowing actual calculations on the quantum behavior of black holes. Loop quantum gravity, which has a clean conceptual structure and a well-defined mathematical formulation based on representing the fabric of space as a spin network that evolves in time, is one such theory.
During the last few years, a number of research groups have applied loop theory to explore the evolution of black holes. These efforts are building a compelling picture based on a black-to-white-hole transition scenario (Fig. 1), which can be summarized as follows . At the center of the black hole, space and time do not end in a singularity, but continue across a short transition region where the Einstein equations are violated by quantum effects. From this region, space and time emerge with the structure of a white hole interior, a possibility suggested in the 1930s by physicist John Lighton Synge . As the hole’s center evolves, its external surface, or “horizon,” slowly shrinks because of the emission of radiation—a phenomenon first described by Stephen Hawking. This shrinkage continues until the horizon reaches the Planck size (the characteristic scale of quantum gravity) or earlier [4, 5], at which point a quantum transition (“quantum tunneling”) happens at the horizon, turning it into the horizon of a white hole (Fig. 2). Thanks to the peculiar distorted relativistic geometry, the white hole interior born at the center joins the white horizon, completing the formation of the white hole.
Loosely speaking, the full phenomenon is analogous to the bouncing of a ball. A ball falls to the ground, bounces, and then moves up. The upward motion after the bounce is the time-reversed version of the falling ball. Similarly, a black hole “bounces” and emerges as its time-reversed version—a white hole. Collapsing matter does not disappear at the center: it bounces up through the white hole. Energy and information that fell into the black hole emerge from the white hole. The configuration where the compression is maximal, which separates the black hole from the white hole, is called a “Planck star.” Because of the huge time distortion allowed by relativity, the time for the process to happen can be short (microseconds) when measured from inside the hole but long (billions of years) when measured from the outside. Black holes might be bouncing stars seen in extreme slow motion.
This is a compelling picture because it removes the singularity at a black hole’s center and resolves the paradox of the apparent disappearance of energy and information into a black hole. Until now, this black-to-white-hole picture was not derived from an actual quantum theory of gravity; it was just conjectured—and implemented with ad hoc modifications to Einstein’s general relativity equations. Ashtekar, Olmedo, and Singh have shown that a crucial ingredient of this scenario, the transition at the center, follows from a genuine quantum gravity theory, namely, loop theory. The result was obtained through an approximation of the full loop-quantum-gravity equations —similar to the one employed in previous work aimed at resolving the big bang singularity .
It is important to note that the Ashtekar-Olmedo-Singh model addresses only the transition at the center of the hole. To complete the picture, we also need the calculation of the tunneling at the horizon . Preliminary steps in this direction have been taken, but the problem is open. Its solution would lead to a complete understanding of the quantum physics of black holes.
It is not implausible that empirical observations could support this scenario. Models suggest that several observed astrophysical phenomena could be related to the black-to-white-hole transition . Among these are fast radio bursts (FRBs) and certain high-energy cosmic rays. Both could be produced by matter and photons that were trapped in black holes produced in the early Universe and liberated by the black-to-white-hole transition. For the moment, however, the astrophysical data are insufficient to determine whether the statistical properties of observed FRBs and cosmic rays confirm this hypothesis . Another intriguing possibility is that small holes produced by the black-to-white-hole transition may be stable: in which case, these “remnants” could be a component of dark matter .
We are only beginning to understand the quantum physics of black holes, but in this still speculative field, the Ashtekar-Olmedo-Singh result gives us a welcome fixed point: loop gravity predicts that the interior of a black hole continues into a white hole. The importance of any progress in this field goes beyond understanding black holes. The center of a black hole is where our current theory of spacetime, as given by Einstein’s general relativity, fails. Understanding the physics of this region would mean understanding quantum space and quantum time.
I. Agullo and P. Singh, “Loop quantum cosmology: A brief review,” Loop Quantum Gravity, 100 Years of General Relativity Vol. 4, edited by A. Ashtekar and J. Pullin (World Scientific, Singapore, 2017)[Amazon][WorldCat].
A. Barrau, B. Bolliet, F. Vidotto, and C. Weimer, “Phenomenology of bouncing black holes in quantum gravity: A closer look,” J. Cosmol. Astropart. Phys.2016, 022 (2016); A. Barrau, K. Martineau, and F. Moulin, “Status report on the phenomenology of black holes in loop quantum gravity: Evaporation, tunneling to white holes, dark matter and gravitational waves,” Universe4, 102 (2018).
Carlo Rovelli received his Ph.D. from the University of Padova in 1986. He was on the faculty of the University of Pittsburgh from 1990 to 2000 and then went to the Aix-Marseille University in France, where he leads the quantum gravity research group. His activities range from quantum gravity to the foundations of quantum physics and the philosophy of physics. He has been awarded the 1995 Xanthopoulos Award, the Laurea Honoris Causa from the Universidad de San Martin, Buenos Aires, and the Honorary Professorship of the Beijing Normal University in China. He is a senior member of the Institut Universitaire de France and a member of the Académie Internationale de Philosophie des Sciences.
It’s time for the final pre-holiday edition of The Monitor, WIRED’s roundup of the latest in the world of culture, from box-office news to announcements about hot new trailers. In today’s installment: the Men in Black are back; To All the Boys I’ve Loved Before is officially a Netflix franchise; and Aquaman is doing swimmingly at the box office.
Here Come the (New) Men in Black
“You are the best-kept secret in the universe,” notes Agent M, the newbie alien-seeker played by Tessa Thompson, in the first trailer for next summer’s Men in Black International. And for a while, this latest MiB entry was a bit of a mystery itself, with early rumors indicating it would be a crossover film featuring characters from Sony’s hit 21 Jump Street series. Instead, the first MiB sequel in seven years features Thompson teaming up with the veteran Agent H (Chris Hemsworth) in an attempt to thwart a new alien threat (helping them are higher-ups played by Liam Neeson and Emma Thompson). The action takes place in London, which we know because the trailer features a shot of a bridge in London, accompanied by Fergie’s “London Bridge.” What? No room for Will Smith’s 1997 theme song? It’s a glaring oversight—but we’ll let it slide, just this once.
To All the Boys I’ve Loved Before, Again
Netflix has confirmed it’s moving ahead with a sequel to this year’s To All the Boys I’ve Loved Before, the rom-com that proved to be a breakout hit for leads Lara Condon and Noah Centineo (both actors will return, as will original Boys screenwriter Sofia Alvarez). Adapted from a best-selling book trilogy by Jenny Han, Boys was all but inescapable over the summer, turning its cast members into social-media superstars, fueled in part by Netflix’s sizable teen audience. The streamer never reveals specific viewership figures, but if you want an idea of how big Boys became, we dare you to try standing in a high school parking lot with a sign offering “FREE NOAH CENTINEO SMOOCHES,” and see how long you last without getting trampled.
Aquaman Is About to Be Swimming in Cash
In case you were wondering, this weekend’s box office champ has already surfaced: Aquaman, which is expected to top the long pre-holiday weekend (the film’s already earned more than $250 million overseas, including a mighty opening in China). It will likely be followed by Disney’s Mary Poppins Returns and the Transformers spin-off Bumblebee, in what will be one of the most competitive Christmas openings in years—the first December without a new Star Wars movie since 2014. If Aquaman—which has earned mixed reviews—can sustain its commercial momentum, it will hint at a possibly not-terrible future for the big-screen DC Universe, which stumbled last year with Justice League, the big-budget, 120-minute-long MacBook screensaver that was accidentally released into theaters.
At Cloudflare we handle a lot of traffic on behalf of our customers. Something we all see and hear a lot about at this time of year are Black Friday (23 November this year) and Cyber Monday (26 November) – but just how important are these days on the Internet?
To try and answer this question, we took a look at anonymised samples of HTTP requests crossing our network. First of all, let’s look at total page views from across our global network from the last few weeks and see if we can spot Black Friday and Cyber Monday:
So this is total page views by day (UTC) from November 19 (a week before Cyber Monday) until Monday December 3. Other than follow-the-sun fluctuations in a repeating daily pattern, each whole day is pretty similar in shape and size compared to the last. Black Friday and Cyber Monday aren’t visible in overall traffic patterns.
We have a very diverse set of customers across 12 million domain names and not all of them are selling products or doing so directly online. To identify those websites that are, I used metadata from the wonderful HTTP Archive project to export a list of domains using Cloudflare that were also running ecommerce software.
Here are the page views for these ecommerce sites over the same time period:
So we can see clearly that our ecommerce customers are seeing a big increase in page views on November 23 and 26. Black Friday and Cyber Monday are most certainly a thing. This year Black Friday was quite a bit busier than Cyber Monday – around 22% busier in terms of page views. If we compare the page views of each day to the week prior, we can see the changes clearly:
The uplift starts on Wednesday but really kicks in during Thanksgiving with an increase of more than 100% on Black Friday.
Browsing vs Buying
So we’ve established that these shopping days are important in terms of visitor activity. More pages are being viewed on these days – but is anyone buying anything?
We’re dealing with trillions of requests across a really large data set of different websites without any specific knowledge of what a purchase transaction would look like for each – so to approximate this I took a crude approach, which is to look for successful checkout interactions in the data. If you imagine a typical ecommerce application makes a purchase with a HTTP request like “POST /store/checkout HTTP/1.1” we can look for requests similar to this to understand the activity.
We can see here that Black Friday has an almost 200% increase in checkout interactions compared to the previous Friday.
Using this raw number of checkout interactions to compare with the page views we have something approximating a conversion %. This is not a true conversion figure – calculating a true conversion figure would require data that identifies individuals and detailed action tracking for each website. What we have is the total number of page views (HTTP requests that return HTML successfully) compared to the total number of POST requests to a checkout. This gives us a baseline to compare changes in “conversion” over these big November shopping days:
Each bar on this chart represents the % change in checkout interactions as a proportion of page views compared to the same day the previous week. We can see this increased by 45% on Black Friday compared to the Friday before (boring old beige Friday November 16). The following Saturday was booming at 60% – because we’re dealing with time in UTC, a UTC Saturday actually includes Black Friday traffic for some parts of the world, the same can be said of Tuesday which contains overlap from Cyber Monday – we’ll break this down a bit later.
On Cyber Monday, the increase actually beats Black Friday, meaning page views lead to cart interactions 57% more often than the prior Monday (boring old vanilla Monday November 19), albeit from a lower number of transactions.
What devices are people buying on?
What we see here is just how much more browsing people do on mobiles today vs desktop, with mobile winning most days:
When it comes to checkout interactions though, we can see the situation is switched with visitors more likely to interact with the checkout on a desktop overall, but even more so on Black Friday (14% more likely) and Cyber Monday (20% more likely).
Let’s look at a specific region to understand more, starting with the US:
We can see a more normal weekday pattern on the prior Thursday & Friday (15 & 16 Nov) whereby desktop page views eclipse mobile during the daytime while people are at their desks. In the evenings and weekends, mobile takes over. What we see from the 21st onward is evidence of people taking time off work and doing more with their mobile devices. Even on Thanksgiving, there is still a big rise in activity as people start gearing up for Friday’s deals or finding ways to avoid political discussion with relatives at home!
On Cyber Monday, traffic earlier in the day is lower as people return to work, however we are seeing heavy use of desktop devices. As the working day ends, mobile once again dominates. Things begin to settle back into a more regular pattern from Tuesday November 27 onwards.
Let’s take a look at checkout interaction over the Black Friday to Cyber Monday weekend by device type.
Despite all of that mobile browsing activity, desktop devices are more commonly used for checkout actions. People seem to browse more on mobile, committing to buy more often with desktop, it may also just be that mobile users have more distractions both on the device and in the real world and are therefore less likely to complete a purchase. From personal experience, I also think the poor mobile optimisation of some sites’ checkout flows make desktop preferrable – and when customers are incentivised with discounts & deals, they are more likely to switch devices to complete a transaction if they hit an issue.
Is Black Friday / Cyber Monday international?
It might be obvious if you’re reading this from the UK, but despite the fact that Thanksgiving is not a holiday here, retailers have very much picked up the mantle from US retailers and seized the opportunity to drive sales over this weekend.
Page views to ecommerce websites on Cloudflare look very similar in shape to the US on Black Friday. However, mobile is more dominant in the UK, even during working hours. It’s worth noting one big difference here – Cyber Monday in the UK was only 22% up in terms of page views compared to the prior Monday – in the US the increase was more than 4x that.
When it comes to checkout, it also looks like UK visitors to ecommerce sites commit more with their mobile, but desktop is still more likely to lead to more conversion.
Taking Germany as another example, here’s how page views look:
Desktop use during typical working hours is much more pronounced in Germany. Black Friday and Cyber Monday show higher page views than a normal Friday / Monday but the difference is much smaller than regions such as the US & UK.
Black Friday is spreading internationally despite these still being normal working days for the rest of the world. Cyber Monday is also increasing ecommerce activity internationally but tends to be quieter than Black Friday. Overall, mobile browsing eclipses desktop, but those desktop page views tend to lead to checkout more often.
Retailers should continue to invest in making their mobile & desktop ecommerce experiences fast & resilient to seize on these key days.
We know how you’re feeling. You’re full of turkey (or maybe Tofurky!) but the deals are happening, and they’re happening right about now. Well, fear not. We here on the WIRED Gear team have been patrolling every online deal we could find for the past week. We’ve produced half a dozen or so guides covering a good swath of the tech world, and this guide has our absolute favorite sales. It has super expensive, amazing TVs and $5 smart plugs, side by side. Keep this page bookmarked, too. It will also become our home for Cyber Monday deals in just a few days.
Updated afternoon Nov. 23: We crossed out some currently sold-out deals and added a few new ones. Deals tend to flow and out of availability and vary in price during Black Friday. Please bear with us. We will continue to update this list as we learn about new deals, and items sell out.
Once you spend a day with LG’s OLED screen tech, you won’t go back. Visually, nothing compares to it. The contrast and inky blacks are as good as they come, and the LG C8 is a perfect example. OLED TV’s have yet to get much cheaper than $1,500, which is a shame, but if you want the best, they’re worth the extra cost. Read our C8 review to learn more.
You can find cheaper TVs, and some of them may also be from TCL with Roku built in, but this is the one you want. The TCL 5 Series strikes a really good balance between beautiful picture quality and price. And, as always, since it has a Roku inside it, the interface and remote are easy to use and great for streaming out of the box. (Also available in 49-inch size.)
The Sonos One is the Best Smart Speaker you can buy. It sounds incredible and is a perfect starter speaker to a larger Sonos world. The thing that’s best about Sonos is that the speakers network together around your home, and you can easily group and ungroup them, and play music from just about any streaming service. The One also has Alexa built in, works with Apple AirPlay 2, and will connect to Google Home in early 2019, we’re told. It’s rarely discounted, but this weekend you can also get $50 off the Beam, and $100 off the Sub.
Lenovo’s Smart Display is one of the Best Google Speakers you can buy and a top Smart Speaker, too. We like Google Home a bit more than Amazon’s Alexa right now for its ease of setup and use. This was Google Home’s first smart display (now, there are many), and it does a great job of making itself a relevant addition to the kitchen, especially. It has interactive recipes and delivers morning video news reports.
Sony WH1000XM2 Noise Canceling Headphones for $200 ($150 off)
These Sony 1000XM2s can’t quite match the Bose QC35 headphones(see below), but they’re pretty close. (The 1000XM3 are even better.) They cancel noise incredibly well, and if you put your hand over the right earcup, it amplifies the sound around you, so you can hear the bus driver or pilot say something you hoped would be important.
The Studio3 get excellent battery life, work remarkably well for phone calls, connect especially well to iPhones, and cancel noise better than you’d think. They are very underrated. Yes, they are a bit bassy like most Beats, but they sound pretty great.
It wouldn’t be a shopping holiday without a sale on the Instant Pot, the multi-purpose cooking device which has saved dinner for millions of parents across the country. Naturally, it’s on sale for Black Friday.
The Dyson cordless stick vacuums are stick vacuums in their ideal form. While the V10 has a slightly upgraded design and more powerful battery, the V8 has a very decent 40 minutes of run time and the same hassle-free HEPA filtration. It might be more efficient than a Roomba if you have a smaller house.
Amazon Smart Plug for $5 ($20 off) with any Echo Purchase
We have a separate list of our favorite Amazon devices that are on sale for the holiday. But if you’re in the process of setting up your smart home, it’s hard to go wrong with a simple smart plug that’s basically free.
Disclaimer: We at WIRED have very complicatedfeelings about getting your DNA decoded. But you can opt out of sharing your data for research. The Ancestry kit is also on sale, if you want access to a larger DNA database.
Confession: Our tester model is still en route to the office, but word on the street is that this sport smartwatch is an excellent value for the money, and we’re very excited about checking it out. We would be remiss to not point out that it’s on deep discount right now.
Mission Workshop’s burly bags are a favorite around the WIRED offices. Through November 26, you can get 20 percent off all purchases, plus a $20 gift card, plus a free bag of coffee! Use this code: 2020MW
All of Huckberry’s Black Friday deals are worth checking out, especially if you have an outdoorsy man in your life. Our pick is this lightweight, collapsible foam roller, which is easy to pack if you fear for the state of your IT band while traveling over the holidays.
Alternatively, these stylish sunglasses have polarized lenses with scratch-proof coating. You can if you want to, but there’s really no reason to spend three digits on a pair of adventure-worthy sunglasses.
Arc’teryx Gamma MX Hoody for $262 with code TAKE25ARC ($87 off)
Arc’teryx’s jackets are durable, weatherproof, and cut to allow you maximum freedom of movement while still looking svelte. But they’re too expensive to buy without a discount. Backcountry is currently offering 25 percent off one full-price Arc’teryx item through November 26.
If you and your child want a bike trailer for Christmas, Burley is offering 25-30 percent off bike trailers and bundle deals through November 28. The D’Lite can seat two children and convert to a stroller, a jogger, or a sled.
Free Belt Plate, Skid Plate, and $50 Gift Card with Boosted Mini S Purchase ($749)
Everyone likes Mario Kart, and it’s one of the best games on the Nintendo Switch. If you don’t yet own the system, pick one up. There are quite a few really amazing games on it already. When you’re ready to up your game, check out our list of fun Switch accessories.
The Nintendo Labo is like Legos meets videogames, and we love it. Using on-screen instructions, you put together crazy cardboard contraptions like a fully functional steering wheel, and then use them in a game by plugging the Nintendo Switch display or Joy-Con motion controllers into slots in the cardboard. Building is fun for adults, but kids will have a blast doing this alone or with parents. The Vehicle Kit is our favorite, but the Variety Kit is also a lot of fun. Both Kits come with multiple things to build that will take at least a dozen hours of focused fun. Then you get to play!
Hexbyte Tech News Wired Laptop, Phone, and Device Deals
The Pixel 3 is $150 off from Google, but Best Buy is offering a massive discount if you buy the Verizon version. Technically, it should be a phone that works elsewhere, but you’d have to activate it with Verizon. The Pixel 3 is the Best Android Phone right now.
If you have any leanings toward a new iPad, this is the time to buy it. The 2018 iPad is fantastic and now compatible with the Apple Pencil. There are no real surprises about it: it just works very nicely for casual tasks and has more worthwhile games and apps than any other tablet. The iPad Mini is also $100 off.
The entire Fire tablet line is currently discounted, but the Fire HD 10 is our favorite. It has a fantastic screen for watching video and it’s just speedy enough that it won’t constantly remind you that it’s a budget tablet. If you buy an Show Mode Dock ($10 off), you can also use it like an Echo Show. If you want a more portable tablet, the Fire HD 8 ($50 during BF/CM) is your best bet.
If your needs are few and your expectations are in check, this Chromebook might satisfy your computing needs. It can check email, browse the web, and do other basic tasks. That’s all we ask of a $100 computer.
Microsoft Surface Pro 6 with Keyboard for $799 ($260 off)
You’ve seen a Kindle. You know what the Kindle is all about. If you need to read, and want to do it with a nice backlight, this 7th gen Kindle gets the job done at a lower price than we normally see during Amazon sales.
The Nokia 6.1 is one of the only budget phones to get updates straight from Google, making it one of the most secure and up-to-date phones you can buy—all for less than $200 during Black Friday and Cyber Monday. If you’re looking for a good affordable phone, try this. It’s not a beast like the Galaxy S9, but it’s completely usable and has a durable metal unibody.
Most high-end phones cost $800 – $1,100 this year. That’s ridiculous, which is why we’re happy to see the Galaxy S9 on sale for around $500. It’s worth that amount of money and has a camera, processor, and display that’s competitive with any other phone on the market.
Hexbyte Tech News Wired Black Friday Sale Pages for 2018
We’ve sifted through the mess of deals, but if you want to look for yourself, here are some links. Many of these prices may not be live until day-of.
The holiday deals madness of Black Friday and Cyber Monday has already begun. If you’re on the hunt for Xbox One, PlayStation 4, Nintendo Switch, or 3DS deals, you’ve come to the right place. We’re collecting all our favorite Black Friday sales here on consoles, bundles, controllers, accessories, games, and more. Bookmark the page and check back anytime until Cyber Week is over to see more gaming deals.
Note: Some links may not yet show discounts, and some retailers may not yet be linked. We will continue to update this list as more information comes available on Black Friday deals. We will also add a list of game discounts.
The PS4 Slim is a perfectly adequate PS4 for HD TVs and you probably won’t mind using it on a fancy new 4K TV either. It’s the best-selling console of the last half-decade and Marvel’s Spider-Man is one of our favorite games this year.
PS4 Pro with Red Dead Redemption 2 for $400 ($60 off)
This deal started before Black Friday season, but if you want a PS4 Pro, it’s the best bundle we’ve seen. PS4 Pro is a better system if you own a 4K TV and some games have enhanced graphics or frame rates on it. It’s compatible with all current PS4 games. Read our full PS4 Pro review to learn more.
Sony’s DualShock controllers get very poor battery life. That hasn’t changed, but from now through Black Friday and Cyber Monday you can at least get a discount on them. $40 is the minimum we have seen 1st party controllers go for.
Sony’s PlayStation VR headset is still the most popular premium headset around and there are some fun games to check out. We recommend you pick up a unit with the required Sony camera. The PlayStation Move motion controllers add fun to some games, as well.
PSVR with Motion Controllers and 2 Games for $250 ($100 off)
The Xbox One X is the most powerful console currently available. If you don’t yet own an Xbox One and have a 4K TV, this is the Xbox to buy to get enhanced game visuals and other perks. It’s compatible with all current Xbox One games. Read our full review.
Xbox One S Minecraft Creators Bundle for $200 ($100 off)
Starts 11/22: Xbox Controllers do hold their charge longer than PS4, but if you need a second, or still own older models that lack a headset audio jack, most colors will be on sale for $40—again, the cheapest you’re going to find official controllers.
Starts 11/22: You need Xbox Live Gold to play games online. If you’re paying for it already, it never hurts to buy it in advance at a discount. This price is equal to the annual plan of $60 per year—if you broke said plan into months.
The Switch still doesn’t get discounted much, or all that often. Mario Kart 8 Deluxe is one of the best multiplayer games for the system, and worth a buy if you plan to play with friends at home or online (you will). Nintendo’s Joy-Con steering wheel is also on sale.
Nintendo 2DS + Super Mario Maker for $80 (New Bundle)
The 2DS can do everything the 3DS can except 3D, and you don’t really need that feature to enjoy most (or all) games. There are a huge library of awesome 3DS games to play and Super Mario Maker is a particularly fun one. It lets you construct your own Super Mario Bros. levels and play levels made by yourself or others.
Available Now: We love the Nintendo Labo, and if you like Legos or want to build stuff that can be used in games, it’s a ton of fun. Each Labo is a cardboard controller of sorts. They take anywhere from 15 minutes to 3 hours to build, depending on their complexity, and the games are a lot of fun, too. This Best Buy exclusive deal lets you choose between any 2 Labo kits. We recommend the Vehicle Kit and Variety Kit.
Hexbyte Tech News Wired Gaming Hardware
Turtle Beach Recon Gaming Headset for $30 ($30 off)
Starts 11/22: These wired Turtle Beach headsets will hook right into either a PS4 or Xbox controller (or a PC). They don’t have all t he perks of super high-end headsets, but they sound much better than the crappy set that comes with a console.
Turtle Beach Stealth 300 Headset for $45 ($35 off)
This Stealth 300 headset sounds great. It’s colored green, but it will work on PS4, Switch, PC, etc. It’s a lot like our top-recommended Stealth 600 sets except it’s wired. It takes a charge to add mic monitoring and other features (should last for 40 hours per charge).
Every Switch owner needs a MicroSD card for game storage. The system only comes with 32GB of memory, which isn’t enough for even half a dozen major games. We don’t recommend you purchase anything less than 128GB, and it needs to be at least a Class 10 (or U1) card, like this one.
SteelSeries Arctis 7 Wireless Headset for $115 ($35 off)
The Arctis 7 is currently our favorite wireless gaming headset for PCs. It also works just fine for any console. The Arctis line is more comfortable and sounds better than almost any other headset line.
Hexbyte Tech News Wired Black Friday Sale Pages for 2018
We’ve sifted through the mess of deals, but if you want to look for yourself, here are some links. Many of these prices may not be live until day-of.
Last week, Netflix users raised concerns that the company was targeting African American users by race in the way it promoted films—highlighting black characters who sometimes had only minor roles in a movie.
The debate began after Stacia L. Brown, creator of the podcast Charm City, tweeted a screenshot of the promotion she was shown for Like Father, featuring two black characters, Leonard Ouzts and Blaire Brooks, who had “20 lines between them, tops,” rather than the movie’s famous white stars, Kristen Bell and Kelsey Grammer. Brown, who is black, posted a handful of other examples where Netflix highlighted black actors, presumably to entice her to watch, even though the films’ casts were predominantly white.
Black holes, befitting their name and general vibe, are hard to find and harder to study. You can eavesdrop on small ones from the gravitational waves that echo through space when they collide—but that technique is new, and still rare. You can produce laborious maps of stars flitting around the black hole at the center of the Milky Way or nearby galaxies. Or you can watch them gulp down gas clouds, which emit radiation as they fall.
Original story reprinted with permission from Quanta Magazine, an editorially independent publication of the Simons Foundation whose mission is to enhance public understanding of science by covering research developments and trends in mathematics and the physical and life sciences.
Now researchers have a new option. They’ve begun corralling ultrabright flashes called tidal disruption events (TDEs), which occur when a large black hole seizes a passing star, shreds it in two and devours much of it with the appetite of a bear snagging a salmon. “To me, it’s sort of like science fiction,” said Enrico Ramirez-Ruiz, an astrophysicist at University of California, Santa Cruz, and the Niels Bohr Institute.
During the past few years, though, the study of TDEs has transformed from science fiction to a sleepy cottage industry, and now into something more like a bustling tech startup.
Automated wide-field telescopes that can pan across thousands of galaxies each night have uncovered about two dozen TDEs. Included in these discoveries are some bizarre and long-sought members of the TDE zoo. In June, a study in the journal Naturedescribed an outburst of X-ray light in a cluster of faraway stars that astronomers interpreted as a midsized black hole swallowing a star. That same month, another group announced in Science that they had discovered what may be brightest ever TDE, one that illuminated faint gas at the heart of a pair of merging galaxies.
These discoveries have taken place as our understanding of what’s really happening during a TDE comes into sharper focus. At the end of May, a group of astrophysicists proposed a new theoretical model for how TDEs work. The model can explain why different TDEs can appear to behave differently, even though the underlying physics is presumably the same.
Astronomers hope that decoding these exotic light shows will let them conduct a black hole census. Tidal disruptions expose the masses, spins and sheer numbers of black holes in the universe, the vast majority of which would be otherwise invisible. Theorists are hungry, for example, to see if TDEs might unveil any intermediate-mass black holes with weights between the two known black hole classes: star-size black holes that weigh a few times more than the sun, and the million- and billion-solar-mass behemoths that haunt the cores of galaxies. The Nature paper claims they may already have.
A numerical simulation of the core of a star as it’s being consumed by a black hole. Video by Guillochon and Ramirez-Ruiz
Researchers have also started to use TDEs to probe the fundamental physics of black holes. They can be used to test whether black holes always have event horizons—curtains beyond which nothing can return—as Einstein’s theory of general relativity predicts.
Meanwhile, many more observations are on the way. The rate of new TDEs, now about one or two per year, could jump up by an order of magnitude even by the end of this year because of the Zwicky Transient Facility, which started scanning the sky over California’s Palomar Observatory in March. And with the addition of planned observatories, it may increase perhaps another order of magnitude in the years to come.
“The field has really blossomed,” said Suvi Gezari at the University of Maryland, one of the few stubborn pioneers who staked their careers on TDEs during leaner years. She now leads the Zwicky Transient Facility’s TDE-hunting team, which has already snagged unpublished candidates in its opening months, she said. “Now people are really digging in.”
Searching for Star-Taffy
In 1975, the British physicist Jack Hills first dreamed up a black-hole-eats-star scenario as a way to explain what powers quasars—superbright points of light from the distant universe. (Quasars are now known to be supermassive black holes feeding on surrounding gas, not stars.) But in 1988, the British cosmologist Martin Rees realized that black holes snacking on a star would exhibit a sharp flare, not a steady glow. Looking for such flares could let astronomers find and study the black holes themselves, he argued.
Nothing that fit the bill turned up until the late 1990s. That’s when Stefanie Komossa, at the time a graduate student at the Max Planck Institute for Extraterrestrial Physics in Garching, Germany, found massive X-ray flares from the centers of distant galaxies that brightened and dimmed according to the Rees predictions.
The astronomical community responded to these discoveries—based on just a few data points—with caution. Then in the mid-2000s, Gezari, then beginning a postdoc at the California Institute of Technology, searched for and discovered her own handful of TDE candidates. She looked for flashes of ultraviolet light, not X-rays as Komossa had. “In the old days,” Gezari said, “I was just trying to convince people that any of our discoveries were actually due to a tidal disruption.”
Soon, though, she had something to sway even the doubters. In 2010, Gezari discovered an especially clear flare, rising and falling as modelers predicted. She published it in Nature in 2012, catching other astronomers’ attention. In the years since, large surveys in optical light, sifting through the sky for changes in brightness, have taken over the hunt. And like Komossa’s and Gezari’s TDEs, which had both been fished out of missions designed to look for other things, the newest batch showed up as bycatch. “It was, oh, why didn’t we think about looking for these?” said Christopher Kochanek, an astrophysicist at Ohio State University who works on a project designed to search for supernovas.
Now, with a growing number of TDEs in hand, astrophysicists are within arm’s reach of Rees’s original goal: pinpointing and studying gargantuan black holes. But they still need to learn to interpret these events, divining their basic physics. Unexpectedly, the known TDEs fall into separate classes. Some seem to emit mostly ultraviolet and optical light, as if from gas heated to tens of thousands of degrees. Others glow fiercely with X-rays, suggesting temperatures an order of magnitude higher. Yet presumably they all have the same basic physical root.
To be disrupted, an unlucky star must venture close enough to a black hole that gravitational tides exceed the internal gravity that binds the star together. In other words, the difference in the black hole’s gravitational pull on the near and far sides of the star, along with the inertial pull as the star swings around the black hole, stretches the star out into a stream. “Basically it spaghettifies,” said James Guillochon, an astrophysicist at the Harvard-Smithsonian Center for Astrophysics.
The outer half of the star escapes away into space. But the inner half—that dense stream of star-taffy—swirls into the black hole, heating up and releasing huge sums of energy that radiate across the universe.
With this general mechanism understood, researchers had trouble understanding why individual TDEs can look so distinct. One longstanding idea appeals to different phases of the star-eating process. As the star flesh gets initially torn away and stretched into a stream, it might ricochet around the black hole and slam into its own tail. This process might heat the tail up to ultraviolet-producing temperatures—but not hotter. Then later—after a few months or a year—the star would settle into an accretion disk, a fat bagel of spinning gas that theories predict should be hot enough to emit X-rays.
But there’s another option, argued a team led by Jane Lixin Dai at the Niels Bohr Institute and including Ramirez-Ruiz in May. According to their simulations, which include the effects of general relativity, the two kinds of TDEs might just be the same thing seen at different angles. If astronomers are viewing a bagel-like accretion disk from the top, they can see X-rays from the hot inner material swirling right down the drain. When the accretion disk is edge-on, though, colder gas stands in the way. This gas catches X-rays and reemits them as ultraviolet light.
Ultimately, theorists hope to read each event as a variation on the same core theme—and then do deeper science. “Maybe we’ll learn something fundamental about accretion,” Kochanek said. Or maybe “every one will be sufficiently idiosyncratic that it will be like worrying about the shape of a cloud.”
The newly discovered TDEs are also helping astronomers to understand supermassive, galaxy-ruling black holes. Only about 10 percent of these giants emit radiation as they feed on surrounding gas, leaving the other 90 percent of them invisible.
TDEs change that. Komossa, an astronomer at the Max Planck Institute for Radio Astronomy in Bonn, hopes to find more binary supermassive black holes: black holes forced to cohabitate after their own galaxies collided, which future space-based gravitational wave experiments will also search for. As a star drains into one black hole, the presence of another supermassive maw nearby would tug at the stream of matter falling in. Instead of a smooth dimming, the TDE would exhibit dips and rises.
Other teams want to test a fundamental, eerie correlation. Somehow the masses of central black holes and their host galaxies seem to increase in tandem. “The mass of the black hole knows about the mass of the galaxy, which is kind of mesmerizing,” Ramirez-Ruiz said. TDEs, plumbing black hole masses in an independent sample of galaxies, could either strengthen or weaken this relationship.
TDEs can also reveal an oxymoronic population: the shrimpiest massive black holes around. While the very biggest known black holes can weigh 10 billion times the sun, and galaxies like the Milky Way host specimens that tip the scales at millions of solar masses, it isn’t clear whether smaller dwarf galaxies are ruled by proportionally pipsqueak versions, in the hundreds of thousands of solar masses or below.
Spotting TDEs from these intermediate mass black holes would settle the question, helping astronomers understand how giant black holes form in the first place. The June paper in Nature claims to have found such an intermediate object, one weighing a few tens of thousands of solar masses. That event appeared in 2003, peaked in 2006 and then declined for the following decade. Instead of happening at the center of a galaxy, the X-ray flare occurred in a star cluster, a place where intermediate-mass black holes could coalesce from the mergers of stars. But a single event does not a population make. “We need to find more similar events, to confirm our result,” said Dacheng Lin, an astrophysicist at the University of New Hampshire who led the study.
For example, as a black hole increases in mass, its predicted event horizon creeps steadily outward. But the radius at which the black hole’s tides can crack open a star increases more slowly. At a theoretical limit called the Hills mass, about 100 million times the mass of the sun, a black hole’s star-tearing radius exactly matches its own border. That should put a mass cap on TDEs. “Below that, you can tear something apart. Above that, stars get swallowed hole,” said Nicholas Stone, a theoretical astrophysicist at Columbia University.
So far, the data matches this idea. The rise and fall of known TDEs—already as reliable at weighing supermassive black holes as other techniques—show they all happened around black holes that weigh less than the Hills mass, suggesting that heavier objects likely do have the event horizons that relativity predicts.
But Stone and colleagues are eager to exploit an additional wrinkle. A spinning black hole that weighs 10 times above the Hills mass can still swallow stars. Eventually, after discovering more TDEs, astronomers can watch how the rate of events fades off at high mass, which should help them understand the fastest black hole spins, Stone said.
That might put relativity’s idea of event horizons right back in the crosshairs. A rotating black hole has a theoretical maximum speed, and any black holes seen spinning faster would violate the idea that a black hole has a firm outer boundary.
Thankfully, the observational grist needed to test these various ideas is already on its way. In a dramatic reversal of the field’s beginnings, the new Zwicky Transient Facility is now turning up too many candidates for comfort, Gezari said. She’s starting to strain her resources, trying to get enough telescope time for follow-up observations on each worthy target.
The next leaps come soon. A long-delayed joint German-Russian mission called eRosita, if it goes up in 2019 as planned, should spot hundreds or thousands of TDEs as X-ray flashes. So should the Einstein Probe, a Chinese mission that Komossa collaborates on, scheduled to launch in 2022. And then there’s the Large Synoptic Survey Telescope, currently being built in Chile and scheduled to start scanning the sky in 2022, which should catch its own hundreds or thousands of TDEs among whatever else goes bump in the night.
For Ramirez-Ruiz, this growth since the field’s humble beginnings is a natural consequence of modern “celestial cinematography”—telescopes that shoot night-by-night time-lapse video across the entire sky. TDEs only happen about once every 10,000 years in a given galaxy, when an unlucky star wanders close enough to a black hole. But now that we monitor enough galaxies at once, he said, “the field actually has exploded.”
Original story reprinted with permission from Quanta Magazine, an editorially independent publication of the Simons Foundation whose mission is to enhance public understanding of science by covering research developments and trends in mathematics and the physical and life sciences.
Black is the uncompromising Python code formatter. By using it, you
agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle
nagging about formatting. You will save time and mental energy for
more important matters.
Blackened code looks the same regardless of the project you’re reading.
Formatting becomes transparent after a while and you can focus on the
Black makes code review faster by producing the smallest diffs
Black can be installed by running pip install black. It requires
Python 3.6.0+ to run but you can reformat Python 2 code with it, too.
To get started right away with sensible defaults:
Command line options
Black doesn’t provide many options. You can list them by running black --help:
black [OPTIONS] [SRC]...
-l, --line-length INTEGER Where to wrap around. [default: 88]
--check Don't write the files back, just return the
status. Return code 0 means nothing would
change. Return code 1 means some files would be
reformatted. Return code 123 means there was an
--diff Don't write the files back, just output a diff
for each file on stdout.
--fast / --safe If --fast given, skip temporary sanity checks.
-q, --quiet Don't emit non-error messages to stderr. Errors
are still emitted, silence those with
--pyi Consider all input files typing stubs regardless
of file extension (useful when piping source on
--py36 Allow using Python 3.6-only syntax on all input
files. This will put trailing commas in function
signatures and calls also after *args and
**kwargs. [default: per-file auto-detection]
--version Show the version and exit.
--help Show this message and exit.
Black is a well-behaved Unix-style command-line tool:
it does nothing if no sources are passed to it;
it will read from standard input and write to standard output if -
is used as the filename;
it only outputs messages to users on standard error;
exits with code 0 unless an internal error occurred (or --check was
NOTE: This is a beta product
Black is already successfully used by several projects, small and big.
It also sports a decent test suite. However, it is still very new.
Things will probably be wonky for a while. This is made explicit by the
“Beta” trove classifier, as well as by the “b” in the version number.
What this means for you is that until the formatter becomes stable,
you should expect some formatting to change in the future. That being
said, no drastic stylistic changes are planned, mostly responses to bug
Also, as a temporary safety measure, Black will check that the
reformatted code still produces a valid AST that is equivalent to the
original. This slows it down. If you’re feeling confident, use --fast.
The Black code style
Black reformats entire files in place. It is not configurable. It
doesn’t take previous formatting into account. It doesn’t reformat
blocks that start with # fmt: off and end with # fmt: on. It also
recognizes YAPF‘s block comments to
the same effect, as a courtesy for straddling code.
How Black wraps lines
Black ignores previous formatting and applies uniform horizontal
and vertical whitespace to your code. The rules for horizontal
whitespace can be summarized as: do whatever makes pycodestyle happy.
The coding style used by Black can be viewed as a strict subset of
As for vertical whitespace, Black tries to render one full expression
or simple statement per line. If this fits the allotted line length,
l = [1,
l = [1, 2, 3]
If not, Black will look at the contents of the first outer matching
brackets and put that in a separate indented line.
If that still doesn’t fit the bill, it will decompose the internal
expression further using the same rule, indenting matching brackets
every time. If the contents of the matching brackets pair are
comma-separated (like an argument list, or a dict literal, and so on)
then Black will first try to keep them on the same line with the
matching brackets. If that doesn’t work, it will put all of them in
# in:defvery_important_function(template: str, *variables, file: os.PathLike, debug: bool=False):
"""Applies `variables` to the `template` and writes to `file`."""withopen(file, 'w') as f:
"""Applies `variables` to the `template` and writes to `file`."""withopen(file, "w") as f:
You might have noticed that closing brackets are always dedented and
that a trailing comma is always added. Such formatting produces smaller
diffs; when you add or remove an element, it’s always just one line.
Also, having the closing bracket dedented provides a clear delimiter
between two distinct sections of the code that otherwise share the same
indentation level (like the arguments list and the docstring in the
If a data structure literal (tuple, list, set, dict) or a line of “from”
imports cannot fit in the allotted length, it’s always split into one
element per line. This minimizes diffs as well as enables readers of
code to find which commit introduced a particular entry. This also
makes Black compatible with isort. Use multi_line_output=3, include_trailing_comma=True, force_grid_wrap=0, and line_length=88 in your isort config.
You probably noticed the peculiar default line length. Black defaults
to 88 characters per line, which happens to be 10% over 80. This number
was found to produce significantly shorter files than sticking with 80
(the most popular), or even 79 (used by the standard library). In
general, 90-ish seems like the wise choice.
If you’re paid by the line of code you write, you can pass --line-length with a lower number. Black will try to respect that.
However, sometimes it won’t be able to without breaking other rules. In
those rare cases, auto-formatted code will exceed your allotted limit.
You can also increase it, but remember that people with sight disabilities
find it harder to work with line lengths exceeding 100 characters.
It also adversely affects side-by-side diff review on typical screen
resolutions. Long lines also make it harder to present code neatly
in documentation or talk slides.
If you’re using Flake8, you can bump max-line-length to 88 and forget
about it. Alternatively, use Bugbear‘s
B950 warning instead of E501 and keep the max line length at 80 which
you are probably already using. You’d do it like this:
You’ll find Black‘s own .flake8 config file is configured like this.
If you’re curious about the reasoning behind B950, Bugbear’s documentation
explains it. The tl;dr is “it’s like highway speed limits, we won’t
bother you if you overdo it by a few km/h”.
Black avoids spurious vertical whitespace. This is in the spirit of
PEP 8 which says that in-function vertical whitespace should only be
Black will allow single empty lines inside functions, and single and
double empty lines on module level left by the original editors, except
when they’re within parenthesized expressions. Since such expressions
are always reformatted to fit minimal space, this whitespace is lost.
It will also insert proper spacing before and after function definitions.
It’s one line before and after inner functions and two lines before and
after module-level functions. Black will not put empty lines between
function/class definitions and standalone comments that immediately precede
the given function/class.
Black will add trailing commas to expressions that are split
by comma where each element is on its own line. This includes function
Unnecessary trailing commas are removed if an expression fits in one
line. This makes it 1% more likely that your line won’t exceed the
allotted line length limit. Moreover, in this scenario, if you added
another argument to your call, you’d probably fit it in the same line
anyway. That doesn’t make diffs any larger.
One exception to removing trailing commas is tuple expressions with
just one element. In this case Black won’t touch the single trailing
comma as this would unexpectedly change the underlying data type. Note
that this is also the case when commas are used while indexing. This is
a tuple in disguise: numpy_array[3, ].
One exception to adding trailing commas is function signatures
containing *, *args, or **kwargs. In this case a trailing comma
is only safe to use on Python 3.6. Black will detect if your file is
already 3.6+ only and use trailing commas in this situation. If you
wonder how it knows, it looks for f-strings and existing use of trailing
commas in function signatures that have stars in them. In other words,
if you’d like a trailing comma in this situation and Black didn’t
recognize it was safe to do so, put it there manually and Black will
Black prefers double quotes (" and """) over single quotes ('
and '''). It will replace the latter with the former as long as it
does not result in more backslash escapes than before.
Black also standardizes string prefixes, making them always lowercase.
On top of that, if your code is already Python 3.6+ only or it’s using
the unicode_literals future import, Black will remove u from the
string prefix as it is meaningless in those scenarios.
The main reason to standardize on a single form of quotes is aesthetics.
Having one kind of quotes everywhere reduces reader distraction.
It will also enable a future version of Black to merge consecutive
string literals that ended up on the same line (see #26 for details).
Why settle on double quotes? They anticipate apostrophes in English
text. They match the docstring standard described in PEP 257. An
empty string in double quotes ("") is impossible to confuse with
a one double-quote regardless of fonts and syntax highlighting used.
On top of this, double quotes for strings are consistent with C which
Python interacts a lot with.
On certain keyboard layouts like US English, typing single quotes is
a bit easier than double quotes. The latter requires use of the Shift
key. My recommendation here is to keep using whatever is faster to type
and let Black handle the transformation.
Line breaks & binary operators
Black will break a line before a binary operator when splitting a block
of code over multiple lines. This is so that Black is compliant with the
recent changes in the PEP 8
style guide, which emphasizes that this approach improves readability.
This behaviour may raise W503 line break before binary operator warnings in
style guide enforcement tools like Flake8. Since W503 is not PEP 8 compliant,
you should tell Flake8 to ignore these warnings.
PEP 8 recommends
to treat : in slices as a binary operator with the lowest priority, and to
leave an equal amount of space on either side, except if a parameter is omitted
(e.g. ham[1 + 1 :]). It also states that for extended slices, both :
operators have to have the same amount of spacing, except if a parameter is
omitted (ham[1 + 1 ::]). Black enforces these rules consistently.
This behaviour may raise E203 whitespace before ':' warnings in style guide
enforcement tools like Flake8. Since E203 is not PEP 8 compliant, you should
tell Flake8 to ignore these warnings.
Some parentheses are optional in the Python grammar. Any expression can
be wrapped in a pair of parentheses to form an atom. There are a few
for (...) in (...):
assert (...), (...)
from X import (...)
target = (...)
target: type = (...)
some, *un, packing = (...)
augmented += (...)
In those cases, parentheses are removed when the entire statement fits
in one line, or if the inner expression doesn’t have any delimiters to
further split on. If there is only a single delimiter and the expression
starts or ends with a bracket, the parenthesis can also be successfully
omitted since the existing bracket pair will organize the expression
neatly anyway. Otherwise, the parentheses are added.
Please note that Black does not add or remove any additional nested
parentheses that you might want to have for clarity or further
code organization. For example those parentheses are not going to be
returnnot (this or that)
decision = (maybe.this() and values >0) or (maybe.that() and values <0)
Some popular APIs, like ORMs, use call chaining. This API st