diff --git a/examples/autocomplete/autocomplete.py b/examples/autocomplete/autocomplete.py index 666985de1..2f59fe934 100644 --- a/examples/autocomplete/autocomplete.py +++ b/examples/autocomplete/autocomplete.py @@ -15,7 +15,7 @@ from tornado.escape import json_decode from tornado import ioloop -from rx import operators as _ +from rx import operators as ops from rx.subjects import Subject from rx.concurrency import IOLoopScheduler @@ -50,11 +50,11 @@ def open(self): # Get all distinct key up events from the input and only fire if long enough and distinct searcher = self.stream.pipe( - _.map(lambda x: x["term"]), - _.filter(lambda text: len(text) > 2), # Only if the text is longer than 2 characters - _.debounce(0.750), # Pause for 750ms - _.distinct_until_changed(), # Only if the value has changed - _.flat_map_latest(search_wikipedia) + ops.map(lambda x: x["term"]), + ops.filter(lambda text: len(text) > 2), # Only if the text is longer than 2 characters + ops.debounce(0.750), # Pause for 750ms + ops.distinct_until_changed(), # Only if the value has changed + ops.flat_map_latest(search_wikipedia) ) def send_response(x): diff --git a/examples/autocomplete/autocomplete_asyncio.py b/examples/autocomplete/autocomplete_asyncio.py index 6ab0cbd18..aeef778e0 100644 --- a/examples/autocomplete/autocomplete_asyncio.py +++ b/examples/autocomplete/autocomplete_asyncio.py @@ -17,7 +17,7 @@ from tornado.web import RequestHandler, StaticFileHandler, Application, url from tornado.websocket import WebSocketHandler -from rx import operators as _ +from rx import operators as ops from rx.concurrency import AsyncIOScheduler from rx.subjects import Subject @@ -52,11 +52,11 @@ def open(self): # Get all distinct key up events from the input and only fire if long enough and distinct searcher = self.subject.pipe( - _.map(lambda x: x["term"]), - _.filter(lambda text: len(text) > 2), # Only if the text is longer than 2 characters - _.debounce(0.750), # Pause for 750ms - _.distinct_until_changed(), # Only if the value has changed - _.flat_map_latest(search_wikipedia) + ops.map(lambda x: x["term"]), + ops.filter(lambda text: len(text) > 2), # Only if the text is longer than 2 characters + ops.debounce(0.750), # Pause for 750ms + ops.distinct_until_changed(), # Only if the value has changed + ops.flat_map_latest(search_wikipedia) ) def send_response(x):