Noah Saunders

Noah Saunders

1602293940

Exploring the New Features of Python 3.9

Python 3.9 has arrived! This week on the show, former guest and Real Python author Geir Arne Hjelle returns to talk about his recent article, “Python 3.9: Cool New Features for You to Try”. Also joining the conversation is Real Python video course instructor and author Christopher Trudeau. Christopher has created a video course, which was released this week also, based on Geir Arne’s article. We talk about time zones, merging dictionaries, the new parser, type hints, and more.

Geir Arne and Christopher not only cover the new features, but they also offer advice about ways you might incorporate them into your code. We discuss what you should think about before updating your code.

Topics:

  • 00:00:00 – Introduction
  • 00:02:02 – Proper Time Zone support
  • 00:05:38 – What to do if your OS does not have tzdata?
  • 00:07:11 – How do you add time zone info to your Python code?
  • 00:08:24 – Historic changes to time zones
  • 00:10:48 – New operators for updating dictionaries
  • 00:15:44 – Geir Arne’s PyCon 2020 decorators tutorial
  • 00:18:02 – Changes to decorator syntax
  • 00:24:08 – Annotated type hints
  • 00:32:36 – Video Course Spotlight
  • 00:33:26 – The PEG parser
  • 00:37:51 – Potential for new enhancements in upcoming releases
  • 00:42:40 – String methods to remove prefixes and suffixes
  • 00:44:22 – Type hint lists and dictionaries directly
  • 00:47:29 – Topological Sort
  • 00:52:03 – Greatest Common Divisor (GCD) and Least Common Multiple (LCM)
  • 00:53:50 – New HTTP status codes
  • 00:58:29 – Should you upgrade?
  • 01:07:58 – Potential issue with Python 3.10 versioning
  • 01:10:18 – What are you excited about in the world of Python?
  • 01:12:52 – What do you want to learn next?
  • 01:14:08 – Thanks and goodbyes

#python

What is GEEK

Buddha Community

Exploring the New Features of Python 3.9
Ray  Patel

Ray Patel

1619518440

top 30 Python Tips and Tricks for Beginners

Welcome to my Blog , In this article, you are going to learn the top 10 python tips and tricks.

1) swap two numbers.

2) Reversing a string in Python.

3) Create a single string from all the elements in list.

4) Chaining Of Comparison Operators.

5) Print The File Path Of Imported Modules.

6) Return Multiple Values From Functions.

7) Find The Most Frequent Value In A List.

8) Check The Memory Usage Of An Object.

#python #python hacks tricks #python learning tips #python programming tricks #python tips #python tips and tricks #python tips and tricks advanced #python tips and tricks for beginners #python tips tricks and techniques #python tutorial #tips and tricks in python #tips to learn python #top 30 python tips and tricks for beginners

Ray  Patel

Ray Patel

1619510796

Lambda, Map, Filter functions in python

Welcome to my Blog, In this article, we will learn python lambda function, Map function, and filter function.

Lambda function in python: Lambda is a one line anonymous function and lambda takes any number of arguments but can only have one expression and python lambda syntax is

Syntax: x = lambda arguments : expression

Now i will show you some python lambda function examples:

#python #anonymous function python #filter function in python #lambda #lambda python 3 #map python #python filter #python filter lambda #python lambda #python lambda examples #python map

Biju Augustian

Biju Augustian

1574340704

The Python 3 New Features from Python Enhancement Proposal

Description
Python 2 will end of life in 2020!!!

If you are a Python 2 developer, it’s time to porting your code into Python 3 !!!

Course Summary

If you are a Python 2 developer and haven’t had the chance to use Python 3, this course is for you. We will talk about Python 3 new feature with demos and make sure you can understand them all
What’s this course about and why you should take it?

This course let you master the new and cool features in Python 3
We assume you have a base knowledge of the subset of Python that runs in Python 2 and 3. We dive deep into every aspect of Python 3 and the PEP’s that prompted those changes. From advanced string formatting, number updates, changes in classes and functions, to Unicode, Type annotation and synchronous Programming, this course covers it all. You will see the features in action and try them out for yourself
Who is this course for?

For anyone who has wanted to dive into the new features of Python 3. It is quite easy to write code that works in both Python 2 and 3. Many old Python developers are used to the features of 2 and have never looked into all of the new features that Python 3 provides. Many new programmers are using Python 3, but are missing out on new features like async and annotations
Existing Python 3 users: If you aren’t using Python to its full potential, you owe it to yourself to checkout this course and see a wealth of Python 3 features that you might not even know exist. You will see and explore most of them in this course!
Basic knowledge
Requirements

Beginner level of python 2 programmer
A computer installed Python 3
What will you learn
understand the differences between Python 2 and Python 3
can port their own code from python 2 to python 3
write python 3 native code
learn Python 3 new feature

# Python 3 #Python Enhancement Proposal # Python 3 New Features from Python Enhancement Proposal

Luna  Hermann

Luna Hermann

1598897520

What Are The New Features in Python 3.9?

It’s that time again, a new version of Python is imminent. Now in beta (3.9.0b3), we will soon be seeing the full release of Python 3.9.

Some of the newest features are incredibly exciting, and it will be amazing to see them used after release. We’ll cover the following:

  • Dictionary Union Operators
  • Type Hinting
  • Two New String Methods
  • New Python Parser

— this is very cool

Let’s take a first look at these new features and how we use them.

Dictionary Unions

One of my favorite new features with a sleek syntax. If we have two dictionaries a and b that we need to merge, we now use the union operators.

We have the **merge **operator |:

a = {1: 'a', 2: 'b', 3: 'c'}
b = {4: 'd', 5: 'e'}
c = a | b
print(c)

[Out]: {1: ‘a’, 2: ‘b’, 3: ‘c’, 4: ‘d’, 5: ‘e’}

And the **update **operator |=, which updates the original dictionary:

a = {1: 'a', 2: 'b', 3: 'c'}
b = {4: 'd', 5: 'e'}
a |= b
print(a)

[Out]: {1: ‘a’, 2: ‘b’, 3: ‘c’, 4: ‘d’, 5: ‘e’}

If our dictionaries share a common key, the key-value pair in the second dictionary will be used:

a = {1: 'a', 2: 'b', 3: 'c', 6: 'in both'}
b = {4: 'd', 5: 'e', 6: 'but different'}
print(a | b)

**[Out]: **{1: ‘a’, 2: ‘b’, 3: ‘c’, 6: ‘but different’, 4: ‘d’, 5: ‘e’}

Dictionary Update with Iterables

Another cool behavior of the |= operator is the ability to **update **the dictionary with new key-value pairs using an iterable object — like a list or generator:

a = {'a': 'one', 'b': 'two'}
b = ((i, i**2) for i in range(3))
a |= b
print(a)

#python #python-programming #latest-tech-stories #python-top-story #python3 #learn-python #programming #python-tips

Zakary  Goyette

Zakary Goyette

1602241200

Python 3.9: New Parser, IANA Timezone, Type Hinting

On October 5, the Python Software Foundation released Python 3.9. Previously, the Python team had been following an 18-month development and release cycle but has now shifted to an annual release cycle. The latest version of this highly popular language has brought forth several new features. Here, we enlist the most prominent ones.

Introduction of PEG-Based Parser

Python 3.9 proposes to replace the current LL(1)-based parser with a high-performing and more stable Parsing Expression Grammar (PEG) parser. With this replacement, the new parser will lift the current LL (1) grammar Python restriction. The PEG parser differs from its predecessor in a way that is not context-free. The fundamental difference is that the choice operator is ordered.

#opinions #iana timezone #peg parser #python 3.9 #python features #python