Python List Comprehensions Help

I think I can help clarify this a little, although, this is just my outsider understanding of the issue and why I think the change was a good one.

In 7.9 there were 6 functions that worked with the tag system

  1. system.tag.read()
  2. system.tag.readAll()
  3. system.tag.write()
  4. system.tag.writeAll()
  5. system.tag.writeSyncronous()
  6. system.tag.writeAllSyncronous()

This was confusing for some users who expected similarly named functions to behave the same. For instance, system.tag.write() is an *asynchronous * function, meaning that it does not block the thread on which it is called. However, system.tag.read() is a synchronous function, meaning that it does block the thread on which it is called.

If you wanted a write operation to block the thread, then you needed to explicitly call system.tag.writeSyncronous().

There was no direct function for an asynchronous read and if you wanted to do that then you had to do it explicitly.

I think you can see how this could be confusing. In then end asynchronous or not, all of the functions eventually did one of two operations, readBlocking or writeBlocking, just sometimes that was wrapped inside of another function which made the operation asynchronous or not.

In order to clear up some of the potential confusion they removed the abstraction that was in place where it could be.

So we arrived at the now 4 functions with a clear meaning from just the naming convention.

  1. system.tag.readBlocking()
  2. system.tag.readAsync()
  3. system.tag.writeBlocking()
  4. system.tag.writeAsync()

Now when you call these functions you know what you get just from the name. readBlocking will block the thread, readAsync will not block the thread.

I don't know if there were any changes under the hood, but even so I feel the name change was a great move.

4 Likes