Code Monkey home page Code Monkey logo

free.dm-common's People

Contributors

derekroy avatar geotom avatar wandth avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

derekroy

free.dm-common's Issues

Server transport does not await coroutine on closedown

When exiting a server transport in Python 3.7, the transport does not inform active clients of shutdown and cancel their active read/write handlers

freedm/transport/server/base.py:135: RuntimeWarning: coroutine 'wait' was never awaited

Add own freedm exception base class and derivates

When the freedm package is used as library it would be good if we throw a freedm related exception class with its own basic error handling and more specific meaning instead of general Python exceptions

Use generator expressions instead of comprehension where possible

If we need to iterate only once, it is better to use a generator expression instead of a normal list comprehension!

#Generator expression
(x*2 for x in range(256))

#List comprehension
[x*2 for x in range(256)]

By using list(generator_expr) we would get the same result when needed.

Check the code where we use comprehensions and replace these when possible (https://medium.freecodecamp.org/python-list-comprehensions-vs-generator-expressions-cef70ccb49db). Also look at Async comprehensions introduced with python 3.6
https://www.blog.pythonlibrary.org/2017/02/14/whats-new-in-python-asynchronous-comprehensions-generators/

Upgrade existing code to Python 3.7

Tasks

  • See where we can use Data Classes (https://docs.python.org/3.7/whatsnew/3.7.html#whatsnew37-pep557)
  • Typing now got additional support y PEP 560 (https://docs.python.org/3.7/whatsnew/3.7.html#whatsnew37-pep560)
  • Introduction of "Postponed Evaluation of Annotations" should render the creation of TypeVars unnecessary (https://docs.python.org/3.7/whatsnew/3.7.html#whatsnew37-pep563). See for instance server/client base classes
    *Argparse has a new parse_intermixed_args() method (https://docs.python.org/3.7/library/argparse.html#argparse.ArgumentParser.parse_intermixed_args)
  • Adopt to changes and recommendations in asyncio (https://docs.python.org/3.7/whatsnew/3.7.html#whatsnew37-asyncio)
  • Change for instance: ensure_future -> create_task?
  • The new StreamWriter.wait_closed() coroutine method allows waiting until the stream writer is closed.
  • The asyncio.Task.current_task() and asyncio.Task.all_tasks() methods have been deprecated.
  • ProcessPoolExecutor and ThreadPoolExecutor now support the new initializer and initargs constructor arguments.
  • The ProcessPoolExecutor can now take the multiprocessing context via the new mp_context argument.
  • Enum: The Enum learned the new ignore class property, which allows listing the names of properties which should not become enum members.
  • os.scandir() gained support for file descriptors
  • Sockets
    • The new socket.close() function closes the passed socket file descriptor. This function should be used instead of os.close() for better compatibility across platforms
    • Sockets now auto-detect family, type and protocol from file descriptor by default
  • SSL: The ssl module now uses OpenSSL’s builtin API instead of match_hostname() to check a host name or an IP address. Values are validated during TLS handshake. Any certificate validation error including failing the host name check now raises SSLCertVerificationError and aborts the handshake with a proper TLS Alert message. The new exception contains additional information. Host name validation can be customized with SSLContext.host_flags

#Todo

  • Try to implement first missing changes of #1
  • Check if tests work afterwards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.