diff --git a/coolamqp/framing/compilation/compile_definitions.py b/coolamqp/framing/compilation/compile_definitions.py index 2b9b16699e30cff965926bd29fdedf0ab58cd370..964953a7b42c1ae9071bfee4b9e35f0909cad202 100644 --- a/coolamqp/framing/compilation/compile_definitions.py +++ b/coolamqp/framing/compilation/compile_definitions.py @@ -215,25 +215,25 @@ Field = collections.namedtuple('Field', ('name', 'type', 'basic_type', 'reserved line(u' ])\n zpf = six.binary_type(zpf)\n') line(u''' if zpf in %s.PARTICULAR_CLASSES: - warnings.warn(u"""You could go faster. - - If you know in advance what properties you will be using, use typized constructors like - - # runs once - my_type = BasicContentPropertyList.typize('content_type', 'content_encoding') - # runs many times - props = my_type('text/plain', 'utf8') - - instead of - - # runs many times - props = BasicContentPropertyList(content_type='text/plain', content_encoding='utf8') - - This way you will be faster. - - If you do not know in advance what properties you will be using, it is correct to use - this constructor. - """) + warnings.warn(u"You could go faster. Go see the comments here") + +# If you know in advance what properties you will be using, use typized constructors like +# +# runs once +# my_type = BasicContentPropertyList.typize('content_type', 'content_encoding') +# +# runs many times +# props = my_type('text/plain', 'utf8') +# +# instead of +# +# # runs many times +# props = BasicContentPropertyList(content_type='text/plain', content_encoding='utf8') +# +# This way you will be faster. +# +# If you do not know in advance what properties you will be using, it is correct to use +# this constructor. return %s.PARTICULAR_CLASSES[zpf](**kwargs) else: diff --git a/coolamqp/framing/definitions.py b/coolamqp/framing/definitions.py index 6532deae8fa46f068124ca1543a7fef0e89e6098..2479e2d2230b075bf1ad42bd362956fa1ba5195a 100644 --- a/coolamqp/framing/definitions.py +++ b/coolamqp/framing/definitions.py @@ -2378,25 +2378,25 @@ class BasicContentPropertyList(AMQPContentPropertyList): zpf = six.binary_type(zpf) if zpf in BasicContentPropertyList.PARTICULAR_CLASSES: - warnings.warn(u"""You could go faster. - - If you know in advance what properties you will be using, use typized constructors like - - # runs once - my_type = BasicContentPropertyList.typize('content_type', 'content_encoding') - # runs many times - props = my_type('text/plain', 'utf8') - - instead of - - # runs many times - props = BasicContentPropertyList(content_type='text/plain', content_encoding='utf8') - - This way you will be faster. - - If you do not know in advance what properties you will be using, it is correct to use - this constructor. - """) + warnings.warn(u"You could go faster. Go see the comments here") + +# If you know in advance what properties you will be using, use typized constructors like +# +# runs once +# my_type = BasicContentPropertyList.typize('content_type', 'content_encoding') +# +# runs many times +# props = my_type('text/plain', 'utf8') +# +# instead of +# +# # runs many times +# props = BasicContentPropertyList(content_type='text/plain', content_encoding='utf8') +# +# This way you will be faster. +# +# If you do not know in advance what properties you will be using, it is correct to use +# this constructor. return BasicContentPropertyList.PARTICULAR_CLASSES[zpf](**kwargs) else: