Skip to content
Magenaut

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

python-3.5

What are type hints in Python 3.5?

August 22, 2022 by Magenaut

One of the most talked-about features in Python 3.5 is type hints.

Categories Python, Q&A Tags python, python-3.5, python-3.x, python-typing, type-hinting Leave a comment

“Fire and forget” python async/await

August 20, 2022 by Magenaut

Sometimes there is some non-critical asynchronous operation that needs to happen but I don’t want to wait for it to complete. In Tornado’s coroutine implementation you can “fire & forget” an asynchronous function by simply ommitting the yield key-word.

Categories Python, Q&A Tags python, python-3.5, python-asyncio Leave a comment

What is the ‘@=’ symbol for in Python?

August 19, 2022 by Magenaut

I know @ is for decorators, but what is @= for in Python? Is it just reservation for some future idea?

Categories Python, Q&A Tags matrix-multiplication, operators, python, python-3.5, python-3.x Leave a comment

How can I periodically execute a function with asyncio?

August 18, 2022 by Magenaut

I’m migrating from tornado to asyncio, and I can’t find the asyncio equivalent of tornado‘s PeriodicCallback. (A PeriodicCallback takes two arguments: the function to run and the number of milliseconds between calls.)

Categories Python, Q&A Tags python, python-3.5, python-3.x, python-asyncio, tornado Leave a comment

Difference between numpy dot() and Python 3.5+ matrix multiplication @

August 18, 2022 by Magenaut

I recently moved to Python 3.5 and noticed the new matrix multiplication operator (@) sometimes behaves differently from the numpy dot operator. In example, for 3d arrays:

Categories Python, Q&A Tags matrix-multiplication, numpy, python, python-3.5 Leave a comment

How to use asyncio with existing blocking library?

August 15, 2022 by Magenaut

I have few blocking functions foo, bar and I can’t change those (Some internal library I don’t control. Talks to one or more network services). How do I use it as async?. E.g. I wan’t to do the following.

Categories Python, Q&A Tags async-await, python, python-3.5, python-3.x, python-asyncio Leave a comment

ImportError: No module named ‘django.core.urlresolvers’

August 14, 2022 by Magenaut

I am working on Django project where I need to create a form for inputs. I tried to import reverse from django.core.urlresolvers. I got an error:

Categories Python, Q&A Tags django, django-2.0, python, python-3.5, python-3.x Leave a comment

“Asyncio Event Loop is Closed” when getting loop

August 12, 2022 by Magenaut

When trying to run the asyncio hello world code example given in the docs:

Categories Python, Q&A Tags python, python-3.5, python-asyncio Leave a comment

How to set Python3.5.2 as default Python version on CentOS?

August 12, 2022 by Magenaut

Is there a way to set the Python 3.5.2 as the default Python version on CentOS 7? currently, I have Python 2.7 installed as default and Python 3.5.2 installed separately.

Categories Python, Q&A Tags bash, centos, python, python-3.5, python-3.x Leave a comment

Python type hinting without cyclic imports

August 12, 2022 by Magenaut

I’m trying to split my huge class into two; well, basically into the “main” class and a mixin with additional functions, like so:

Categories Python, Q&A Tags python, python-3.4, python-3.5, python-typing, type-hinting Leave a comment

Recent Comments

  • silverplugins217 on How to add placeholder for contact form7 for dropdown?
  • Shreyas Ikhar on How to add a custom CSS class to core blocks in Gutenberg editor?
  • Magenaut on How to call function on timer ASP.NET MVC
  • Ebaad Uddin on How to call function on timer ASP.NET MVC
  • michealSmith07 on Is there a way to dynamically refresh the less command?

Tags

.net adobe-illustrator adobe-photoshop ajax arrays asp.net asp.net-core asp.net-mvc bash c# css database django eloquent express html java javascript jquery json laravel laravel-4 laravel-5 laravel-8 linux list mongodb mongoose mysql node.js npm pandas php python python-3.x react-hooks react-native react-router reactjs redux regex sql string typescript wordpress
© 2023 Magenaut • Built with GeneratePress